A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: !!! conrol position of a loaded movieclip (loadmovie)

  1. #1
    Member
    Join Date
    Jun 2001
    Posts
    40
    Hi @ all:

    My Problem: I have a MC with height/width 600/600 and a second one with 400/400 wich will be loaded by the first one with the option "loadmovie"

    BUT

    How can I control the position of the loaded file? In my case, the file will be loaded at (0,0) - How can I define e special position like (x,y) or (middle,center) or somethingelse???

    I would be happy if u could help me.....


    ciao

    TUHH

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    705
    include this in the file being loaded:
    this._x=100
    this._y=100
    this should repostiion the loaded movie . If it doesn't work right away, substitute "this." with the level like so:
    _level1._x=100
    _level1._y=100
    hope this helps frank
    http://www.geckoarts.com

  3. #3
    Member
    Join Date
    Jun 2001
    Posts
    40
    Thx i use _x without this or _level - that works!!! but i would like to set the position when i use loadmovie.

    No Possibillity??

  4. #4
    Owner of the ™ thread tublu's Avatar
    Join Date
    Nov 2000
    Posts
    2,430
    an easier way to control the position of the loaded movie is ceating the Loaded Movie with the same dimensions as the Parent movie ... and creating the objects in the exact position as youy want them in the Parent movie
    however the action scripting technique works fine also

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    705
    the easiest is as tublu mentioned, but if you want to do it with load movie. Then you will need to create a movie or script which checks to see when the loaded movie is fully loaded. Then you can use
    target._x=100
    Otherwise flash will attempt to set the position before the movie is actualy there.

  6. #6
    Owner of the ™ thread tublu's Avatar
    Join Date
    Nov 2000
    Posts
    2,430
    Yeah ..thanks fpanko ....
    I always think that knowiing difficult methods and coding is okay .. but if ther's a easier way .. why not go for it ? However if there can be some problems with that , one should of course keep a lookout for better paths

  7. #7
    Member
    Join Date
    Jun 2001
    Posts
    40
    THX you both! :-)

    Normaly I do change width/height at first.... but now i want to load an old small movie into an new bigger movie - and i dont know how i could copy ALL MCs and actions from the old one into a nwe one! i allways only can select a part - specially in cases of motiontweenings.....

    im really looking for a possibility to control the position from another level and WHEN it will be loaded! I think i have no chance!! :-(

    Greetingx

    TUHH

  8. #8
    Senior Member
    Join Date
    Jun 2000
    Posts
    705
    Its a tuff thing to get at first but you can definitly do it. You can control when it starts loading by using the loadMovieNum(); action. Three are a couple ways to find out when it is loaded. An old one used in flash4 alot was to included a variable in the movie being loaded which looks like this:
    _level0.loaded=true;
    Then in back in the main timeline, you will need a movie which loops until it recieves this value. It could be a 3 frame movie clip with actions like below.
    Frame1:
    if(_level0.loaded=true){
    _level1._x=100;
    _level1._y=100;
    goToAndStop(3);
    }
    Frame2:
    goToAndPlay(1);
    Frame3:
    Stop;

    This is alot more complex than just including:
    this._x=100
    this._y=100
    in the first frame of the loaded movie but willn also work.

    Flash5 also includes functions to check the bytes loaded for movies being loaded. You can use that to find out when the movie is loaded then call a function to change its position. I've never had to resort to that, but it would be what youneed to use if you absolutely can't edit the old swf you want to load.
    All in all, don't give up o what your trying to do. There are a couple ways to acomplish everything in flash. You just need to find what works for you.
    Hope this helps, frank

  9. #9
    Member
    Join Date
    Jun 2001
    Posts
    40
    thanks that u try to solve my problem! i think i will work with the this-method! :-)

    That was not my intention but you have to do comromises....you said you can do everything in flash... --> thats right - but i hope that in flash 6 there are a few new options wich many people are still missing and wich helps us to write our programs and animations with more effiziece...
    Otherwise -> FLASH RUUUUUUUUUUUUEZ... :-)

    Another Time: Thanks for all peaople like u - who helped me since i began with flash! :-)))))))


    Greetings from the Flash-fevering
    TUHH


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