[SWFObject] loading swf from external domain

1,384 views
Skip to first unread message

Geografiek

unread,
Oct 3, 2012, 4:04:38 AM10/3/12
to swfo...@googlegroups.com
Hi list,
Is it possible to have all my files on one server and the html file that strings all together on another server?
this works:
swfobject.embedSWF("iVenJ.swf", "altId", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
but this doesn't:
swfobject.embedSWF("http://www.geografiek.nl/anderen/minjusIvEnJ/iVenJ.swf", "altId", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
although the swf is in place on the external server.
TIA
Willem van den Goorbergh


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Geografiek is a Dutch, Utrecht-based map and chart design company.
Willem van den Goorbergh can be contacted by telephone: (+31)30-2719512 or cell phone: (+31)6-26372378
visiting address: Hooghiemstraplein 89 3514 AX UTRECHT
Visit our website at: www.geografiek.nl
twitter: @wvdgoorbergh
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=




Aran Rhee

unread,
Oct 3, 2012, 11:22:43 AM10/3/12
to swfo...@googlegroups.com
Yes. What you have is totally valid (and normal)

The only complication is if want to control the swf file from your page through javascript (call functions on the Flash file to do something like swap a video or change something etc), or if you want the swf to navigate your page somewhere (change url etc). In this case you need to add a parameter for "allowscriptaccess" (see more here  - http://helpx.adobe.com/flash/kb/control-access-scripts-host-web.html)

The other consideration is if you need to load data into the swf (load xml or json data etc). This requires you to put in extra security code to allow communication with certain domains ( see more here - http://kb2.adobe.com/cps/142/tn_14213.html)


Cheers,
Aran





--



Geografiek

unread,
Oct 5, 2012, 5:12:41 AM10/5/12
to swfo...@googlegroups.com
Thanks Aran,
My swf loads a lot of xml data on start.
The xml files are in the same folder as the swf. (same domain: which excludes any security issues, right?)
It appeared the my problem originated from using relative instead of absolute paths.
'Relative' seems to be 'relative to the html document'.
Changing all these paths to absolute paths solved the problem.
Thanks again
Willem van den Goorbergh
--
 
 

Aran Rhee

unread,
Oct 5, 2012, 10:36:14 AM10/5/12
to swfo...@googlegroups.com
Hi Willem.

@same domain - right - If all files come from the same server, then no need for security sandbox definitions etc.

@paths - Yes, loading is relative to the html file, unless you define the BASE param for your swf ( http://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html ). This path can be "." (current workding dir), or somthing more concrete like "http://www.example.com/pages/"

I'd run something like Firebug etc to observe where the page/swf is trying to load the assets from if you want to persue the relative path option.

Cheers,
A



--
 
 

Reply all
Reply to author
Forward
0 new messages