TwelvestoneFlash

Stupid question for Flash CS4


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
Suzy
 
2010-04-21

Ok I've been stuck on Flash MX 2004 for ages and finally got Flash CS4. I only use Flash for animating and doing banners. I've just created a button, put it on the timeline and clicked on Actions. I've got this stupid message saying 'Current selection cannot have actions applied to it' I realise I am probably being very thick but what am I doing wrong?

Storm
 
2010-04-21

AS3 won't let you attach scripts to buttons anymore. RIDIC!!

So you have to write an Event Listener in a class or on the timeline holding the button for the click of the button.

YOURBTN.addEventListener(MouseEvent.CLICK, nameOfFunctionToRun);

function nameOfFunctionToRun(me:MouseEvent):void { // insert your actual code to do here }

It's ridiculously cumbersome for what you do Suzy and I offer you a hug. It really sucks because it's crap written by programmers who have never lived one day in a non-programmers life and Events were written in software that didn't have the communication capabilities that Flash did. So, Flash abandoned it and went with programmery things instead. Good decision with a sprinkle of sarcasm.

There are advantages in working this way but not enough to warrant in a banner or small site.

Hope that helps though. I'd say hit F1 but half the code there fails to compile too (unless that's just CS3).

Suzy
 
2010-04-21

Ahhhh thank you Storm, you are a star! I cheated and just changed it to use AS2 k

Storm
 
2010-04-21

I just realized I forgot the end code tag.

Good call on AS2. I actually keep Flash MX 2004 on my computer anyway. Certain things were way easier.

But if you want to go to AS3, I need to correct my own mistake. I fell into the trap that Adobe and everyone else do and not be PROPER with my code example. I want to clarify in case anyone else reads this thread or if you try AS3.

YOURBTN.addEventListener(MouseEvent.CLICK, nameOfFunctionToRun);

function nameOfFunctionToRun(me:MouseEvent):void { // insert your actual code to do here

 // if your button only exists once and then isn't used again then remove the listener
 YOURBTN.removeEventListener(MouseEvent.CLICK, nameOfFunctionToRun);

}

Good luck on your project. k

Suzy
 
2010-04-21

Thanks k

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

Stupid question for Flash CS4