Results 1 to 3 of 3

Thread: Needing help with movieclips

  1. #1
    Join Date
    Oct 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Needing help with movieclips

    Using actionscript 2.0 in flash
    Is their a way to be able to drag and drop one after another on top of each other(MC). I am wanting my script to have the user build an avatar. If their is another way please let me know I really could use some help.

    stop();
    var iconDepth:Number = 0;
    var down:Boolean = false;
    _root.onMouseDown =function(){
    if (_root.canvas_mc.hitTest(_root._xmouse,_root._ymouse)){
    var x:Number = _root._xmouse;
    var y:Number = _root._ymouse;
    _root.holder_mc.moveTo(x,y);
    down = true;
    }
    };
    _root.onMouseUp = function(){
    down = false;
    };
    var currentColor:String = "F7E7D9";
    _root.createEmptyMovieClip("holder_mc",100);
    function draw() {
    _root.holder_mc.lineStyle(0, parseInt(currentColor, 16), 100);
    var x:Number = _root._xmouse;
    var y:Number = _root._ymouse;
    _root.holder_mc.lineTo(x, y);
    }
    _root.onMouseMove = function() {
    updateAfterEvent();
    if (down && _root.canvas_mc.hitTest(_root._xmouse, _root._ymouse)) {
    draw();
    }
    };
    window1_mc.gotoAndStop("color");
    window2_mc.gotoAndStop("admin");
    var topClip:MovieClip = window1_mc;
    function swap(clip:MovieClip){
    clip.swapDepths(topClip);
    topClip = clip;
    };

    function buildIconList(){
    var spacing:Number = 123;
    var iconY:Number = 365;
    var iconX:Number = 67;
    for (var i = 0; i < _root.icon_mc._totalframes; ++i) {
    var newName:String = "icon_mc" + i;
    var clip:MovieClip = _root.icon_mc.duplicateMovieClip(newName, 10000 + i);
    clip.gotoAndStop(i + 1);
    clip._x = iconX + i * spacing;
    clip._y = iconY;
    clip.homeX = clip._x;
    clip.homeY = clip._y;
    clip.icon_btn.onPress = function(){
    if (this._droptarget != "canvas_mc") {
    startDrag(this._parent);
    }
    };
    clip.icon_btn.onRelease = function(){
    stopDrag();
    _root.iconReleased(this._parent);
    if(this._droptarget == "canvas_mc"){
    setProperty(this,_x,60.1);
    setProperty(this,_y,93.9);
    } else {
    setProperty(this,_x,50.5);
    setProperty(this,_y,85.4);
    };
    }


    }
    on(release) {
    stopDrag();
    if (this._droptarget == "canvas_mc"){
    setProperty(this,_x);
    setProperty(this,_y);
    } else {
    setProperty(this,_x);
    setProperty(this,_y);
    }
    }on(press) {
    if (this._droptarget != "canvas_mc"){
    startDrag(this);
    }
    }

    buildIconList();
    function iconReleased(icon:MovieClip){
    if(_root.canvas_mc.hitTest(_root._xmouse, _root._ymouse)){
    ++iconDepth;
    var newName:String = "object" + iconDepth + "_mc";
    var clip:MovieClip = icon.duplicateMovieClip(newName,iconDepth);
    clip.gotoAndStop(icon._currentFrame);
    clip.icon_btn.enabled = false;
    clip._xscale = 250;
    clip._yscale = 250;
    }
    icon._x = icon.homeX;
    icon._y = icon.homeY;
    }

    function clearContent() {
    _root.holder_mc.clear();
    for (var i = 0; i <= iconDepth; ++i) {
    var name:String = "object" + i + "_mc";
    _root[name].removeMovieClip();
    }
    iconDepth = 0;
    }
    next_mc.onRelease = function(){
    gotoAndStop("head");

    }

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Perhaps this.

  3. #3
    Join Date
    Oct 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for the help.

Bookmarks

Posting Permissions

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