A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: unload flv

  1. #1

    unload flv

    Hey all,

    I have make a presentation where level 20 is controlling level 10.
    On level 10 are swf's (video embedded) it all works ok.

    I've 12 swf video's with on the end of the time line a unload movie _level10 command + tell target _level20 goto next frame who's loading a new movie in level 10.

    My problem is that some swf-video files are too big.
    So I tried importing flv.

    My question:
    Is there anyway to tell the flv-movie on his last frame to unload and give it some tell target actions?

    All this because the user can control what movies he wants to see and loop them (for example he wants to show just video number 1, 4,7 and 12 and they have to loop)

    Is this possible with flv or some actionscript?

    thanx
    asjbak

  2. #2
    Member
    Join Date
    Mar 2002
    Location
    Dayton, Ohio.
    Posts
    67

    Re: unload flv

    Originally posted by asjbak
    Is there anyway to tell the flv-movie on his last frame to unload and give it some tell target actions?
    FLV instances cannot have actions applied to them. You will have to "Convert to Symbol" each FLV Embedded Video instance to a MovieClip Symbol.

    Each FLV will play back in synchronization with their respective parent MovieClip Symbols. The timeline of each MovieClip Symbol will stretch to accommodate the length of each FLV.

    You can then control playback of each of those MovieClips as you normally would using ActionScript.

    I hope this answers your question.

    Good Luck!

  3. #3

    it works, but another problem

    Thanx,

    I didn't know that flv-files follow exactly the timeline.
    Now it's working, but.................

    when I choose to see a video (placed in a external swf that calls the flv) and i loop it it unloads the swf (where the flv is in) but the second time it doesn't load the flv, third tim it does, fourth tim not and so on.......

    what can i do about it?

  4. #4
    Member
    Join Date
    Mar 2002
    Location
    Dayton, Ohio.
    Posts
    67
    Hmmm.....

    Unfortunately, it sounds like you have a logic error on your part.....

    .....but if I understand you correctly: You say you have an external SWF that calls the FLV?

    Why not just make each FLV its own SWF by embedding them on the MAIN timeline? Then, at runtime, just load each individual SWF (that has an FLV on its MAIN timeline) into a SINGLE, EMPTY MovieClip using:
    Code:
    emptyMovieClip.loadMovie("path/swf_with_FLVonMainTimeline.swf");
    You can then use ActionScript to determine the following:
    Code:
    emptyMovieClip.getBytesLoaded();
    emptyMovieClip.getBytesTotal();
    emptyMovieClip._totalframes();
    emptyMovieClip._currentframe();
    emptyMovieClip.unloadMovie();
    .....and so on. If you approach the problem using the example above, you can use and re-use that same single, empty MovieClip instance to load and unload each particular FLV-embedded SWF at runtime as necessary.

    Does this answer your question adequately?

  5. #5

    nope

    Hi,
    thanks for your replies, but this is exactly what i do:

    Quote:
    Why not just make each FLV its own SWF by embedding them on the MAIN timeline? Then, at runtime, just load each individual SWF (that has an FLV on its MAIN timeline) into a SINGLE, EMPTY MovieClip using:

    the swf has the flv on the timeline using MediaDisplay.

    So it's not loaded into an empty mc but in a mediadisplay.
    I try now to place it in an empty mc and tell you what the result is.

  6. #6
    Sorry,

    I said it a little bit strange: I don't open it in the main timeline, but in level10. Now I try to open it on the timeline in an empty mc and see what happens.


  7. #7

    it's working i guess

    YOHO

    it's working I think, it plays correct loops in te main timeline now (empty mc).
    Thanx for you replies!!!!!!!

    1 last question:
    It seems to be working good without buffering first. It's for a cd-rom presentation. Can I leave it without buffering or is it better to let the movies buffer first?

  8. #8
    Member
    Join Date
    Mar 2002
    Location
    Dayton, Ohio.
    Posts
    67
    Aye carumba! *slaps forehead*

    Perhaps I would have been the wiser to ask you what version of Flash MX you were using to develop your app....

    If you are using the MediaDisplay Component, then you are obviously using Flash MX 2004 Pro.

    In that case, you could have simply placed a SINGLE instance of the MediaDisplay Component on the Main Timeline. Then, you would have selected that MediaDisplay Component and opened the Actions Panel. The actions for that MediaDisplay Component would look something like this:
    Code:
     on (complete) {
    	setMedia("mediaPath/nextFLVfile.flv", "FLV");
    }
    ......and that's it!

    The other way works, but the above method is much easier by far and involves less code.



    In the immortal words of one Homer Simpson...."DOH!"

  9. #9
    Member
    Join Date
    Mar 2002
    Location
    Dayton, Ohio.
    Posts
    67

    Re: it's working i guess

    Originally posted by asjbak
    YOHO

    it's working I think, it plays correct loops in te main timeline now (empty mc).
    Thanx for you replies!!!!!!!

    1 last question:
    It seems to be working good without buffering first. It's for a cd-rom presentation. Can I leave it without buffering or is it better to let the movies buffer first?
    NP....always glad to help.

    You do not have to worry about buffering with FLV's, unless you explicitly instruct the Flash Player to do so using ActionScript code: The Flash Player is intelligent enough to manage the streaming/buffering on its own....as you probably already noticed!

  10. #10
    Member
    Join Date
    Mar 2002
    Location
    Dayton, Ohio.
    Posts
    67
    Originally posted by berry_lthird
    Code:
     on (complete) {
    	setMedia("mediaPath/nextFLVfile.flv", "FLV");
    }
    NOTE: You can also use a VARIABLE in place of the URL argument; i.e.:
    Code:
     nextFLVfile = "mediaPath/flvFileName.flv";
    
     on (complete) {
    	setMedia(nextFLVfile, "FLV");
    }
    Also, to initialize the FIRST movie that should play, you would need to add the following code:
    Code:
     firstFLVfile = "mediaPath/firstFLVFileName.flv";
    
     on (load) {
    	setMedia(firstFLVfile, "FLV");
    }
    ....make sense?

  11. #11

    yes it did

    Yes it did make sense.
    I use the on(complete) command now, it is working perfect.

    thanx 1000x

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