-
Converting button code...
Hello,
I have made few simple websites with as2 and this is the function I used for the buttons so it goes and shows the animation for each page. Now I want to use the same function on AS3 but is not working. Can someone help me to convert it or just show me how it works on AS3.
Thanks!
This is the code for AS2:
on(release){
_root.play();
_root.choose="46";
}
-
I (Love | Hate) Flash.
----
Save a version back so others may help you!
-
Converting button code...
How is this gona help me to ROLL_OUT the page I am on when i click on different one?
Here is an example what i mean by rolling out effect when i click on different button.
www.7chudesa.tk
-
that second post is confusing - in the first you're asking about on(release) in AS3 - then in the follow up you start talking about ROLL_OUT and show that link that doesn't really show much.
to answer the original question: you can't put script on objects anymore - it has to be in a class or in the frame.
assuming the button's on the main timeline, you'd first have to give it an instance name (i'll use "myButton" for this example). you'd also have to have "choose" defined in the timeline and can't just assign it on the fly like you could in AS2. then you add an event listener, and a function to handle the event:
PHP Code:
var choose:String; function clickHandler(event:Event):void{ play(); choose = "46"; } myButton.addEventListener("click", clickHandler);
-
-
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
|