03.12.08
Posted in Embedding, Flash, Flex at 10:19 pm by Curtis J. Morley
Google has finally caught up with the likes of FaceBook, Flickr, Photobucket, MorgueFile, Webshots, Picasa, and Smugmug. I knew it wouldn’t take them long. The new API sounds like the perfect solution for Flash YouTube Mashups. Web based applications like BrainHoney, SlideShare, Sprout and worldtv will be able to integrate the solution fairly effortlessly now and keep the look and feel that they want. I imagine that more online and Flash based video editing applications like Jumpcut, Aviary, and RichFLV will be developed.
An article on InternetNews.com has the following to say:
“The new APIs will enable developers to create "chromeless" Flash players with a customizable interface built on YouTube software, but without the YouTube branding. Instead, YouTube is asking developers to place a "Powered by YouTube" button on the pages of their sites that contain the API-enabled video players.
Developers will be able to upload videos and responses to YouTube from any device, including cell phones and other handhelds. The APIs will also allow developers to augment the video content on their sites with metadata, such as titles, descriptions, ratings and comments.”
Article/press release on the subject.
www.InternetNews.com
To get into the details of the YouTube API
http://google-code-updates.blogspot.com/2008/03/youtube-apis-for-developers-and-for.html
To find out about the features including the chromeless player and get a look at who Geoff Stearns the SwfObject Genius is.
http://youtube.com/watch?v=u1zgFlCw8Aw
This is great news for all of us Flashers in the worlds
Thanks Jasson and Thanks YouTube.
As always - Happy Flashing
Curtis J. Morley
Permalink
02.18.08
Posted in Embedding, Flash, Flex at 7:00 am by Curtis J. Morley
SWFObject.addVariable() in AS3
SWFObject is the standard for embedding Flash files into HTML. If you haven't used it run on over to Geoff Stearns site and download yourself a heapin' helpin' of some SWFObject. If you are feeling especially adventuresome and want to test out the latest features in the new SwfObject 2.0 then head over to the SwfFix development blog. SWFObject eliminates the need to click on the Flash piece on a website before being able to interact with it, it has plug-in detection, it can be used with popular blogging software on sites such as this, and there are plugins for Dreamweaver and as a publish setting right in Flash. You should be using this for every website you build. As of the 15th of February (I wonder what they were doing on Valentines Day) you can even download an SWFObject Adobe Air app for generating the proper code to embed your SwfObject into your website. It employs the new SWFObject 2.0. Or for quick and easy access just use the web version to generate your swfObject code
Now that you are totally sold and will never build anything Flash without it, you may want to inject variables (FlashVars) into your swf. The methods are different for AS2 and AS3. It is quite easy, yet different in each of these versions of ActionScript. You simply throw the following code into the HTML and then ...
<div id="flashcontent">
Swf Audio is not loaded Please check your path. this should be an audio control built in flash.</div>
<script type="text/javascript">
var so = new SWFObject("SoundControlTest2.swf", "audioControl", "240", "24", "8", "#EFECDD");
so.addVariable("audioURL", "AllThatIWant.mp3");
so.addVariable("audioURL2", "Comfort.mp3");
so.addVariable("audioURL3", "Jolene.mp3");
so.addVariable("audioURL4", "Amazing.mp3");
so.write("flashcontent");
</script>
...then in your Document class (or on the MainTimeline if you are not using a Document Class) you will need to reference the parameters property of the loaderInfo property like this:
this.loaderInfo.parameters.audioURL;
In AS2 you only can access the variable directly on the mainTimeline usin gsomething like this:
myTextBox.text = audioURL;
Hope this helps you (and your users) have a better Flash experience on the web.
As always Happy Flashing.
Curtis J. Morley
Permalink