Hi mikie,
how many frames do you have in main timeline ?
Where that code is ? Frame one ?
I've got loading bar on my movie clip and when load completes I need movie to continue playing
here is my source:
it gives me an error:Code:var mc = new MovieClip(); root.addChild(mc); mc.addEventListener(Event.ENTER_FRAME,Loadiing) function Loadiing(event:Event) { this.pre_txt.text = int(stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal * 100) + "%" if (this.pre_txt.text == "100%") { mc.parent.removeChild(mc); root.play(); } }
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ***_fla::MainTimeline/Loadiing()
how can I fix it?
Hi mikie,
how many frames do you have in main timeline ?
Where that code is ? Frame one ?
I think you should keep your main timeline with 1 frame only.
Put your animations inside e MovieClip and manage it instead of manage the maintimeline.
With that way you'll have less problems.
thanks for answers, I've found a solution, Here is code example
And everything works perfectlyCode:stop(); root.addEventListener(Event.ENTER_FRAME,Loadiing) function Loadiing(event:Event) { this.pre_txt.text = int(stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal * 100) + "%" if (this.pre_txt.text == "100%") { removeEventListener(Event.ENTER_FRAME, Loadiing); gotoAndPlay(frameNo); } }![]()
Bookmarks