dcsimg
A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: new site == new problems

  1. #1
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319

    new site == new problems

    HI
    finally i have a site uploaded
    http://www.changthai.org
    but i have new problems, (only two, so far)

    1.the preloader only starts at around 45%, before which you can see the background of the first frame of the main content.

    2. the external movies to load in the gallery section
    slideshowInterior.swf, and slideshowFood.swf, do eventually load, but it takes too long !

    any suggestions or pointers are much appreciated
    thanks.

  2. #2
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    1.) is your preloader "IN" the actual external movie you are trying to load? If so..that is your problem. I woudl suggest trying to load your external movies into a "container clip" in your MAIN movie..and have a preloader on that container clip always checking the status of content loaded into it.


    2.) you can try to "preload" this external movies... in say the first frame of yoru main movie.. each of the external movies should have a BLANK first frame (with a stop action)....so they are loaded..and then just "appear or play" when the button is clicked..


    what code are you using? How do you have your site set up? loading into layers or targets?

    How big are the external .swf's you are trying to load?

  3. #3
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    yes i am using containers/empty clips to load the .swfs.

    yes, i had put the preloader for the external .swf at the start of that .swf's timeline. (first mistake)
    so, i will remove it, and then: as you suggest, place the preloader on the holder/container that is set up in the main movie.

    an example of the code that i have used to load the external clip is

    loadMovie ("slideshowFood.swf", "holder_mc");

    your second point, about loading everything at the start of the main movie, i havent tried this. perhaps i should do. what is the script to have everything loaded at the beginning ??

    the size of this particular .swf is 343k, the others smaller

  4. #4
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    1.) your pre-loader being in the external movie is why it takes a little bit to load...and the preloader says 45%..because a certain percent of the .swf has to be loaded for it to play. If you keep a universal/gerneric preloader on the _root time line..checking your container clip... you will A.) only have one preloader then b.) it will keep real time percentage of how much of the content is being loaded.



    2.) with yoru external movies NOT being very big..Im not sure why the lag in load time..possibly server issues? either way....what you can do is use the same loadMovie command (several times) in yoru _root timeline to call all of these..

    HOWEVER if you are going to go this router.. you will HAVE to have a container & preloader for EACH of the external.swf's you want to load... (becuase if you load a .swf into a container that alreayd has a clip in it...it will just replace it...defeating your need of "click on demand".... I do NOT preload much..UNLESS I know it is say an MP3 or a VIDEO clip...and I make sure it is in its own container. With your new way of preloading...it may not be as bad as you think..because you will get a visual of what is going on how much time is left...and interaction with the user..the 300K may just fly by...

    remember in EVERY external movie first frame is BLANK...and first frame has a STOP action in it.

    This is done because once the movie loads..it will start playing if there is enough to show..even though it may not ALL be fully loaded... and the blank frame is there to HIDE it until you are ready for it to be seen (ie: fully loaded).. you just add some code that says is content in container == 100% loaded...goToAndPlay(2);

    your new preloader logic..and a nice little transition effects..and your on your way to making top notch web sites..

  5. #5
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    im still a bit lost here :
    i tried putting the preloader on the holder for the .swf. it seemed to work in my browser, but once its on the server no joy at all.
    i used the same preloader as is on the main time line. is this correct ?
    all day doing this !!

    very frustrating as most of the other things are working, just this time lag on loading this external .swf.

  6. #6
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    i dont know, but perhaps i need to find a way to laod the external .swf into the movie at the beginning and somehow have it hidden until needed, then have a button action call it up ??

  7. #7
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    you can check this out..this is what my code does... http://www.dmstudios.net/demos/index_orange.zip

    Sorry I typed upa big explaination and it didnt go through...

    but basically I have a clip on my main time line called "TRANSITION1" it on a layer ABOVE my conatainer clip that I load all my content into.

    INSIDE this transition1 clip I have several layers.

    I have an INTRO transition tween (say 40 frames)..on frame 41 (or whatever) I have a stop action and a MOVIE clip (own layer) of a 100 frame tween that is just a 100 frame animation progress bar no more than 100 frames. and then 40 frames of an outro animation.

    a button from _root starts transition1 to play..and it stops pn frame 41 where the PRELOADER movie clip is..
    it has THIS code on it:

    Code:
    onClipEvent (enterFrame) {
        tb = math.round(_root.container.getBytesTotal()/1024);  // declaring variable and rounding it to whole number
        lb = math.round(_root.container.getBytesLoaded()/1024); // declaring variable and rounding it to whole number
        
    	if (tb>0 && lb>0) {
            	_parent.percent = math.round((lb/tb)*100);  //"percent" is my text field that shows the percentage of bytes loaded. It is side the same container clip (called transition1) on a layer above the 100 tween prloader clip
            	this.gotoAndPlay(_parent.percent); // this starts the 100 frame tween playhead to match the byte loaded
            	if (lb>=tb) {
                		_parent.gotoAndPlay("out"); // once everything is loaded..play my outro tranistion animation.
            }
        }
    }
    this code check to see if the container clip on the ROOT timeline (under all this transition1 clip) has content being loaded into it..and if so..how much of it. when it reaches 100% it will trigger the transition clip outro animation to play...revealing the NEW loaded content underneath it.

    can you please download that .fla and re-save it for regular MX for me..for some reason I cant open it...says unexpected format..nto sure if I messed with in 2004 when I got it or not.. dont use it now..THANKS

    also..check this out.. everytime you click on a button..and that grey "wall" shoots up..and the progress bar goes..and then it goes back down..thats exactly what you got here.

    http://www.dmstudios.net/demos/test_2/

    thanks for converting for me.. in advanced..
    Last edited by whispers; 01-24-2007 at 01:43 AM.

  8. #8
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    ok
    Attached Files Attached Files

  9. #9
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    i thought i had sent the index_orange file before in the last message, so here it is again, in MX flavour. i think this is what you wanted
    Attached Files Attached Files

  10. #10
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    ok, its the end of the day, im starting to fade out so i have stripped down the .fla into something that can be uploaded here.

    please take a look at it.

    it details the one page of the site that is giving grief.
    you can see that on the buttons ENTER GALLERY, there is this code :

    on(release){
    gotoAndstop(65);
    loadMovie ("slideshowInterior.swf", "holderi_mc");
    }

    excellent. as i already said though, the .swf in question takes over 10 seconds to appear when im checking on the server so ofcourse something has to be put down here to ensure the .swf is ready and waiting for that button to be clicked.

    the original site is
    http://changthai.org
    the page that is giving me all this static is the GALLERY page. click on the ENTER GALLERY and its a long wait.

    thanks
    Attached Files Attached Files

  11. #11
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    here is the same .fla but in MX flavour
    Attached Files Attached Files

  12. #12
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    It all worked fine and loaded for me..the wait times werent anthing special to worry about....

    I didnt even get an email that you replied..that sucked..I wanted to look at that .FLA last night..LOL

    anyways..I tweaked what YOU provided..with the CODE we have been talking about..

    see if this helps some..


    there is ONLY code a few places..

    1.) on the buttons //tells transition clip to start..and what .swf to load (in a variable)

    2.) On a FRAME ACTION in the transition clip

    3.) ON the ACTUAL preloader clip itself.

    Aside from a few stop actions here and there...thats it..

    OH.. in the last frame of the TRANSITION clip...there is a stop action with this code on it:

    Code:
    _root.container.play();
    stop();
    after the clip has been loaded..all bytes loaded == total bytes..it shoudlplay the transition OUTRO animation..and then this code starts the newly loaded external .swf to start playing...

  13. #13
    Senior Member onine's Avatar
    Join Date
    Mar 2005
    Posts
    627
    OT.
    Sorry, I realise that this isn't a site check but I noticed that on your "lunch" page it says: "Light lunches from $5." when maybe it should be "5"? Also I think you need a space between "Ludlow.Shropshire" on the contact page. Nice site though rinser!

    Now I need to go home and take my OCD pills.

  14. #14
    .cotton
    Join Date
    May 2005
    Location
    Puerto Rico
    Posts
    319
    whispers i am on it should be sorted today (dont get why on my computer it is slow but on others it loads fine). thanks for the helps.

    onine : yeah i will change those things (thanks). what are OCD pills and can i score a couple ?

  15. #15
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    rinser- with thedoing things the NEW way..you will eliminate redundant code.. and be able to maximize your output.

    Now you have 1 transition animation,...1 preloader to check for as much or as many .swf (content) you can load into that container "shell"...

    you can make a TON of "containers" through your layout..use the same preloader..and no matter what you load into it..the preloader will work...

    your buttons also set the content you load..making it VERY easy to change...the transition tween will check for the LOAD variable..and what the value..it will load into the content/container clip...

    OCD Obsessive Compulsive Disorder..LOL...

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