A time ago google released an SWF/API to interact with the youtube player, and be able to embed it into your swf projects, the main problem is that it was for AS2, so when you try to do it on AS3 / Flex, you can run into problems.
I ran into this problem, so doing my research, I found a library written for AS, it uses a clever way to do it, it actually use a javascript bridge to communicate with the player inside your SWF.
It’s internals can be summarized in this way:
swf (external call) -> browser (js) -> swf (via javascript)
There are a lot of tricks that can help our life easier with this problems, but I will like to gave you a list:
- The main tricks in this library are done in javascript, so you have to pay a lot of attention of details like the id of the player in the HTML of the deploy (be sure to copy outside your working copy, because flex overwrites changes on it), check the ****YOUTUBE**** comments in the example.
- You can run into issues with the sandbox, be sure to test it on a webserver.
- Because you are running outside the flex ide, be sure to install flash tracer it will help you a lot
- When you add it to your project, and you can get the creation complete event you are ready to go !
This is the link of the library:
http://code.google.com/p/youtubechromelesswrapper-as3/
A live demo:
http://www.zerokernel.com/demos/flex/youtube/
Deployment files:
http://www.zerokernel.com/demos/flex/youtube/youtube-deploy.zip
Flex source:
http://www.zerokernel.com/demos/flex/youtube/YoutubeTest.zip
Related posts: (auto-generated)
- Flex: Dynamic Background Image on Canvas (redraw version) Today I tried to load an image form an url...
- Flex Myths I found a very nice article about misconceptions of flex,...
- Flex 3 / SVN plugin (subclipse) / change credentials / OS X For a complex reason I couldn’t understand the SVN plugin...
- Skinning flex components sometimes when you are customizing the UI of a flex...
- Ad-sense in Air ? I was on a project this week, and it have...
Related posts brought to you by Yet Another Related Posts Plugin.






