dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Position MC?

  1. #1
    serial loser Progenitor's Avatar
    Join Date
    Oct 2000
    Location
    Ireland...for now!
    Posts
    406

    Position MC?

    How do you position a movie clip in your main movie when using the following script: loadMovieNum("image.jpg", 1); so flash MX reads it from an external file.

    It always defaults to the top right hand corner of my main movie. Do i need to script the positioning in the MC: Image001 & if so what is that script - haven't got a clue where to go from here. Also is there a way while working on my fla I can see when moving my mouse how the co-ordinates change?
    A conclusion is simply the place where you got tired of thinking.
    If at first you DO succeed, try not to look astonished!

  2. #2
    Denim Demon
    Join Date
    Jun 2002
    Location
    Outside of society
    Posts
    514
    There are scripts you can write to position the loaded movie or file...
    but rather than doing that, why not use loadmovie instead of loadMovieNum and load the file into a place holder movie clip.
    You can create an empty movie clip, position it anywhere you like, give it an instance name on the stage and then load the external file into that clip.
    You can then control it by calling it by the container clip's instance name.

    During authoring I don't know if there's a way to track the exact mouse position. You can easily track it once you export your movie but I don't think that's what you meant.
    But the properties panel will always tell you where an object is so you can use that as a guide.
    Davy Paycheck- Kicking more ass than your daddy on a 3 bottle night.

  3. #3
    serial loser Progenitor's Avatar
    Join Date
    Oct 2000
    Location
    Ireland...for now!
    Posts
    406
    that's pretty much what i have done - besides the loadmovienum part - i have changed it to loadmovie, but what do you mean by:

    You can then control it by calling it by the container clip's instance name? I have it named and all but how do you control that name?
    A conclusion is simply the place where you got tired of thinking.
    If at first you DO succeed, try not to look astonished!

  4. #4
    Denim Demon
    Join Date
    Jun 2002
    Location
    Outside of society
    Posts
    514
    Let's say your container movie clip has an instance name of "holder".
    A script to target it and its contents might look like this:
    myButton.onPress=function(){
    _root.holder._x+=10;
    }
    Davy Paycheck- Kicking more ass than your daddy on a 3 bottle night.

  5. #5
    serial loser Progenitor's Avatar
    Join Date
    Oct 2000
    Location
    Ireland...for now!
    Posts
    406
    Does this need to be onclipEvent? Could you do me ahuge favour & take a look at my fla?
    Attached Files Attached Files
    A conclusion is simply the place where you got tired of thinking.
    If at first you DO succeed, try not to look astonished!

  6. #6
    Flaxcreatures flaxdyzam's Avatar
    Join Date
    Jun 2003
    Location
    Belgium - Limburg - Hasselt
    Posts
    147
    setProperty("_level1", _x, <not set yet>);
    setProperty("_level1", _y, <not set yet>);


    Could this work out?

    don't know, just an idea


    Kind regards
    Pieter van Stee
    alias Flax
    Mail me @ pietervanstee@skynet.be
    Add me at MSN

  7. #7
    serial loser Progenitor's Avatar
    Join Date
    Oct 2000
    Location
    Ireland...for now!
    Posts
    406
    NOTHING!!!!!!!!!!! I mean nothing seems to work for this!!!???I'm so confused & frustrated!!!!
    A conclusion is simply the place where you got tired of thinking.
    If at first you DO succeed, try not to look astonished!

  8. #8
    serial loser Progenitor's Avatar
    Join Date
    Oct 2000
    Location
    Ireland...for now!
    Posts
    406

    Maybe Pellepiano???

    I think i have tried everything - i tried putting a movie clip which reads the external file into an invisible button, then move the button. I have also tried putting an invisble button in side the movie clip, then move the MC...but all that happens in both cases is that the MC defaults top left & the button moves. This is very strange to me. PLEASE CAN SOMEBODY HELP? Maybe Pellepiano???
    Attached Files Attached Files
    A conclusion is simply the place where you got tired of thinking.
    If at first you DO succeed, try not to look astonished!

  9. #9
    Denim Demon
    Join Date
    Jun 2002
    Location
    Outside of society
    Posts
    514
    Ok. If I understand you correctly, you want your loaded, external file to appear in your main movie at a point that is NOT the upper left corner. Right?
    Ok. For starters you could simply make a flash file that is the SAME SIZE stage as the movie it's being loaded into.
    In your movie that is being loaded, place your graphics exactly where you'd like them to appear once they are loaded. And that's it. It will load in that same position when it comes into the level 0 movie.
    You would use loadMovieNum for that.

    The second option is to make a target movie clip as I mentioned yesterday.
    Make an empty movie clip. Give it an instance name. Place it anywhere on the stage. Use loadMovie to load your external file into the empty movie clip.
    Keep in mind that your entire external file loads into the movie clip. So if your empty clip is on the stage at x=10 and y=10, then the external file's upper left corner will load into that clip at 10, 10.

    Do a few experiments with this and it will become clear.
    Imagine you have a piece of artwork and you are laying a clear piece of plastic with other graphics on it on top. That's sort of what's happening here.
    Davy Paycheck- Kicking more ass than your daddy on a 3 bottle night.

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