+1
Answered

Embed sitepal into flash error#1009

renata 12 years ago updated 12 years ago 3
I get this error when i follow the directions (sitepal, publish) to embed in flash AS3
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ModelBuilder/timerHandler()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

Please help me to sort this out, the overall actionscript from sitepal is (embed_code not included);

Security.allowDomain("content.oddcast.com");
var ldr:Loader;
var req:URLRequest;

var vh_player:MovieClip;
var _example_ui:MovieClip;

req = new URLRequest("EMBED_CODE");
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
ldr.load(req);
addChild(ldr);

function completeHandler($ev:Event):void
{
trace("EXAMPLE --- COMPLETE HANDLER "+$ev.target);
vh_player = MovieClip(ldr.content);
}
Hello Renata,
Flash is unable to load the object. Make sure same name in all Key frames.Please try this code:

this.addEventListener(Event.ENTER_FRAME,checkLoaded)
function checkLoaded(e:Event){
if(mc){
//Do stuff with mc
this.removeEventListener(Event.ENTER_FRAME, checkLoaded)
}
}

Regards,
Sumit
Renata -

A few additional points -

It is not immediately clear from the information you provided what if anything you may be doing wrong. My suggestions -

1. We offer a working example here -
http://www.oddcast.com/support/as3/VH...
You can download the FLA source code for this example by clicking the download button at top right - and compare with your own code to spot the differences.

2. Try loading a regular swf (like an animation or something simple) in order to find out if that error is related to our code or yours.

Let me know how goes,
Gil
SitePal Team
Dear all, thank you for your replies. The code was okay, when I changed the publish settings to flash 9 it worked (It was on flash 11.2 before). Thank you for your effort.