Sunday, March 30, 2008

Embedding audio

To embed audio into your website, you have two options.

First, you can publish your flash audio object and build your webpage based on this code.

An example of this technique is here. As you can see, a simple website was based off of the code acquired from publishing the file via flash. The .fla file is compiled into both .swf and an .html file that embeds the .swf into the page. You can the edit the html page to build the page around the embedded flash file.

The second option, which is preferred if you already have a complex website and are looking to just embed a flash element is to take the entire code from above, and just cut the object, param, and embed sections.






CODE VIEW:



This example shows how the flash file looks when no dimension values are given.





CODE VIEW:
Moral of the story? USE DIMENSION TAGS!!


Here is the same flash file, but scaled at 10 % (w=55, h=40). Notice that the change is to scale.






CODE VIEW:


Here is example using the code that Flash gives you when you select 'publish'. All of the previous codes were simplified.






CODE VIEW:


What they put in their code is a process to check if the viewer has flash installed. If the viewer does not, a query for download is initiated.

No comments: