drmcnellis / collisiondetectionkit

Automatically exported from code.google.com/p/collisiondetectionkit
0 stars 0 forks source link

What if I use the collisionGroup into a Class that is loaded into the main .fla ? #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I have a small game that is composed of :

1. first frame :preloader
2. second frame :  a "var game:Game = new Game();
this.addChild(game);" code.

And a game.as Class which extends Sprite. Inside the Class, I have a
collisionGroup instance that should detect simple interaction.

What is the expected output? What do you see instead?

Once I want to add a sprite to the "collisionGroup", I get the following
error :

"Error: Cannot add item: [object HitMV] - Items added for collision
detection must be on the display list.
    at coreyoneil.collision::CDK/addItem()
    at Game()
    at banner_fla::MainTimeline/frame2()
"

Basically, the "root" for my object is Null, instead of Main_Timeline.

What should I do ?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by office.r...@gmail.com on 15 Mar 2009 at 1:14

GoogleCodeExporter commented 9 years ago
As the error indicates, any items you add for collision detection have to be on 
the 
display list first; meaning you'd have to addChild() to the stage (or to some 
display object already on the stage) before you addItem() to your collision 
group.

Original comment by lessthan...@gmail.com on 16 Mar 2009 at 12:22

GoogleCodeExporter commented 9 years ago
If you'd like assistance integrating the CDK into your project, just let me 
know.  
Closing this issue since it doesn't require a code change.

Original comment by lessthan...@gmail.com on 20 Mar 2009 at 2:33