Hi Friends
I am presently developing a site completely class based. N
I am facing a problem .
There were so many addchild (to attach them to stage at runtime) clips in the library.
I dont want them to be exported over the first frame so in the LINKAGE PROPERTIES i am unchecking the export in the first frame option and I am using a base class for them which again exteds Display.MovieClip class [it must be].
Further In the Publish Settings under ACTION SCRIPT 3.0 settings I have changed the export class in frame to 2 so the Frame 1 of teh movie will be free from classes and Objects so a simple preloader can be put which will display start from the 0 or may little bit of 5 percent till 100.
If if activate The export in the first frame then the Frame 1 will become 50% of the movie and my preloader will start from 50 i.e. after completely loading the Frame 1.
But the problem is I have Unchecked and freed the Frame 1 size but the MovieClip objects are not getting added at the run time. But I am sure that the class Which I have created is attaching but not the internal objects.
I have created a main.fla and in it's library i have a symbol which was exported for action script.
my movie has two frame 1 & 2,
Code in Frame 1
Code:
stop();
this.addEventListener(Event.ENTER_FRAME, per);
function per(ev:Event):void {
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal) {
this.removeEventListener(Event.ENTER_FRAME, per);
this.gotoAndPlay(2);
}
}
Code in Frame 2
Code:
trace("hellow world frame >> " + this.currentFrame);
var mcc:mcClip= new mcClip();
this.addChild(mcc);
stop();
Next I have created the BaseClass mcClip.
Code:
package {
import flash.display.MovieClip;
public class mcClip extends MovieClip {
public function mcClip() {
trace(this);
}
}
}
Class name mc
base class mcClip. // this class will extend the Display.movieClip class so no problem at all. [this i have doe because the same class can be used for multiple objects in the library.]
Unchecked Export in frist frame
while runnign teh move the class is adding but teh graphic shape which i have drawn in the library movielicp is not attaching to the stage.
I am not getting what happening here.
the library movie clip is not attaching but its base class is attaching and it is tracing the class.
I hope you got the problem what I have.
Please any body who read it dont ignore it
Thanks in Advance.
I will be great full to you