View Single Post
  #23 (permalink)  
Old 03-07-2008, 07:10 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Relative URLs are not referenced correctly in a Flash movie

If you are going to use relative URLs, then you should use the base attribute in the HTML <OBJECT> and <EMBED> tag to enforce the base location from which the URL loads. This prevents confusion about the location to which relative links are relative.
The base attribute in <OBJECT> and<EMBED> tags

The base attribute specifies the base directory or URL used in resolving all relative path statements in the Flash Player movie. This path can be absolute or relative where the default value is "." or the location of the SWF file.

Note: When you use the Active Content fix provided by Dreamweaver, the base attribute can be added to the generated code by including base and desired path into the arguments passed to AC_FL_RunContent().

The following is a very brief sample of code that uses a specific sample base:

HTML Code:
<script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0', 'width','600','height','500','title','myMovie','src','myMovie','quality','high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','movie','test_CoilGalleryApp','base', 'http://www.example.com/pages/' ); //end AC code</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="500" title="myMovie"><param name="movie" value="myMovie.swf"><param name="quality" value="high"><param name="base" value="http://www.example.com/pages/"><embed base="http://www.example.com/pages/" src="myMovie.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="500"></embed></object></noscript>
Regards,

A.Ramesh

Last edited by aramesh : 03-07-2008 at 07:12 AM.
Reply With Quote