This content has been marked as final.
Show 9 replies
-
1. Buttons in ActionScript 3 ?!?!?!
Juankpro Aug 14, 2007 8:53 PM (in response to Ricky_Lopes)ActionScript 3.0 was designed for advanced Object-Oriented programmers. Even though this approach is a lot more powerful, it requires a lot of knowledge and re-learning. Like for example that every on() event is not only deprecated in this version but completely removed. So, as the same documentation says. If your project is not a giant monster, there is no need to learn this programming approach, which will take you a considerable time. You can still export as Flash Player 9 to use its improvements but select ActionScript 2.0 as the ActionScript version on the publish settings panel.
Take into account that the object structure in ActionScript 3.0 was completely redesigned. So every proccess, from a sinple event to movie clip creation has changed radically. -
2. Re: Buttons in ActionScript 3 ?!?!?!
SymTsb Aug 15, 2007 12:10 PM (in response to Ricky_Lopes)give your button an instance name as you would have in AS2.
In AS3 every bit of AS2 is tied to the Actions panel or it is done with external AS files and packages.
With that said....
buttonName.addEventListener( MouseEvent.CLICK, handleClick );
function handleClick( e:MouseEvent ):void {
// Do whatever needs to be done with your sound object
}
It's a little different from an external class file but overall this is the general practice. -
3. Re: Buttons in ActionScript 3 ?!?!?!
Ricky_Lopes Aug 15, 2007 2:45 PM (in response to SymTsb)hi juankpro and SymTsb!
thanx for the replies ;-)
I'm redesigning my site and i want to learn a bit more of actionscript, thats why i want to do it in actionscript 3.
must i insert this code in every actions layer were i need to use the button?
buttonName.addEventListener( MouseEvent.CLICK, handleClick );
function handleClick( e:MouseEvent ):void {
// Do whatever needs to be done with your sound object
} -
4. Re: Buttons in ActionScript 3 ?!?!?!
SymTsb Aug 15, 2007 2:51 PM (in response to Ricky_Lopes)No. That's the beauty of AS3. You define the button handler for the button and it exists in the AVM (Actionscript Virtual Machine) as long as the display object it references exists. -
5. Re: Buttons in ActionScript 3 ?!?!?!
Ricky_Lopes Aug 15, 2007 3:32 PM (in response to SymTsb)humm...cool :-D
i used stopAllSounds(); for my stop button, but it seems that stopAllSounds has been deprecated :-S
is there a simpler command to do the same thing? -
6. Re: Buttons in ActionScript 3 ?!?!?!
SymTsb Aug 15, 2007 5:36 PM (in response to Ricky_Lopes)Read the Sound Class page in AS3 help. The sound class now only provides a means for starting a sound. You must add a SoundChannel object to your sound class to actually stop it. I'm not sure what the sense was in this but it is none-the-less how it is handled now in AS3 -
7. Re: Buttons in ActionScript 3 ?!?!?!
CarrieBey Sep 19, 2007 7:15 PM (in response to SymTsb)I have a similar problem. I need to create a CD with a menu and several 1-2 min video clips (with audio that needs to stay in sync). I also need a "return to menu" button under each video. When I use ActionScript 2.0 and attempt to test with .FLV files I get this error:
WARNING: The component 'fl.video.FLVPlayback' requires ActionScript 3.0.
When I use ActionScript 3.0 and attempt to test I get this error:
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
Any suggestions?
Thanks,
Carrie -
8. Re: Buttons in ActionScript 3 ?!?!?!
SymTsb Sep 19, 2007 10:17 PM (in response to Ricky_Lopes)Make sure that your FLA is a Flash (Actionscript 2) document. Also make sure you are calling on the proper package for an AS2 document. From the looks of the errors, your FLA is an AS3 document but I can't be positive without looking at the actual FLA -
9. Re: Buttons in ActionScript 3 ?!?!?!
CarrieBey Sep 20, 2007 1:07 PM (in response to SymTsb)Sorry, I'm not sure that I understand your response. One of the error message occurred when I saved as an AS2 project and one was when I saved as an AS3 project. Also, I'm not sure what you mean when you say "calling on the right package"
Thanks,
Carrie