-
Access of undefined property
Just got CS3 today and love many of the new features, however I’m having some issues with MC's that I was using as Buttons in AS2.
Here is the code I’m using for the buttons is AS2
Code:
ratesBtn.onRollOver = function() {
ratesBtn.gotoAndStop("over");
_root.ratesBtnHolder.gotoAndPlay("in");
}
ratesBtn.onRollOut = function() {
ratesBtn.gotoAndStop("off");
_root.ratesBtnHolder.gotoAndPlay("out");
}
When I export the movie now, I get this error and all the movies that contain motion tween within them just start looping, however each of them have stop(); tags within them
1120: Access of undefined property _root.
with the source as
_root.ratesBtnHolder.gotoAndPlay("in");
any iders????
-
half as fun, double the price
You have to change your settings to publish to ActionScript 2, not ActionScript 3.
-
I figured that out quickly…Is AS3 a completely different language?
-
half as fun, double the price
Originally Posted by rstar
I figured that out quickly…Is AS3 a completely different language?
Pretty much. A lot of it is similar, but chances are code you write in AS2 is not going to work in AS3. Here's an example that will work in both, though:
ActionScript 3 even uses a new virtual machine to run ActionScript 3, so unlike AS2, which can communicate between AS2 and AS1 movies, AS3 cannot (unless you use localConnection as a workaround)
-
Your As3 code for this would look like:
function rollOverFunction(evt:MouseEvent) {
trace("Rolled Over!");
}
myButton.addEventListener(MouseEvent.ROLL_OVER, rollOverFunction);
Go here to learn more about EventListeners
http://www.communitymx.com/content/a....cfm?cid=76FDB
http://as3.betaruce.com/tut/tut_3/tut_3.html
Learn Actionscript 3:
http://flashas3.flashscript.biz/AS3_...roduction.html
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
|