To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 08-19-2007, 05:13 PM   #1
sean83
Junior Member
 
Join Date: Feb 2007
Posts: 6
[F8] What scripting should I use?

I have designed a face model in flash so the user can place sunglasses on, the user can then undo this action and place another pair of sunglasses on.

The only problem is, when a pair of sunglasses are placed on, the user can still place other sunglasess on top of the current pair and they stack up, which looks bad.

Here is the scripting I have used, I have done the scripting for the undo button on a seperate layer to the rest of the actionscript. Basically I am using the coordinates to move the sunglasses back and from the face model and then to its previous postion.

How can I script this so the user can only place one pair of sunglasses on the model at a time?

I have attached a screenshot of the application so you can get a more clear idea.

Undo button scripting:

arnette_mc.onRelease = function(){
arnette_mc._x =81.9;
arnette_mc._y =248.5;
}
oakley_mc.onRelease = function(){
oakley_mc._x =82.3;
oakley_mc._y =253.7;
}
mauirijim_mc.onRelease = function(){
mauirijim_mc._x =79.5;
mauirijim_mc._y =254.2;
}
DG_mc.onRelease = function(){
DG_mc._x =78.5
DG_mc._y =256.1;
}
bb_mc.onRelease = function(){
bb_mc._x =78.8;
bb_mc._y =252.8;
}

Action script for placing sunglasses on the model:

arnette_mc.onRelease = function(){
arnette_mc._x =81.9;
arnette_mc._y =248.5;
}
oakley_mc.onRelease = function(){
oakley_mc._x =82.3;
oakley_mc._y =253.7;
}
mauirijim_mc.onRelease = function(){
mauirijim_mc._x =79.5;
mauirijim_mc._y =254.2;
}
DG_mc.onRelease = function(){
DG_mc._x =78.5
DG_mc._y =256.1;
}
bb_mc.onRelease = function(){
bb_mc._x =78.8;
bb_mc._y =252.8;
}
Attached Images
File Type: jpg screenshot.jpg (124.3 KB, 4 views)
sean83 is offline   Reply With Quote
Old 08-19-2007, 06:03 PM   #2
calmchess
For the love of ~GIMP~
 
calmchess's Avatar
 
Join Date: Sep 2006
Posts: 2,152
if statement that says something like if the sunglasses are at the _x _y (point_coordianties and those _x _y(point) coordiantes are within the model's face area then the other sunglasses cannot be dragged .
__________________
~calmchess~
calmchess is online now   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:57 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.