Author Topic: Problem with swf obfuscator and preloader.  (Read 1746 times)

hima

  • Member
  • **
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • My Dev Blog
Problem with swf obfuscator and preloader.
« on: Mon, Oct 19, 2009 »
Hello all,
 I've tried encrypt my game with Moji Encrypter and secureSWF. Their ads pre-loader run fine but after the loading is done, the game won't run and reported the following error.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.adamatomic.flixel.data::FlxFactory()
   at Preloader()

I have no clue as to what or where should I fix this. My guess would be because I already have a preloader.  Also, I have read Mochi Live Update documentation and it mentions this which seems to be why my game doesn't work

Quote
AS3 display list membership

Adobe’s Flash Player treats AS3 SWFs loaded into another AS3 SWF differently than when it’s loaded directly by the browser. In particular, the main object is not added to the display list until after the constructor is called whereas when loaded directly the main object is already attached to the display list. This results in the stage and parent properties being set to ‘null’ (and likely resulting in null object references).

This can usually be worked around by moving any code that needs to interact with the stage being moved to an event listener. Event.ENTER_FRAME, Event.INIT, or Event.ADDED_TO_STAGE events are good candidates for this.

Still, I don't know how to do this or which code of Flixel should I move to those events :(

Anybody experience something like this? Any help would be greatly appreciated. Thanks!  :)
« Last Edit: Mon, Oct 19, 2009 by hima »

hima

  • Member
  • **
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • My Dev Blog
Re: Problem with swf obfuscator and preloader.
« Reply #1 on: Sun, Oct 25, 2009 »
Sorry to bump this but I'd really like to know how to fix this!  :'(

deff

  • Member
  • **
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Problem with swf obfuscator and preloader.
« Reply #2 on: Tue, Oct 27, 2009 »
Sorry to bump this but I'd really like to know how to fix this!  :'(

try to remove this line in your main class
Code: [Select]
[Frame(factoryClass="Preloader")]

Olivia

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Problem with swf obfuscator and preloader.
« Reply #3 on: Thu, Oct 20, 2011 »
I only use DComSoft's SWF Protactor. Works against 100% of everything I have thrown at it