Hello!
I tried to make WCK work with Flash Builder but I got stuck:
I built a standard wck simple few boxes on stage project and is working just fine in Flash.
After that I cleared the scene and exported the library as swc and imported that swc to Flash Builder. After that, I wrote a simple class, myWorld.as and extend it to wck.WCK and in it I have:
var swcWorld:MyWorldMc = new MyWorldMc();
addChild(swcWorld);
and it compiles just fine from FB. (MyWorldMc is the linkage for my World component in CS5 with base class wck.World)
Now, my question is: how do I apply a simple impulse on any of the boxes? I don't seem to be able to reference any of the objects in my wck.WCK...
Thank you very much ! :)
GF
My workflow with Flash Builder has been to edit a source file in Flash IDE, then compile and set up a Flash Professional project in Flash Builder. With that and the correct swc being linked, I will usually see error messages that I would in the Flash IDE when I go to compile. Compiling, the way I do it, still requires a source Flash file to be specified. I don't mind this since creating and setting up through the Flash IDE is one of the main ways that WCK shines anyways.
So in summary, I use Flash Builder as a code editor for WCK and level design/set up is done in the Flash IDE. I don't particularly love using the IDE at all, but for this game framework, I don't think I'd be able to use it for anything useful without it.
Sorry, I don't feel like I've answered your question at all. What are you doing in the game that applies impulses to your boxes? If you have logic that controls a "player" and that's the base class of something in the IDE that is in the level you're loading, you should be able to apply impulses during a ContactEvent.
yeah, I hear you :)
the thing is that I just got the world running fine from the swc, but I can't address any bodies inside this world. This was the actual issue, applying a simpel impulse was just a handy example...
so, I got the world running in flash, exported the swc, got it working when compiling with Flash Builder but I don't know how to actually address a body. In my flash ide setup, I would just have a class linked to my boxMc movieclip, that movieclip linked to shapes.Box and inside that class a MouseEvent.CLICK listener that would fire a trace when the body was clicked (just a simple example).
But in this setup, with flash builder I cannot (or I am just to n00b) address any bodies from the swc world.
Was my explanation clear? Sorry, but english is not my primary language :)
Thank you a lot for your time :)
Yea, past the first level of depth in an object that you instantiate from a SWC, you're not going to have inherent knowledge of what you've got deeper down.
Your english is exceptional and I wouldn't have guessed that it wasn't your first language since your conversational writing seems very fluid.
So you have objects that have classes that are giving life to the objects, but you can't call one out explicitly. I would look into maybe having the objects you want to communicate with excplicitly register themselves with a model of some sort. In the game I just finished, I did this with my trigger objects and my main character. I never called it out by its instance name. I just had the Avatar object register with the model. When I needed to do something with the character, I would use the stored reference.
I put those registration functions in the create() override of my Avatar class. That called to the world, which had a reference to the game's model and registered it there.
Thank you again for your replies!
So, for me to avoid in getting caught with endless explanations :) here is a simple question:
Have anybody developed any kind of model workflow regarding the Flash Builder use of WCK? Or somebody can sugest me how should I go from here?
My initial thought was this:
1. in flash, have a BoxMc movie clip.
2. write a Box.Mc.as class and extend that class to shapes.Box
3. link from library the BoxMc movie clip to BoxMc.as class.
Here is the "I really don't get it" part:
1, 2, 3 -> compiled from flash works like a charm.
1, 2, 3 -> compiled from Flash Builder, well everything works EXCEPT for the BoxMc symbol who does not seem to have any physics applied to it.
Please :) any advice?
Thank you!