-
How do I convert this code to Actionscript 2.0
Silly newbie question, but what is the proper syntax for this OLD style code in the new and improved 2.0?
on (release) {
tellTarget (this._parent.stars) {
gotoAndPlay(2);
}
}
Thanks
---------------
bytemonster
-
Well..that looks like flash 5 or prevoius. You might try thiscode: this.onRelease = function() {
with (this._parent.stars) {
gotoAndPlay(2);
}
};
or code: this.onRelease = function() {
this._parent.stars.gotoAndPlay(2);
};
not exactly as2 but it is as2 compliant.
-
Do I just attach that to the button? It doesn't seem to work!?!
Can't I do something like:
this.onRelease(this._parent.stars.gotoAndPlay(2));
??
That doesn't seem to work, but is there some syntax like that that will?
Last edited by bytemonster; 08-26-2004 at 07:23 PM.
---------------
bytemonster
-
FK's Giant
Originally posted by bytemonster
Do I just attach that to the button? It doesn't seem to work!?!
Can't I do something like:
this.onRelease(this._parent.stars.gotoAndPlay(2));
??
That doesn't seem to work, but is there some syntax like that that will?
Nope.
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
Senior Member
give the button an instance name and then in the frame that contains the button use,
code:
instanceNameOfButton.onRelease = function() {
this._parent._parent.stars.gotoAndPlay(2);
};
I think you'll need 2 _parent's in the path since using the syntax above "this" will be a reference to the button - not the timeline that contains the button, as it would be using the on (release) syntax.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|