A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: _x = _width

  1. #1
    Registered User
    Join Date
    Mar 2001
    Posts
    46

    _x = _width

    hi

    i am trying to load a number of external swf's into a parent movie the tricky bit is I want them to line up on the x axis regardless of width (height is the same on all)

    so if movie 1 is 300px wide i want movie 2 to be placed at _x=300 the movies loaded in will vary in size so if i can get it to read the ._width of the previous movie, i will only have to update the child swf's

    at the moment i have them loading into empty mc's on the stage, but when i set the _x of the clip to the_width of the previous movie it returns 0 (zero)

    is it because the script is called before the external movie is loaded, they are only small. if so how do i get round that?

    thanks
    Last edited by 3quid; 10-13-2004 at 05:42 PM.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You are close. Try this:

    _root.onEnterFrame=function(){
    l=mc.getBytesLoaded();
    t=mc.getBytesTotal();
    if(l>4 && l>=t){
    delete _root.onEnterFrame;
    do whatever you want to do from here
    }
    }
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Registered User
    Join Date
    Mar 2001
    Posts
    46
    cheers cancerinform, I have gone off on a different angle with the problem i had before (i only just logged back in here and saw your post) i have put my .as file online so you can have a look see what i have done

    the script is here

    the site is here

    the only problem (that i am aware of) now is that when the page is loaded and/or refreshed the days load in different orders. it might be that your previous solution would still solve it.

    if so where is that script intended to go? if not whats the solution to get the days to stay in the order they are loaded in the script?

    any help appreciated

    PS btw. the days are supposed to load, newest on the left
    Last edited by 3quid; 10-14-2004 at 02:14 AM.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    That problem cannot be solved with the little script above. I don't see any reason so far why loading of swfs becomes random.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Registered User
    Join Date
    Mar 2001
    Posts
    46
    yeh its weird that this is happening. it works perfectly in the flash test movie (cmd+return) but as soon as it goes into my browser it loses the days correct order. depending on browser it can be one day in the wrong place or all days!

    anybody know why this might be happening?

    thanks

    site
    Last edited by 3quid; 10-14-2004 at 11:16 AM.

  6. #6
    Registered User
    Join Date
    Mar 2001
    Posts
    46
    ok i now realise that if you refresh after the initial load (PC) it puts itself into order! on my mac it just seems to randomly put them on the page, i.e. not in date order.

    i have no idea how to sort this. anyone got any ideas?

    sorry to double post. but i am stumped with this one

    I dont think my initial idea about filesize and loading after actions have been run can be right... this is the output of the trace commands in my script...

    Thu Oct 14 11:42:52 GMT-0500 2004
    14_10_2004
    13_10_2004
    12_10_2004
    11_10_2004
    10_10_2004
    9_10_2004
    8_10_2004
    Thu Oct 14 11:42:52 GMT-0500 2004 =dt1
    Wed Oct 13 11:42:52 GMT-0500 2004 =dt2
    Tue Oct 12 11:42:52 GMT-0500 2004 =dt3
    Mon Oct 11 11:42:52 GMT-0500 2004 =dt4
    Sun Oct 10 11:42:52 GMT-0500 2004 =dt5
    Sat Oct 9 11:42:52 GMT-0500 2004 =dt6
    Fri Oct 8 11:42:52 GMT-0500 2004 =dt7
    14_10_2004 =swfdate1
    13_10_2004 =swfdate2
    12_10_2004 =swfdate3
    11_10_2004 =swfdate4
    10_10_2004 =swfdate5
    9_10_2004 =swfdate6
    8_10_2004 =swfdate7
    Loading into _level0.day7 has started.
    Load completed into: _level0.day7
    Loading into _level0.day6 has started.
    Load completed into: _level0.day6
    Loading into _level0.day5 has started.
    Load completed into: _level0.day5
    Loading into _level0.day4 has started.
    Load completed into: _level0.day4
    Loading into _level0.day3 has started.
    Load completed into: _level0.day3
    Loading into _level0.day2 has started.
    Load completed into: _level0.day2
    Loading into _level0.day1 has started.
    Load completed into: _level0.day1
    0 =initial daywidths
    225 =daywidths
    225 =initial daywidths
    675 =daywidths
    675 =initial daywidths
    900 =daywidths
    900 =initial daywidths
    1125 =daywidths
    1125 =initial daywidths
    1350 =daywidths
    1350 =initial daywidths
    1575 =daywidths
    1575 =initial daywidths
    1800 =daywidths

    --------

    from that it seems the loading of the swf's is taking place in the order that they should do. they just arent being displayed in that order :S
    Last edited by 3quid; 10-14-2004 at 02:44 PM.

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