Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-05-2008, 04:04 PM   #1
albe
Registered User
 
Join Date: Dec 2008
Posts: 1
Default help with simple dressup

Hi,

I am making a simple dressup game but I guess due to the large amount of movieclips (something like 60 movieclips including the accessories) its gotten buggy. Things don't stop dragging and 'stick' to the mouse sometimes.

Also I would like to make it so that the clothing you click on becomes on top of all other clothing. But unfortunately when I tried to add some code for making it the top depth it seemed even more buggy and didn't always work.

Here is the code I'm using. I'd be very grateful for any help.

Code:
///// Main Frame


         for(var i=1; i<=51 ;i++){
        // get reference to each piece of clothing
        var clothing = this["clothes"+i];
        
        // scale down clothes to thumbnails
           var scale = 40;
        clothing._xscale = scale;
        clothing._yscale= scale;
            
        }

_global.myRoot = this;
        
        
stop();
Code:
//////// On Each Movieclip

onClipEvent (load)
{

    // Make a note of original position
    _global.clothes50xPos = this._x;
    _global.clothes50yPos = this._y;

}


on(press){
    
    // Start dragging and scale up to full size
    this.startDrag();
    this._xscale=100;
    this._yscale=100;
}

on(release){

    // stop dragging
    this.stopDrag();
    

    // if the clothing is not over the character area
    if(_global.myRoot._xmouse >=280){

        // scale back down to thumbnail size
        this._xscale=50;
        this._yscale=50;

        // put back to original position
        this._x = _global.clothes50xPos;
        this._y = _global.clothes50yPos;
    }
    

}
Thanks for any help.
albe is offline   Reply With Quote
Old 12-10-2008, 01:22 PM   #2
pradvan
Senior Member
 
Join Date: Sep 2005
Location: NYC
Posts: 250
Default

For making things go on top try swapDepths.

Syntax
mySprite.swapDepths( depth )
mySprite.swapDepths( target )

Examples
this.swapDepths(_root.getNextHighestDepth())
this.swapDepths(myContainerClip.getNextHighestDept h())
__________________
FreeActionScript.com- AS2 & AS3 Game Tutorials, Samples, Source Files & Downloads
pradvan is offline   Reply With Quote
Reply


Thread Tools
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
simple portfolio site blankenship Site Check 1 06-01-2005 04:01 PM
[AS2] A simple engine for a game Elias_Maluco Gaming and Game Development 3 05-17-2005 03:40 PM
Making a simple simple loading screen. kame_san0 ActionScript 2.0 3 03-07-2005 12:04 PM
Action Script Help Needed! - Simple, fun, RPG Shopping Cart... N!KtheAL!EN ActionScript 1.0 (and below) 5 01-28-2005 08:13 AM
Simple. Very simple but I need help! Chucky Other Flash General Questions 2 01-11-2003 12:37 PM


All times are GMT. The time now is 05:42 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.