ThemeForest

Help loading a swf into a swf

842 posts
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
+2 more
marcfolio says

I have a file “parent.swf” and I’m loading a sub swf “player.swf” into it. The “player.swf” runs correctly on it’s own, but when I load it into the parent I get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

I’m pretty sure it has to do with referencing the stag in the sub file, But I’ve gone through all the code and made sure that any references to the stage aren’t called until the file is 100% loaded, but I still get the error.

Any help would be AMAZING !

842 posts
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
+2 more
marcfolio says

Ok, I think I’ve narrowed it down to some flashvars:

var fv:Object=LoaderInfo(this.root.loaderInfo).parameters;

Anyone think of a way around this?

4711 posts
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Elite Author
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • India
+4 more
VF says

Not tested but how about this:

var fv:Object = Object(this.root).loaderInfo.parameters;

1666 posts
  • Elite Author
  • Sold between 50 000 and 100 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
+1 more
Tean says

If you have ADDED _TO_STAGE event in your sub swf and make a call for flashvars after this event happens.

842 posts
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
+2 more
marcfolio says
DING !

If you have ADDED _TO_STAGE event in your sub swf and make a call for flashvars after this event happens.

You were right. basically I had to encapsulate all the code and wait for it to be added to stage then fire the code.

I think I’m going to like this though.

by
by
by
by
by