ActiveDen

Help loading a swf into a swf

836 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
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 !

1 year ago
836 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
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?

1 year ago
2998 posts
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • India
  • Referred between 200 and 499 users
VF says

Not tested but how about this:

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

1 year ago
1301 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Croatia
  • Referred between 1 and 9 users
Tean says

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

1 year ago
836 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
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.

1 year ago
by
by
by
by
by