Monday, March 22, 2010

Calling libarary objects. Referring...

How do I call an object from the library in ActionScript 3.0? Once I do, how do I refer back to the timeline in ActionScript 3.0?

Thank you!

Calling libarary objects. Referring...

u can name the object u need to call from lib and use

addChild Method

like tht

var Snow:Circle= new Circle();
聽聽
聽聽聽 addChild(Snow);

Calling libarary objects. Referring...

So, in this case, the name of the object in the libarary is ''Snow?''

Does this mean that I have to place the object in another object that is a ''Circle?''

I'm still very new to ActionScript. I know how to call a frame in the same timeline. I know how to call a URL. But calling an object in the library is much more complex it seems. Is what you wrote the entire script needed for the action? Also, once I'm in a library object (a movie in this case), what script do I write to go back to the main timeline (Scene 1)?


1st the name is Circle in linkage

try and tell me


Thanks for your help. Here is the situation.

On the main timeline I have one frame containing a movie from the library called ''intro.''

The ''intro'' movie contains all the graphics that play initially. At the end of the timline in the ''intro'' object(movie) I have a stop(); in the script on the actions layer. This goes to one of three frames in the ''intro'' object timeline depending on the selection by the user. Each of those three frames contains another movie, ''reveal1,'' ''reveal2,'' and ''reveal3.''

When the user clicks the screen, it goes to one of those reveal screens (each reveal is its own movie).

Once there, I don't know how to get back to Scene 1. I need to write a timeout for it (which is a separate issue) but I would also just like to add a clickable object that returns me to Scene 1 from one of the movie objects.

Also, I just had the feeling I was going the long way around the scripting and was wondering how to call an object directly from the library. I have a very helpful book here that tells me how to call frames in the same timeline, URLS, and objects that are in a directory outside of Flash but for the life of me I can't figure out how to call an object from the library, which seems so basic!聽

I hope this helps and wasn't too confusing.


send ur fla


open the library right click on the symbol you want to access and select linkage there you give it a class name that will be the name you call it by. when you hit ok you will get the message that the definition for the class could not be found and it will generate one for you - this is a good thing -click ok.

Then you can instantiate it like any other class as in the first example sensiblemind provided.


Here it is. Thanks.

Would I pushing it to ask for some assistance on a timing out feature?

No comments:

Post a Comment