|
| acc |
Post
#1
|
|
Newbie Group: Members Posts: 3 Joined: 18-April 07 Member No.: 1,074 |
Hi,
I want to have two different ASE files in my flash document. Unfortunately, only one shows up, always the one that was written second in the actionscript file. Is it because Im doing something wrong, or that it cannot be done. Or is it because the files are too big together. Individually, they both work but one of them is quite big (385K). Thanks |
| Petit |
Post
#2
|
|
Advanced Member Group: Moderator Posts: 588 Joined: 21-June 06 From: Borgholm, Sweden Member No.: 38 |
I want to have two different ASE files in my flash document. Unfortunately, only one shows up, always the one that was written second in the actionscript file. Your problem is most probably, that you try to load and parse the two files simultaneously. You should start the parsing of one ASE file, and wait for the AseParser.onInitEVENT, so that you know it is loaded. Then you can start the parsing of the second file in the event handler. I haven't tested this, but seem to remember this as the solution in an earlier case. Try it, and get back with code it it doesn't work! Good luck! |
| acc |
Post
#3
|
|
Newbie Group: Members Posts: 3 Joined: 18-April 07 Member No.: 1,074 |
Thank
you for the reply, what you say does make sense. Unfortunately, I don't
think I'm doing it right. I'm not very familiar with Sandy yet, so the
coding is a little sketchy for me. This is what I have.
CODE var bg:Group = new Group(); //Creates the model var girl:Object3D = new Object3D(); AseParser.parse( girl, 'girl5.ASE' ); var tgGirl:TransformGroup = new TransformGroup(); var trans:Transform3D = new Transform3D(); trans.translate(0, 0, 0); tgGirl.setTransform( trans ); tgGirl.addChild( Object3D(girl) ); tg1.addChild( tgGirl ); var marker:Object3D = new Object3D(); AseParser.parse( marker, 'markerTest.ASE' ); var skin2:Skin = new MixedSkin(0xEE00EE, 60, 0, 1); marker.setSkin( skin2 ); var tgMarker:TransformGroup = new TransformGroup(); var transM:Transform3D = new Transform3D(); transM.translate(10, 10, 10); tgMarker.setTransform( transM ); tgMarker.addChild( Object3D(marker) ); tg1.addChild( tgMarker ); bg.addChild( tg1 ); return bg; From what you said, I take it I will need something like this somewhere: girl.addEventListener(AseParser.onInitEVENT, ...); or something like this?! Thanks |
| Petit |
Post
#4
|
|
Advanced Member Group: Moderator Posts: 588 Joined: 21-June 06 From: Borgholm, Sweden Member No.: 38 |
From what you said, I take it I will need something like this somewhere: girl.addEventListener(AseParser.onInitEVENT, ...); or something like this?! What you can listen for is the AseParser.onInitEVENT, which is an event fired by the parser, ass soon as the Object3D is initiated. ( You don't listen to the girl (IMG:style_emoticons/default/wink.gif). It's late, but what you do is something along this line. CODE function one(){ AseParser.addEventListener( AseParser.onInitEVENT, this, onObjectInitialized ); //Creates the model var girl:Object3D = new Object3D(); var girl:Object3D = new Object3D(); AseParser.parse( girl, 'girl5.ASE' ); .... } // The event handler is called when the first object is ready // We can now use the parser for the other file function onObjectInitialized(){ var marker:Object3D = new Object3D(); AseParser.parse( marker, 'markerTest.ASE' ); .... } Now this is not at all complete, but serves to show the structure. You will probably have to make the model and the marker global. And you may have to wait for the parser to finish before you dress the objects in skins. The principle is to load and parse one file at a time. Good luck and night (IMG:style_emoticons/default/cool.gif) ! |
| acc |
Post
#5
|
|
Newbie Group: Members Posts: 3 Joined: 18-April 07 Member No.: 1,074 |
Thank
you!! Both files show up, they are simply slow. And since I also move
them both with the mouse and the keyboard it is very slow. But it
works!!!
Thanks again. |
| Lo-Fi Version | Time is now: 13th August 2007 - 05:14 AM |