A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] What scripting should I use?

Threaded View

  1. #1
    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 Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center