![]() ![]() I think for now, perhaps try: _parent.gotoAndStop(insert_frame_number_or_label_here) Personally I've been using FlashDevelop for all of my AS3 projects, so I create classes for everything and leave all of that nasty layer and timeline based nonsense behind! But as the timeline is still available in CS3/CS4, I would assume that the _parent and _root commands are still in there and that things can still be done this way! So to access the main timeline from your button instance you'd need to use: _parent.gotoAndStop(insert_frame_number_or_label_here) īut I'm not sure if this way of doing things still applies in AS3.I haven't done any timeline stuff in AS3 yet 'cause I don't own a copy of CS3 or CS4. Well, I know that in traditional timeline based flash programming (in AS1/AS2) you'd use _parent to refer to the parent clip. ![]() So how do you get around it and access the timeline of the parent clip? If your buttons are derived from MovieClip, it could be because your button clip doesn't have thirty-something frames! Which is most likely why you're getting the error you mentioned! A Sprite is basically a MovieClip without a timeline, so there is no need for things like stop(), play(), gotoAndStop() or gotoAndPlay(). If this is the case, then you should be informed that gotoAndStop is not a property of the Sprite class. ![]() I know if it was me, I'd derive from Sprite, so I'm assuming you've done the same. Now, you've said that you're using your own custom button class. In other words, your gotoAndStop() calls are trying to make your buttons gotoAndStop at the specified frame rather than making the parent movieclip stop at the specified frame in the timeline. So the handler has the objects scope rather than global scope. If memory serves correctly, when you use addEventListener to attach an event handler function to an instance of an object of any class, I think the code in the handler function refers to the attached object. Believe it or not, I think it's your gotoAndStop() calls in your click handlers that are causing the error. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |