Yes, I can find nothing in as3 docs about support for that shortcut (_up,_over, 
_down frame labels). The buttonMode=true only affects the cursor - changes it 
from pointer to hand.
afaik, you need to set functions for each event - possible mouse events include:
CLICK
DOUBLE_CLICK
MOUSE_DOWN
MOUSE_MOVE
MOUSE_OUT
MOUSE_OVER
MOUSE_UP
MOUSE_WHEEL
ROLL_OUT
ROLL_OVER

So I think you need to do this:

my_btn.addEventListener(MouseEvent.CLICK, myFunction);
my_btn.buttonMode = true;
function myFunction(event:MouseEvent):void {
         //do something
 }

my_btn.addEventListener(MouseEvent.ROLL_OVER, myOverFunction);
function myOverFunction(event:MouseEvent):void {
         //do something
 }
my_btn.addEventListener(MouseEvent.ROLL_OUT, myOutFunction);
function myOutFunction(event:MouseEvent):void {
         //do something
 }


I'd love to learn otherwise, though. Of course, using the simple button 
component avoids this, maybe you could just skin it to your liking? All of the 
button states are separate editable mc's in the library.
jimbo

*********** REPLY SEPARATOR  ***********

On 6/27/2007 at 6:24 AM Adam Pasztory wrote:

>Thanks Jim,
>
>I've set up the AS3 event handler as you've specified, and it does change
>the cursor from an arrow to a pointer, but the _up, _down and _over states
>don't work.  I pasted the same button symbol into an AS2 FLA file, and it
>does work, so there isn't anything wrong with the way I've set my frame
>labels in the button symbol.
>
>According to the docs, it should work in AS3:
>"If you use the buttonMode property with the MovieClip class (which is a
>subclass of the Sprite class), your button might have some added
>functionality. If you include frames labeled _up, _over, and _down, Flash
>Player provides automatic state changes (functionality similar to that
>provided in previous versions of ActionScript for movie clips used as
>buttons)."
>
>Can anyone else get this working in AS3???
>
>On 6/27/07, Jim Berkey <[EMAIL PROTECTED]> wrote:
>>
>> One way to instantiate a mc as a button in as3 is:
>>
>> my_btn.addEventListener(MouseEvent.CLICK, myFunction);
>> my_btn.buttonMode = true;
>> function myFunction(event:MouseEvent):void {
>>         //do something
>> }
>>
>>
>>
>> jimbo
>> *********** REPLY SEPARATOR  ***********
>>
>> On 6/26/2007 at 9:40 PM Adam Pasztory wrote:
>>
>> >In ActionScript 2, I never used button symbols.  Instead I would create
>> >buttons as MovieClips, give the frames of the buttons labels -- "_up",
>> >"_down", "_over" -- and assign an event handler to them.
>> >
>> >I tried this in AS3, but it didn't seem to work.  Is there some new
>> secret
>> >to MovieClip buttons in Flash 9?
>> >
>> >thanks,
>> >Adam
>> >_______________________________________________
>> >Flashcoders@chattyfig.figleaf.com
>> >To change your subscription options or search the archive:
>> >http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> >
>> >Brought to you by Fig Leaf Software
>> >Premier Authorized Adobe Consulting and Training
>> >http://www.figleaf.com
>> >http://training.figleaf.com
>>
>> s
>>
>> _______________________________________________
>> Flashcoders@chattyfig.figleaf.com
>> To change your subscription options or search the archive:
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>> Brought to you by Fig Leaf Software
>> Premier Authorized Adobe Consulting and Training
>> http://www.figleaf.com
>> http://training.figleaf.com
>>
>_______________________________________________
>Flashcoders@chattyfig.figleaf.com
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com

s

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to