A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: help - Duplicate movie issue

  1. #1
    Member
    Join Date
    Nov 2003
    Posts
    67

    levels.

    when i duplicate a movie (as seen in the test file attached) the duplicated MC always shows ontop of the "Stamper". ANyone know how to fix this? It should show underneath the stamp.
    Attached Files Attached Files
    Last edited by projectbios; 08-25-2004 at 12:19 PM.

  2. #2
    Member
    Join Date
    Nov 2003
    Posts
    67
    I changed my question. to the above.

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    A little hint.
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    Nov 2003
    Posts
    67
    great, thanks ill have a look at that.

    one other question, so i don't need to make a new thread.
    I did that little tut on making a simple drawing app, but my one question is how to i make the lines fade away after 10 seconds?
    I have another app where the line is actually a tween and it goes about 100 frames before the alpha hits "0".. but id much rather do it so it's all action script.

    Code:
    createEmptyMovieClip("myClip",1);
    myClip.lineStyle(3,0x7474FE,100);
    onMouseDown = function () {
    myClip.moveTo(_xmouse, _ymouse);
    onMouseMove = function () { myClip.lineTo(_xmouse, _ymouse);};
    };
    onMouseUp=function(){
    onMouseMove=null;
    }

  5. #5
    Member
    Join Date
    Nov 2003
    Posts
    67
    Originally posted by sergwiz
    A little hint.
    why is it that if i copy the script for the triangle over to the flower stamper i cannot get it to duplicate? The flower drags but it doesnt drop it anywhere?
    IF i remove the triangle layer the flwer works fine.

    Where is the conflict? I cant find it?

  6. #6
    Member
    Join Date
    Nov 2003
    Posts
    67
    anyone?

  7. #7
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    1.about line's fade away. Try this code:
    code:
    MovieClip.prototype.fade = function(){
    this.onEnterFrame = function(){
    this._alpha--;
    if(this._alpha<=0){
    this.removeMovieClip();
    }
    }
    }
    this.onMouseDown = function(){
    pressed = true;
    this.createEmptyMovieClip("line",0);
    line.lineStyle(3,0x7474FE,100);
    line.moveTo(_xmouse, _ymouse);
    this.onMouseMove = function () { if(pressed){line.lineTo(_xmouse, _ymouse);}};
    };
    this.onMouseUp = function(){
    pressed = false;
    line.fade();
    }


    2. Try this another little hint
    Attached Files Attached Files

  8. #8
    Member
    Join Date
    Nov 2003
    Posts
    67
    THe line does fade, only problem is that it restarts after i click again. THe idea beinhd this is disappearing ink.

  9. #9
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    OK, then try this code:
    code:
    MovieClip.prototype.fade = function(){
    this.onEnterFrame = function(){
    this._alpha--;
    if(this._alpha<=0){
    this.removeMovieClip();
    }
    }
    }
    this.onMouseDown = function(){
    i++;
    pressed = true;
    this.createEmptyMovieClip("line"+i,i);
    _root["line"+i].lineStyle(3,0x7474FE,100);
    _root["line"+i].moveTo(_xmouse, _ymouse);
    this.onMouseMove = function () { if(pressed){ _root["line"+i].lineTo(_xmouse, _ymouse);}};
    };
    this.onMouseUp = function(){
    pressed = false;
    _root["line"+i].fade();
    }


  10. #10
    Member
    Join Date
    Nov 2003
    Posts
    67
    I tried that new code and it doesnt function any differently thgen the other one.


    hmm. odd.

  11. #11
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    It means that you publish it for player 7. If you'll change Publish Settings for player 6, then everything will be OK. If you publish it for player 7, you should add just one line at the beginning:
    i=0;

  12. #12
    Member
    Join Date
    Nov 2003
    Posts
    67
    OOooo it worked!!!

    One last question.

    I have a pen that i use as the mouse pointer. But the drawings always show up ontop of the pen. the pen shoudl be on the upper layer.

    Any ideas?

    the code for the pen is

    Code:
    Mouse.hide();
    startDrag("pointer", true);
    Last edited by projectbios; 08-26-2004 at 04:08 PM.

  13. #13
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    code:
    pointer.swapDepths(99999)


  14. #14
    Member
    Join Date
    Nov 2003
    Posts
    67
    One last issue.

    When i click on a button I should be brought to a new frame, without having the pen tool and drawing happening when i click my mouse. I can't seem to unload the click when i leave that frame. Does it perminantly load it into the file?

  15. #15
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Here you go
    Attached Files Attached Files

  16. #16
    Member
    Join Date
    Nov 2003
    Posts
    67
    thats interesting. so it wont work unless it goes to the next scene?

  17. #17
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    It does not matter, you can use either Scenes or frames. It'll work all the same.

  18. #18
    Member
    Join Date
    Nov 2003
    Posts
    67
    on that pen sketch fla, how do i make it start fading out later on, say ten seconds after i draw?

  19. #19
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    code:
    ……………
    MovieClip.prototype.fade = function(){
    this.onEnterFrame = function(){
    if(getTimer()-this.t>=10000){
    this._alpha--;
    if(this._alpha<=0){
    this.removeMovieClip();
    }
    }
    }
    }
    ……………………………
    this.onMouseDown = function(){
    if(func==true){
    i++;
    pressed = true;
    Mouse.hide();
    this.attachMovie("pen","pen",99999);
    this.createEmptyMovieClip("line"+i,i);
    _root["line"+i].lineStyle(3,0x7474FE,100);
    _root["line"+i].moveTo(_xmouse, _ymouse);
    _root["line"+i].t = getTimer();
    this.onMouseMove = function () { pen._x = _xmouse;pen._y=_ymouse;if(pressed){ _root["line"+i].lineTo(_xmouse, _ymouse);}};
    }
    };
    ……………………………



    I can assume that you don't know ActionScript, but it's hard to believe that you don't know such words as "please" and "thank you".

  20. #20
    Member
    Join Date
    Nov 2003
    Posts
    67
    I'm very sorry for my rudeness.

    You've been infinatly helpful.

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