i have a program made in flash who runs well, the actions on the .fla file are empty, it has a class who makes all the the work:

This is the content of the class:
package {
import flash.events.Event;
import org.papervision3d.objects.parsers.DAE;
[SWF(width=640, height=480, backgroundColor=0xCCCCCC, frameRate=30)]
public class Earth extends PV3DARApp {
private var _earth:DAE;
public function Earth() {
addEventListener(Event.INIT, _onInit);
init('Data/camera_para.dat', 'Data/flarlogo.pat');
}
private function _onInit(e:Event):void {
_earth = new DAE();
_earth.load('model/minecraft.DAE');
//_earth.addEventListener(Event.OPEN,imageLoaded);
_earth.scale = 1.5;
_earth.rotationX = 90;
_markerNode.addChild(_earth);
//addEventListener(Event.ENTER_FRAME, _update);
}
private function imageLoaded(e:Event):void { trace("HOLA"); }
private function _update(e:Event):void {
_earth.rotationZ -= 1
}
}
}
I want to pass all the script from the class to the acctions on the main timeline, i mean, i dont want to use the class, but i have no idea how to do this, eliminating the “private” string in all the functions and eliminating some other logical thinks like “package {” and others is not enough.
So please, how can i code the same program using only the actions tab from flash? Thanks!
I have to agree with the idea that using timeline code is a bad idea.
Now, going to your code, it’s hard to know for sure without knowing what the parent class does.
I’m assuming that your are using the FLARToolKit example code. I would do as @Adam Harte shows you in his answer, plus modify the PV3DARApp class so that you accommodate things a bit.
Since the whole idea is a bad one in my book, I won’t bother to make things in a proper way, just suggest quick changes.
In PV3DARApp, make _markerNode public:
In PV3DARApp and ARAppBase, change the method init from protected to public:
Then, it should go something like this: