Box2D Forums

It is currently Sat May 25, 2013 10:31 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Oct 21, 2012 10:09 am 
Offline

Joined: Sun Oct 14, 2012 1:59 pm
Posts: 8
I have a box2d app working fine under the latest FlashDevelop 4.0.4 RTM

but when I move the code over to Flash Pro CS5.5 (onto a frame in the timeline) I get the error below.

Any suggestions on what could be the problem?

ArgumentError: Error #2004: One of the parameters is invalid.
at flash.display::Graphics/drawRoundRect()
at flash.display::Graphics/drawCircle()
at Box2D.Dynamics::b2DebugDraw/DrawSolidCircle()
at Box2D.Dynamics::b2World/http://www.box2d.org/ns/b2internal::DrawShape()
at Box2D.Dynamics::b2World/DrawDebugData()
at IntroMovie/update()


Top
 Profile  
 
PostPosted: Sun Oct 21, 2012 10:51 am 
Offline

Joined: Sun Oct 14, 2012 1:59 pm
Posts: 8
SOLVED.

Caused by unitialised vars, due to code being placed in wrong position.

When I had moved code from FlashDevelop I placed function calls above some variables that were defined after these calls, like this:

...............................
test();
testWheel();

var m_sprite:Sprite;
var m_world:b2World;
var m_timeStep:Number = 1.0 / 30.0;
var m_physScale:Number = 30;
...............................

So my functions used unitialised numbers containing NaNs which were used to create circle positions, which were themselves NaNs and so the draw code ultimately failed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group