Flash CS4 - Moving 3d menu following mouse needs limits + clickable buttons behind a movieclip
Discuss Moving 3d menu following mouse needs limits + clickable buttons behind a movieclip in the Flash Help forum on Dev Shed. Moving 3d menu following mouse needs limits + clickable buttons behind a movieclip Flash Help forum discussing all products originally created by Macromedia including DreamWeaver, Contribute, Flash, Fireworks, Freehand, Director, Authorware and HomeSite. Adobe bought Macromedia in 2005.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 25
Time spent in forums: 3 h 26 m 12 sec
Reputation Power: 0
Flash CS4 - Moving 3d menu following mouse needs limits + clickable buttons behind a movieclip
Hi guys,
Here're my 2 problems:
1-I did a menu moving in 3d following my mouse movement. But i would like it to have a limit of rotation on the left and on the right, cause i don't the user to see the back of the image (the image is rotating 360°right now, i would like it to rotate maybe like 90° or less). Here's the code i am using:
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
var xDist:Number = mouseX - stage.stageWidth * 0.5
var yDist:Number = mouseY - stage.stageHeight * 0.5
2-My second question is about my menu buttons. I want them to be on lower layer cause it help creating my 3d scene cause sometimes it is a part cover by my image on the top. But the buttons stop to be clickable when they are behind something (even a part behind). I want them to be clickable at all time. The strange thing is i checked out in the forum and a lot of people have the opposite problem... their buttons still work. How can i make mine clickable ?
I would really appreciate your help guys
Thanks
Thevibe
Posts: 25
Time spent in forums: 3 h 26 m 12 sec
Reputation Power: 0
Thanks Tann San,
2-the buttons are include with the image called karate (in the animation below) so i don't think it will work... any other ideas ??
1-Your code did the trick for the rotation limit. But the rotation stop is a bit hard. Do you know a script that i could put after the ''else", that would make play the rotation back to the start or at least restart the moving rotation on X or Y , but still in my boundaries, just to keep it like it is always moving. But as soon as someone would reenter my boundaries it should follow the mouse again... Any ideas ?
Thanks a lot
Here's the new code:
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
var xDist:Number = mouseX - stage.stageWidth * 0.5
var yDist:Number = mouseY - stage.stageHeight * 0.5
Posts: 6,582
Time spent in forums: 1 Month 1 Week 3 Days 6 h 58 m 12 sec
Reputation Power: 3136
Hi, you shouldn't need the else clauses with what you have as multiplying by 0.000 is the same as multiplying by 0 which is always 0 which means you are doing rotationX -= 0 which does nothing essentially.
You can't play it backwards since it's linked directly to the mouse position.