- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
I think they use a Timer for about a second to allow you to gain reference to the player. Maybe this is the problem? Not sure.
I would try the following:
Set the “onStateChange” listener to have a weak reference.
Then don’t remove the event listener in your kill function.
Then in your onStateChange function, add an if statement like this:
if(player == null) {
Object(event.target).destroy();
}
Edit: Also, Is the loader still in the display list? Maybe you need to remove the loader form the stage?
- Author was Featured
- Bought between 10 and 49 items
- Contributed a Blog Post
- Exclusive Author
- Germany
- Has been a member for 3-4 years
- Item was Featured
- Referred between 100 and 199 users
I solved it in a different way. I create a isReady variable, which will be set to true when the video starts playing or when the video is cued. Then I dispatch an own ready event and the corresponding listener with the handler toggles the mouseEnabled property for the skip buttons.
But one generic question…...when I use weak reference, I dont need to remove the event listeners???
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
if component has a destroy method, it should just terminate itself when told to.
but this is not always the case with the yt player coz is buggy.
such issues can only be fixed upstream.
- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
But one generic question…...when I use weak reference, I dont need to remove the event listeners???
Technically no. If all other references have been destroyed and the only thing left is a weak referenced event listener, the object will be freed from memory.
But BF is right, the yt player is buggy and there’s not much that can be done 
- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
Been doing some profiling tonight. YouTube chromeless doesn’t clean up — period. I think this is the Google Flash office:
http://www.youtube.com/watch?v=3efW4AziWCg
FP10 and unloadAndStop seems like the only solution.
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
FP10 and unloadAndStop seems like the only solution.have you tested it ? coz unloadAndStop seems to fail with complex items.
won’t work with mines if removing clean up code.
- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
^ no I just assumed that would be the solution. What a bummer
Maybe we should see if Google is hiring 
- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
Did lots of testing on the chromeless player this morning. unloadandStop() doesn’t do jack.
For the test, I created a swf and loaded a youtube-based swf into it. Here are the results (after running the Garbage Collector)
http://www.blazethefire.com/youtubefailure/
You’ll see at the bottom that the document class of the you-tube based swf doesn’t get freed from memory. I imagine this is equivalent to loading a module in a template and never having the module being freed from memory when you change the page.
Here’s the document class of the parent swf:
Here’s the document class for the youtube swf:
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Interviewed on the Envato Notes blog
- Referred between 200 and 499 users
I guess I’ll just use this thread for a youtube related question.
Im still confused on the official word regarding youtube material like movie trailers being used in activeden files. If the trailer is from an official source on youtube like the channel of sony pictures (http://www.youtube.com/user/SonyPictures) its ok to use?
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
I guess I’ll just use this thread for a youtube related question. Im still confused on the official word regarding youtube material like movie trailers being used in activeden files. If the trailer is from an official source on youtube like the channel of sony pictures (http://www.youtube.com/user/SonyPictures) its ok to use?you can only if absolutely sure you’re allowed by copyright holder.
which basicly means that if SonyPictures think you are not, you will be held responsable for copyright infringement.
