Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help
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.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 28th, 2009, 10:21 AM
thevibe thevibe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 25 thevibe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

karate.rotationY -= xDist * 0.001;
karate.rotationX += yDist * 0.0005;


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

Reply With Quote
  #2  
Old July 28th, 2009, 12:03 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,582 Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 6 h 58 m 12 sec
Reputation Power: 3136
Facebook MySpace
Hi, you could trace rotationX to find out what the cut off values you want are and then use those in an if/else statement i.e.
Code:
if(karate.rotationY - (xDist * 0.001) > 90) { ... }

I'm not saying 90 is the actual figure, that's what you'd have to trace to find out.

If your 3d scene is none mouse interactive then you can the top most display object in its heirarchy to:

this.mouseChildren = fale;
this.mouseEnabled = false;


Which means they will no longer receive mouse events which in turn means your buttons below them will no longer be blocked.
__________________
Quis custodiet ipsos custodes?

Reply With Quote
  #3  
Old July 28th, 2009, 09:24 PM
thevibe thevibe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 25 thevibe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 12 sec
Reputation Power: 0
Red face

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

if((karate.rotationY - (xDist * 0.001) >-10)&&(karate.rotationY - (xDist * 0.001) <10))

karate.rotationY -= xDist * 0.001;

else

karate.rotationY -= xDist * 0.000;

if((karate.rotationX - (yDist * -0.001) >-5)&&(karate.rotationX - (yDist * -0.001) <5))

karate.rotationX -= yDist * -0.001;

else

karate.rotationY -= yDist * 0.000;
}

Reply With Quote
  #4  
Old July 29th, 2009, 03:36 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,582 Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)Tann San User rank is General 32nd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 6 h 58 m 12 sec
Reputation Power: 3136
Facebook MySpace
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash CS4 - Moving 3d menu following mouse needs limits + clickable buttons behind a movieclip


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap