Jump to content
Search Community

Unloading and reloading a VideoLoader

laurentvd test
Moderator Tag

Recommended Posts

Hi people,

 

First of all, great work on the LoaderMax package. I'm loving it.

I use the XMLLoader to load a LoaderMax compatible XML file which describes all assets I need per section of the application (it's an AIR app).

 

<?xml version="1.0" encoding="iso-8859-1"?>











etc.... now I want to unload a loader when I navigate to the next section. I use

LoaderMax.getLoader('ms1').unload()

Now when I return to that same section, I want to load the assets again using

LoaderMax.getLoader('ms1').load()

Most of the times this works, but sometimes the video is loaded but it doesn't show. After some debugging I found out that in that case the rawContent property is null while the duration and all other vars do have values.

 

Am I doing something wrong? Should I recreate the loaders every time I want to load the files? If so, what would be the best way to do this using the XML?

 

Thanks and again... I'm loving LoaderMax.

Link to comment
Share on other sites

Keep in mind that the rawContent will NOT be set until the VideoLoader dispatches its INIT event. So I wonder if you're just checking rawContent too early (before it is set). You can use addEventListener() to discover when the VideoLoader has dispatched that event.

 

If you still think there's a problem, please post a sample FLA (along with support files) that clearly demonstrates the issue. The simpler the better - no need to post your production files.

Link to comment
Share on other sites

I do still think there's a problem because the video isn't shown while I'm certain the loader.content is attached to the top layer of the stage. Anyway, if I find the time to cook up a simple FLA, I will post it here. Thanks for your reply.

Link to comment
Share on other sites

I'm not yet certain, but it seems that the video is there but it just won't play. AutoPlay is set to false in my XML so I start it manually using playVideo(). The second time I do this, it doesn't work. Will keep you posted.

 

[edit] typo

Link to comment
Share on other sites

Keep in mind that if you unload() the VideoLoader, that does NOT remove the ContentDisplay object from the stage. dispose() does that though. If you unload(), think of it like removing the NetStream from the Video object. The container (ContentDisplay) still stays in place. This is a very good thing because it can be quite helpful.

Link to comment
Share on other sites

After some research and more hair pulling I found out it had to do with pausing a video. Once a video was paused, unloaded and then reloaded, it wouldn't respond to any method (even playVideo()). Anyway, to prove and debug this I will come up with a FLA for you to test. Unfortunately (for you) I'm going on a holiday tomorrow and I don't have the time to fix it in time. Maybe I'll look into it again once I'm back.

 

Thanks for your help thusfar.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...