A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: preload the movie before play

Hybrid View

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    31

    preload the movie before play

    hey Guy

    i have a problem about load the movie before play.

    movie A
    1st layer 1st frame is (stop)
    2nd layer 1st frame is a button with on release/ play frame 2/ loadMovie("B.swf"),"root.content"
    3th layer 2st frame to 10th frame is doing a sliding cover action
    4th layer 2nd frame is content movie clip for load "B.swf"

    the problem is when i clicked the layer 2 button, then finished the layer 3th action. But "B.swf" is wait 2 or 3 sec then come out. i haven't done any preload script in B.swf

    so anyone can solve the waiting the sec problem, can add some scripts in the 1st layer frame to call the movie already down. thank

  2. #2
    Senior Member Dricciotti's Avatar
    Join Date
    Aug 2002
    Posts
    2,988
    You need to add a preloader. Search the tutorials section for "preloader" and you will find some full examples.

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    31
    but i donno which 1 is suit for my work. example add post at A movie with get in B movie

  4. #4
    I am not an expert
    Join Date
    Aug 2005
    Posts
    175
    no u need to add a preloader in ur movie A itself use syntax such as "getBytesTotal() "
    and "getBytesLoaded()" and check when these 2 are equal it will do whatever u like to do after movie B.swf load.

    e.g.

    if (_root.content.getBytesLoaded()>=_root.content.get BytesTotal()) {
    gotoAndPlay(frame Number or frame name);
    }

  5. #5
    Member
    Join Date
    Oct 2005
    Posts
    31
    to: psb

    thank so much, but NOT success, still waiting a sec to view B movie. follow your script, i put in

    movie A
    current scene, action layer, 1st frame is ''your script with go to play frame 2"
    current scene, action layer, 2nd frame is "stop"

    current scene, click button layer, 2nd frame with
    on release
    loadMovie("B.swf","root.content")
    go to and play frame 3 ---------------current scene, not the B movie inside

    current scene, content layer, 1st frame is "content movie"

    :-(

  6. #6
    I am not an expert
    Join Date
    Aug 2005
    Posts
    175
    hi,

    I am attaching a file which does the same thing u r looking for. Its tricky but will solve ur problem hopefully.
    Attached Files Attached Files

  7. #7
    Member
    Join Date
    Oct 2005
    Posts
    31
    sorry PSB, cant not open.

    I tried put "LoadMovie("B.swf","root_content") at frame 1 in Movie A, that no problem for waiting a sec....

    But the action of B.swf was ready done!!!!!

    B.swf have a sliding buttons, after clicked, the user just see the still buttons... so can u teach me do some action in Movie A a button to call B.swf start to run to play frame 2 stuff, frame 1 is set "stop".

    actually i want the B swf moving by click the button in A movie !

    :-|

  8. #8
    I am not an expert
    Join Date
    Aug 2005
    Posts
    175
    hi

    sorry that file was made in flash mx 2004 but now i had saved it with flash mx version and made few changes which u had asked for
    Attached Files Attached Files

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