Copy link to clipboard
Copied
Hello!
I'm noob to this program (animate cc)
I'm trying to make a movie clip buttons to my website. I'm using action script 3.0, but I don't understand anything from that code language...
I added this code (below), but It draws rectangle and I want to add the hand cursor to the whole movie clip or layer inside the movie clip.
Any way to do this?
- Aleksi
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0);
mc.graphics.drawRect(0,0,50,50);
mc.graphics.endFill();
mc.buttonMode = true;
addChild(mc);
mc.addEventListener(MouseEvent.CLICK, _click);
function _click(e:MouseEvent):void
{
trace('a');
I found the code that works <3<3<3<3<3<3<3
For actionscript 3.0 it's (btn1 is instance name for my button)
btn1.buttonMode = true;
I found answer from this link:
Copy link to clipboard
Copied
when you test that (after closing _click() ), you should see a 50x50 black square at the upper left of your stage. when you mouseover that square your cursor should change to a hand. when you click the square you should see something in the output panel.
do you see all that?
Copy link to clipboard
Copied
I tested that and I see the black rectangle and the hand appears when I roll over it. The output panel is blank when I press the square?
Copy link to clipboard
Copied
Oh the output panel was blank because I was testing it in browser...
Copy link to clipboard
Copied
I found the code that works <3<3<3<3<3<3<3
For actionscript 3.0 it's (btn1 is instance name for my button)
btn1.buttonMode = true;
I found answer from this link: