Change the bend of a cast member
Hi guys, I've a problem with the blend of one of my members
cast.
I created one filled rectangle (by tools: default). I'm
trying to change his blend value by a click in other one. Also I
Know the solucion is similar to:
member("myButton").blend = 100 or
Can somebody help me?
> member("myButton").blend = 100 or
You have to change the blend of the sprite, not the member:
-- assuming your #shape is in channel 5
sprite(5).blend = 50
Similar Messages
-
How to change the text color to red in a combo box?
I'm writing a java program which have a combo box which shows all the name of the member from the database. However, I would like to change the text color of those member who have now currently on-line.
Please help, it's URGENT. Thanks in advance.
Clarkhi,
as i mentioned, you would require to use a custom renderer for this, for this
//Class subclass the JFrame and has a JList in it
import javax.swing.*;
import java.awt.*;
import java.util.Vector;
public class ListRendererTest extends JFrame
private JList lstMenu;
private DefaultListModel defaultListModel;
private JScrollPane scrollPane;
private Vector listVector;
public ListRendererTest()
init();
addComponents();
showFrame();
public void init()
lstMenu = new JList();
defaultListModel= new DefaultListModel();
lstMenu.setModel(defaultListModel);
scrollPane = new JScrollPane(lstMenu);
listVector = new Vector();
MyListData m1 = new MyListData();
m1.setName("Rakesh");
m1.setOnline(false);
listVector.addElement(m1);
m1 = new MyListData(); //represents each User instance
m1.setName("Makesh");
m1.setOnline(true);
listVector.addElement(m1);
for (int i=0;i < listVector.size(); i++)
defaultListModel.addElement(((MyListData)listVector.elementAt(i)));
lstMenu.setCellRenderer(new MyListRenderer()); //set custom renderer
public void addComponents()
getContentPane().add(scrollPane,BorderLayout.CENTER);
public void showFrame()
setTitle("List renderer test");
setSize(300,300);
setLocation(200,200);
setVisible(true);
public static void main(String args[])
new ListRendererTest();
}The above class is the Container which houses the JList in it, it uses two other classes, MyListData which is used to represent each user instance ( username, and information about whether he is online) and MyListRenderer (custom renderer).
// Represents each user instance //
public class MyListData
private String name;
private boolean online;
public void setName(String name)
this.name = name;
public String getName()
return name;
public void setOnline(boolean online)
this.online = online;
public boolean isOnline()
return online;
//custom list renderer
import javax.swing.*;
import java.awt.*;
public class MyListRenderer extends DefaultListCellRenderer
private MyListData myListData;
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
myListData = (MyListData)value;
setText(myListData.getName());
setBackground(myListData.isOnline() ? Color.red: Color.white); //check if online, if so show in different color
setForeground(isSelected ? Color.blue : Color.black);
return this;
}hope that helps.
cheerz
ynkrish -
Changing the cast member of a sprite
Hi, I have the following code so that when a user clicks on a
shape (acting as a button), it changes the cast member of an
existing sprite called "base" on the stage to an image cast member
called "Italian Lira". However the code does not work, any
suggestions what I have done wrong?
on mouseUp me
currency = "Italian Lira"
sprite("base").member = member(currency)
endThanks for keeping me sane Mike. I've always used a global
list with sprite
assignments so I never had to deal with whether or not the
sprite names
feature worked. But I guess you've dispelled the myth.
Thanks.
I guess we still don't know whether "base" is a sprite name
or mistakenly
and cast member name. I see that we haven't heard back from
pete_484 on
this.
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581
www.wordofmouthpros.com
"Mike Blaustein" <[email protected]> wrote in
message
news:enthgu$22c$[email protected]..
> Yes they did. I am not sure why so many people are
saying not to do it,
> because I name sprites in practically every project I do
these days.
> Assuming that you sprite is named correctly, this should
work (I just
> removed the word member in the 2nd line):
>
> on mouseUp me
> currency = "Italian Lira"
> sprite("base").member = currency
> end -
Change cast member of another sprite on rollover?
There is probably a really easy answer for this question but I just have NO IDEA how to approach it and am about ready to blow my brains out ... (new at this, yes) so ANY HELP would be greatly appreciated.
When rolling over or "on mouseEnter me" of a certain sprite, I would like to change the cast member of ANOTHER sprite as well as the current one (having no problems with the current one as it's all set up in the behaviours lol) is this possible? and how would the lingo go for this?
thanksDon't do what Multiduck suggests. Sprites should never change the properties of other sprites. That is a bad practice prone to creating nasty bugs.
Create a behavior for the second sprite that has a handler for changing its member. You might call it "showRollOver". Then your first sprite simply calls that handler.
sprite(x).showRollOver()
If you want the second sprite to react to mouse overs, then just use the mouseEnter method and call that handler from the first sprite.
sprite(x).mouseEnter()
Note: You can directly call any handler that is added to a sprite, ie,
sprite(x).mouseDown()
sprite(x).beginSprite()
sprite(x).setText()
sprite(x).fadeOut() -
Hello:
I need to change images in the stage from the cast member.
The problem is that when I change the image, the previous
image on the stage
appears and quickly the new appears.
How can I desappear the previous image before to show the
new?
Thank you very muchThank you:
The problem is that I am stopped in frame 10 for example, in
this frame I
change the cast member image by Lingo and send the head to
frame 1 and the
image that I had before I see it and then change to the new.
"JB" <[email protected]> escribi� en el
mensaje
news:[email protected]..
> Not understanding exactly what your are doing, one can
temporarily had
> the sprite by setting the blend prop to 0 or by setting
the vidoble of
> >
> A sprite triggered by an on EnerFrame handler could
switch te member
> before the score assigned mbmer makes it's initial
appearance. -
Have just brought an apple iPad off a family member and I want to change the ID that is need to download and update apps in the store.
Tap Settings > General > Reset > Reset All Settings
Reconfigure for new settings. -
How to change the order of parent member on data forms
Hi,
Is there any way to show parent on top of its children in data form row level?
By default data form display members like this:
__Child 1
__Child 2
+Parent
Instead of above i want this sequence:
+Parent
__Child 1
__Child 2Have a read of
Can we change the display order of member set functions like @Idescendant?
Re: the order of member showing in dataform
Cheers
John
http://john-goodwin.blogspot.com/ -
How can I save a cast member to the hard drive?
Hi,
I am using 'canvas' from the Paintbox library.
I found a line of code on the forum to create a 'new' cast member.
Now, I'd like to save that new cast member to the hard drive.
BuddyApi doesn't have an option to do that, and I haven't had any luck with the Xtras lists I've found.
How can I accomplish this?
Thanks in advance for your assistance,
BigDaddyTo elaborate, this is how you would call the Xtra in your code:
-- create the instance of the xtra
objImg = xtra("ImgXtra").new()
-- get the member's image we want to save
imgToSave = member("foobar").image
-- set the path and filename for the bitmap
strFileName = the moviePath & "foobar.jpg"
-- call the ix_saveImage method, with required parameters
success = objImg.ix_saveImage(["image": imgToSave, "filename": strFileName])
-- returns 1 if successful, 0 if not
if success then
-- something here
else
-- something else here
end
-- clear the xtra object instance
objImg = VOID
The other optional parameters such as format and flags can be set, if you like, and the info can be found in the imgXtra.txt document. -
Load flash cast member in the root of flash sprite (is possible?)
load flash cast member in the root of flash sprite, is
possible?i explain better, the user must download the projector from
internet and i
want protect the swf files include these in one exe
application
this is what my client want
tnanks
"Rob Dillon - Adobe Community Expert"
<[email protected]> ha
scritto nel messaggio
news:[email protected]..
> I'm not sure when or where you would need this
functionality. If you are
> creating a projector, then how are you distributing it?
If you are using
> a CD, then it doesn't matter how many files you have.
>
> If you want to bundle everything together for a
download, then just use
> an installer.
>
> --
> Rob
> _______
> Rob Dillon
> Adobe Community Expert
>
http://www.ddg-designs.com
> 412-243-9119
>
>
http://www.macromedia.com/software/trial/ -
Change the language of a new CC member invitation
Is it possible to specify the language a new CC member received, when I invite him to join CC. We are based in the Netherlands, but most of my colleges only speak English. They now receive a message in Dutch, they do not understand.
Found it
Go to your Adobe ID account page.
Click Overview (if not already there).
In Agreements and Products, click Show all-button.
Click Manage Agreement on the agreement you want to change the language of.
Click Edit at Standard language for e-mail.
(May have to be primary administrator) -
Gave hubby my old Macbook Pro a few years ago. We want to change the admin name but can't figure out how. We did change the password by starting up from the Snow Leopard install disc.
When you reinstall the OSX, you can change not only the password but the administrator as well.
Ciao. -
How to intersect with any sprite of a certain cast member?
Hi. I am trying to script a simple 2d platformer engine for a larger University project. I have movement sorted with W and A and gravity. I can get collision detection with the floor by doing
if sprite 1 intersects sprite 2 then
gvGrav = 0
end if
Sprite 1 is the player and sprite 2 is an instance of the cast member called ground. How would I get this to work with any sprite that is ground? Ill paste the full code below.
global gvRight
global gvLeft
global gvGrav
global gvDown
on enterFrame
-----------MOVE LEFT---------------------
if keyPressed("a") then
sprite(4).locH=sprite(4).locH+gvLeft
_movie.updateStage()
gvLeft = gvLeft - .5
if gvLeft < - 15 then
gvLeft = -15
end if
end if
if not keypressed("a") then
gvLeft = 0
end if
-----------MOVE RIGHT--------------------
if keyPressed("d") then
sprite(4).locH=sprite(4).locH+gvRight
_movie.updateStage()
gvRight = gvRight + .5
if gvRight > 15 then
gvRight = 15
end if
end if
if not keypressed("d") then
gvRight = 0
end if
-----------GRAVITY-------------------------
gvGrav = gvGrav
sprite(4).locV=sprite(4).locV+gvGrav
_movie.updateStage()
gvGrav = gvGrav +.5
if gvGrav > 30 then
gvGrav = 30
end if
-------------GravityCollision----------------------
if sprite 4 intersects sprite 1 then
gvGrav = 0
end if
if sprite 4 intersects sprite 2 then
gvGrav = 0
end if
end ifI dare say there's a better way to do this, but an easy way is to set a global variable, do a sendallsprites message, and check the global variable again.
So, if you had an extra global in your man control script:
global hitman
then in your collision checking part you would say this:
hitman = false
sendallsprites #checkcollision 4
if hitman = true then
gvGrav = 0
end if
The #checkcollision message would get sent to all sprites, and if you had a behavior placed on the floor sprites, that was like this:
global hitman
property mysprite
on beginsprite me
mysprite = the spritenum of me
end
on checkcollision me,s
if sprite s intersects sprite mysprite then
hitman = true
end if
end
any one of those sprites that intersected with the sprite you ask about would then change the global 'hit man' variable to be true. To make a sprite behave like floor, you would just attach that behavior script.
Notice how the floor sprite makes a note of its sprite number when it first shows up on the stage, you could do the same with your other script, if it's attached to the man character. Then you wouldn't have to have it hard coded to '4', which would save some headaches later if you have to change the sprite layers. -
Hi,
I need to create a dynamic menu for an application. Right
now I am creating every item as a new cast member:
newMember = new(#text)
member(newMember).name = "Item1"
member(newMember).text = "Blabla"
What I would like to do, is have an existing cast member with
the good font, font size, color, etc... and in my lingo script,
create all my new cast members based on the existing one, so I
would only need to change the text it contains and not the color,
size....
It could also be usefull to do this since I could attach a
behavior to the existing cast member and then all my new ones would
have the same behavior attached to them.
I hope this can be done, sorry if it is obvious, I'm in the
process of learning Director and Lingo.
Thanks,
PatHi Pat, and welcome to the list.
As for your question, I'd suggest you work with a single cast
in general,
unless it really helps organizing your project.
Creating members on the fly -as it seems you are doing- is a
much cleaner
approach.
Why don't you create a handler that would accept as arguments
the formatting
options and the member they should be applied to?
Or e.g. two handlers that each would apply some fixed
formatting to a member
that is passed to it.
The less the members, the smaller the project, btw.
> It could also be useful to do this since I could attach
a behavior to the
> existing cast member
I suppose you are talking about cast member scripts, not
behaviors. Another
thing you'd better avoid, since behaviors (scripts attached
to sprites) are
more flexible, receive notifications that script members
don't (like e.g. on
beginSprite), and are designed for oop (a reference to the
script
object -me- is passed as the first argument by the system
when calling
behaviors' handlers).
"PDiLalla" <[email protected]> wrote in
message
news:f97p50$rh1$[email protected]..
> Hi,
>
> I need to create a dynamic menu for an application.
Right now I am
> creating
> every item as a new cast member:
>
> newMember = new(#text)
> member(newMember).name = "Item1"
> member(newMember).text = "Blabla"
>
> What I would like to do, is have an existing cast member
with the good
> font,
> font size, color, etc... and in my lingo script, create
all my new cast
> members
> based on the existing one, so I would only need to
change the text it
> contains
> and not the color, size....
>
> It could also be usefull to do this since I could attach
a behavior to the
> existing cast member and then all my new ones would have
the same behavior
> attached to them.
>
> I hope this can be done, sorry if it is obvious, I'm in
the process of
> learning Director and Lingo.
>
> Thanks,
> Pat
> -
Making dynamic sprites from a cast member
Hello ,realy I am making a movie that it has the words and
the meanings and the pronounciation and the image of the word of 20
lessons ,realy I make a propertly list for the words and the
meanings for each chapter in a text document for each lesson and
retrievet the words and the meanings on the stage and assign the
them into separate sprites made by a text cast member ,Now I have a
problem ,the number of words and new words are not equal for each
lesson ,there fore I look for a way to make the sprites same as the
number of the words of each lesson from the cast member , is it
realy possible ?
Thank you very much
Sincerely yours MohsenaHello and thank you for your attention ,yes as you mentioned
I should change the content of the text members ,in this way when I
want tthe words and the meanig of lesson 2 ,I should change the
content ,But my problem is in this phase exactly ,for example if
the lesson 1 has 30 words and meaning and lesson 2 has 20 meaning
,one way is to predefined 30 sprites froem the cast memeber and use
object oritented programming that make just 20 new object for
lesson 1 (I can do it) but realy what is in mind is that ,is it
possible to make the sprites as needed? for example for lesson 1
make 30 sprites ,the somehow destroy them ,and for lessson 2 make
20 sprites?
thank you very much for your attention sincerely yours
Mohsna -
Can anyone tell me why the %^$& I get a "script cast
member not found"
error?
I've been working in Director for 17 years and I get this
from time to time.
I generally just copy the code from the behavior, paste it
into a new
behavior, name the new one the same as the old on, then copy
the new cast
member over the old one and it solves it. But it happened
rarely enough
that I didn't bother questioning why. I know it's not a
syntax error
because the code runs fine after the above process. But it
does only
happens when I've made a change to the code in that behavior.
Now I'm working with a simple movie with one parent script
and a
prepareMovie handler that instantiates one child object and
I'm getting this
darn error all the time. My above solution isn't working
anymore. The
error points to the first line of a particular handler. That
first line was
a comment. So I got rid of the comment and the new first line
of the
handler is code and the error points to it. If you see where
I'm headding,
no matter how many lines of "errored" code I get rid of the
error alert will
always point to the first line of that handler.
I'm sure many have seen this because it's happened in almost
every version
of Director I've owned. And by the way, I'm in MX on a PC.
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581
www.wordofmouthpros.comDean, I might do that. No, this has been going on long enough
that I sure
it's not any definable user error.
But, I did, after all of these years, discover something last
night. In one
case, I did get a legitimate script error that I fixed. When
I ran the
project again, I received the same script error, even though
it was a simple
fix and I was sure I corrected it. I recompiled several times
and ran it
again and received the error again. Then it dawned on me that
since parent
scripts remain in memory until disposed of, Director must
have been, for
some reason, referring to the old parent script. I had
already set the
object's global variable to 0 in my stopMovie handler and
even though that
handler might not always run when errors occur, I ran it from
the message
window to insure that the object's global was 0. But that
still didn't
solve the problem. Then I used clearGlobals in the message
window and
voila, the issue went away. Dare I say that this is a
shortcoming of
Lingo's design to allow variables to persist/linger after an
error?
But what still baffles me is that most of the time when I get
that
particular error,, even though I seemed to have found a
workaround, it is
not an actual issue with any code.
When it happens again, I'll send you the code. Obviously, if
I'm correct
about the scripts lingering in memory, then you won't receive
the error when
you run the movie.
I just find it interesting that there haven't been a bunch of
"Yeah, I get
that darn thing too" here.
Craig
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581
www.wordofmouthpros.com
"Dean Utian" <[email protected]> wrote in message
news:[email protected]...
> Hi Craig,
>
> Could it be a simple mistake of the script type not
being properly defined
> (movie/parent/behavior)?
>
> If you have a very baic movie where this error occurs
repeatedly, you
> could
> email me ([email protected]) and I'll take a fresh
perspective look at
> it.
>
> regards
> Dean
>
> Director Lecturer / Consultant
>
http://www.fbe.unsw.edu.au/learning/director
>
http://www.multimediacreative.com.au
>
>
>
>
Maybe you are looking for
-
Help! New event text is invisible in subscribed calendar...
A little over a year ago, I set up a private webDAV server here in my office to act as a host for department calendars we could all publish/subscribe to. That has worked with great success, until now. Several people are publishing cals, and the main
-
how would my iPhone4s help a stranger/Police/Medic to know my identiy. The iphone4s is locked and the app for I.C.E. cannot be opened. I am now considered Jane Doe cause I dont have any ID on me.
-
Need Help Resizing in PS Elements 6
I recently worked on a couple of my photos in PS Elements 6, and after I saved them, I found that they had changed size drastically. Both were about 2MB originally, but after working on them one had gone down to a mere 190Kb, while the other had inc
-
GPS Metadata missing in Bridge
I have a problem with seeing GPS metadata in Bridge CS2. I use a Gisteq datalogger to add GPS data to my DNG files and it writes the data to the associated XMP file. I can see it there if I open the XMP in Notepad. If I view the file in Bridge, the
-
How to write data to xml file?
Hi, I have done a project which read data from a web then write in log file. Now i want to write data in xml file. how to write? i read some java and xml tutorial, quite quite difficult. Who can give a simple example with some comments? If you also g