TwelvestoneFlash

AS3 mouseX event


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 ...
rogue_designer
 
2011-05-24

Hey guys - this is driving me nuts.

I have a movie clip that needs to have buttons overlayed after a mouseover event... because of the buttons on top, I cannot use mouse out to reset the MC. I was thinking I could use a greater than statement on mouseX, but I'm not finding what I need.

I was hoping I could just run: stop();

movieClip_1.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_4);

function fl_MouseOverHandler_4(event:MouseEvent):void { gotoAndPlay(2); }

if (mouseX<=30) { gotoAndStop(1); }

But I feel like I need a listener, or other function in there. Any thoughts?

DontBogartMe
 
2011-05-24

the things that overlay the button, are also buttons you say? You want the user to be able to click/interact with them too?

I was going to say mouseEnabled = false on the overlay, but if you need them to be clickable then that won't work.

But if you're going to hide the overlay buttons when the user rolls off the initial button, they can't really click on the overlay buttons anyway? Perhaps I'm not getting what you mean.

Maybe post two screenshots of each frame so we can see what you're trying to do?

In case you don't really need the overlay to be clickable (and since I made it before I reread your post) here's an FLA that has an overlay that doesn't get in the way:http://www.sendspace.com/file/p2vj9u

FRAME 1 stop();

btnMyButton.addEventListener(MouseEvent.ROLL_OVER, handlerBtnRollOver);

function handlerBtnRollOver(e:MouseEvent):void { gotoAndStop(2); }

btnMyButton.addEventListener(MouseEvent.ROLL_OUT, handlerBtnRollOut);

function handlerBtnRollOut(e:MouseEvent):void { gotoAndStop(1); }

FRAME 2 myOverlay.mouseEnabled = false;

DontBogartMe
 
2011-05-24

does this work the way you wanted it?

Button overlay

The FLA

rogue_designer
 
2011-05-24

Yes, I think that kind of structure looks like it would work.

I'll have to dig around and see if I can understand how you made that work. This is WAY not my forte.

Thanks for the help!

JLM
 
2011-05-24

He used some code to go to the second frame of the circle ( on rollover ), on the second frame he has 3 timeline buttons, I feel I am forgetting the beauty of timeline simplicity.

rogue_designer
 
2011-05-25

For whatever reason, that method wasn't working for me... I'll need to revisit.

But I did manage to use all this back and forth to accomplish what I needed another way. So, thank you!

In my customary fashion... it's not elegant, but it works, and still is a pretty light piece to load in. k

DontBogartMe
 
2011-05-25

so what did you do?

rogue_designer
 
2011-05-25

created normal rollover buttons for the subs, and instead of making the parent a button class, I used mouseX for both in and out states, with a custom shaped sensor item at alpha 0 that had a cut out for the sub buttons.

I think because I was mixing multiple scenes, the other method wasn't working... I kept getting an error that it couldn't find my second scene, if I had the listeners within the type of structure you made...

It's entirely possible that I was screwing something up tho. This works, and the sensor item fixes 99.9% of the wonkiness I was getting with mouseX when I had it tied to the primary item.

(stage didn't work, because I couldn't disable it once it moved to the new part of the movie, so it kept reverting to the beginning)

Once this goes live, I'll send you a file, so you can laugh at my half-assed work arounds. k

DontBogartMe
 
2011-05-25

scenes? Scenes are the devil's work. k

Incidentally my parent container wasn't a button either, I used buttons just for the 3 actual buttons to get a quick rollover effect so you could see the possibility.

But hey, who cares? You got it working, that's all that really counts.

JLM
 
2011-05-25

If you want to use scenes use swishmax, if you don't need as3 then it maybe more accessible than flash for codin'. But Scenes in flash are worth avoiding (broken), if anyone tells you different they either don't know any code or they know how to hack round and have long forgotten the pain.

scudsucker
 
2011-05-27

There are still scenes in flash?

I stopped using them after an abortion of a site back in Flash 5

JLM
 
2011-05-27

I told swish to drop them from thier package or fix them, so swish ones actually work, although not played with it for a few years, I expect with as3 flash ones are even less usable than they were in flash 5, now they have messed up the timeline code integration.

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

AS3 mouseX event