ActionScript errors when Swf embedded into HTML
Hey I am using swf object to embed a swf into a html page. When I compile the swf there are no errors yet when I embed it into a web page i keep getting thrown either one of these two errors the first time the page loads in Safari and Chrome
TypeError: Error #1009: Cannot access a property or method of a null object reference at tracks/loadFlashvars() at tracks/init() at tracks
SecurityError: Error #2000: No active security context.
In firefox I get thrown开发者_StackOverflow社区 the same errors everytime the page loads. My swf loads other swfs and and they have XML loaders I thought maybe it could be something to do with the base swf not being fully loaded before the code is run so I have been playing around with setTimeout(); to try and make a work around but I am unsure if this is correct or if my embed code is wrong, which you can see below.
There is a live version here http://music-shed.org/tracks/
Any hints or tips would be greatly appreciated.
Can't really tell what you're trying to do because you haven't shown any AS3 code. However, if you're trying to load files from a remote location you'll need to load a cross domain policy that's held at their end.
Security.allowDomain("*");
Security.allowInsecureDomain("*");
Security.loadPolicyFile("http://somedomain.com/crossdomain.xml");
This might help you out.
EDIT:
Maybe try a new embed code:
<object width="300" height="200">
<param name="wmode" value="transparent" />
<embed wmode="transparent" src="/resource/flash/tracks.swf" width="300" height="200"></embed>
</object>
精彩评论