A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Drag loaded movie clip

  1. #1
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273

    Drag loaded movie clip

    I've been working on a download page for my site and someone suggested that I add a feature to it. I've been attempting to figure it out and I've gotten pretty close but don't have it yet. So that brings me to flashkit and it's collective brilliance.

    http://www.WagonNation.com/downloads.htm

    On this page I have some folders and wagonmatrix code in the main movie clip. I also have three empty movie clips each to load the contents of the folders that are on the "desktop." The problem is this, I load the folder in and it can be minimized, maximized and closed. I would like to be able to set them up to drag them around the desktop in each of their states. I can do a startDrag code and it works fine in the test of that to-be-loaded movie but not in the main downloads movie where it has been loaded. Also, I'd like to make a specific area with, I assume a hit test, to drag the window around with to make it more like a real system window. Any suggestions will be muchly, yes muchly, appreciated and looked after warmly.
    I don't have answers.


  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I believ YOUR way is becuase once you load an external.swf into a containerClip you must use that in the path. (or use relative paths, such as this, _parent..etc) if you have hardcoded anything such as:

    _root.mcName.gotoAndPlay(); in yoru external.swf and you load that .swf into a container clip..you must have that instance name in the path as well for it to work.

    like so:
    _root.containerClip.mcName.gotoAndPlay();

    I am not sure how your .fla is setup but its a suggestion.

  3. #3
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Perhaps a look at the .fla in question would be in order.

    http://www.WagonNation.com/squirrel/downloads.zip
    I don't have answers.


  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    what part do you want to be draggable?..and why when I close a window..does it try to load a text file?

  5. #5

  6. #6
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Ah ha, genious. I was on the right track but going the wrong way. Now, is there a way to make it go back to the center when the min and max buttons are pressed? At this point someone could drag it around minimized then maximize it and have to reload the page to get the window back on the screen. I'm gonna poke around with it and see if I can figure something out.

    Much thanks.
    I don't have answers.


  7. #7
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Oh, and as far as it wanting to load a text file, I have no idea why it would be doing that. The only thing I can think of is that I don't know how to action script and I have some syntax or something wrong. Yeah, that's most likely the answer, I have no skills.
    I don't have answers.


  8. #8
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    wel if you had made it ONE clip with all that stuff inside..you caould just set the _x & _y whenever you click a button.

    on (Press) {
    this._x=100;
    this._y=150;
    }

  9. #9
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Can I not do the same thing only refer to _parent? Or do I need to reorganize it and make the code on the buttons refer to _parent. I had it all in one clip to do the dragging effect but then the buttons didn't work right. Thanks for the help and I'll keep plugging away at this thing.
    I don't have answers.


  10. #10
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Or mayhaps I do this,

    on (release) {
    gotoAndPlay(2);
    this._x=85;
    this._y=30;
    }

    That seems to work so far but doesn't get it to the center. Hmm...
    I don't have answers.


  11. #11
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    you can try a combonaion of BOTH of those..but I think yoru PARENT route will refer to the _root timeline..or the CONTAINER clip you load the external.swf into...if that is acceptable..then you can use parent.

  12. #12
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Ah

    on (release) {
    gotoAndPlay(2);
    this._x=0;
    this._y=0;
    }

    This works.

    Still haven't solved the text file thing but it doesn't affect it when it's online so I'm not gonna fuss with that anymore.
    I don't have answers.


  13. #13
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Ok, this may be going to far, but I'm also trying to figure out swapDepths with this. As of now the sound clips window is loaded into an empty movie clip on a higher layer than the other two. They each load into their own separate movie clip. Is there a swapDepths code or similar that will change which window is in front by clicking any portion of that window?
    I don't have answers.


  14. #14
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    yes..you can use swapDepths..but if somethign is on a DIFFERENT LAYER..then it is physically on top.

    [code]
    on(press) {
    this.swapDepths(300);
    }

    I just put 300 to make it a high number... it can be whatever.. put same line on the other "button" that will control the depth of the other window

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