This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?showtopic=463 as retrieved on 13 Aug 2007 05:36:11 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:uaKIt1fmPa8J:www.flashsandy.org/forum/index.php%3Fshowtopic%3D463+site:www.flashsandy.org/forum&hl=en&ct=clnk&cd=11


Google is neither affiliated with the authors of this page nor responsible for its content.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Using ASE parsers, Can you have two different files loading in one flash document?
acc
post Apr 18 2007, 02:50 PM
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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Petit
post Apr 18 2007, 04:17 PM
Post #2


Advanced Member
***

Group: Moderator
Posts: 588
Joined: 21-June 06
From: Borgholm, Sweden
Member No.: 38



QUOTE(acc @ Apr 18 2007, 02:50 PM) *

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!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
acc
post Apr 18 2007, 07:03 PM
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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Petit
post Apr 18 2007, 10:58 PM
Post #4


Advanced Member
***

Group: Moderator
Posts: 588
Joined: 21-June 06
From: Borgholm, Sweden
Member No.: 38



QUOTE(acc @ Apr 18 2007, 07:03 PM) *

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) !
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
acc
post Apr 19 2007, 01:23 AM
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.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 13th August 2007 - 05:14 AM
phpMyVisites