SOLVED: App works in FlashDevelop not in Flash Pro CS5.5

Discuss issues specific to the Flash/AS3 port of Box2D
miner2049er
Posts: 8
Joined: Sun Oct 14, 2012 1:59 pm

SOLVED: App works in FlashDevelop not in Flash Pro CS5.5

Postby miner2049er » Sun Oct 21, 2012 10:09 am

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()

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

Re: SOLVED: App works in FlashDevelop not in Flash Pro CS5.5

Postby miner2049er » Sun Oct 21, 2012 10:51 am

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.


Return to “Flash”



Who is online

Users browsing this forum: No registered users and 2 guests