Flash site using box2d

be_design wrote:
Hi!

I have been looking for a good rope sim for a while now! I need it for a project that I'm working on. This one is GREAT! I think it might be what i need to make it happen.

Someone wanted a working version... the above code just needs a bit of tweakin to get it to render. Need to:
-= addEventListener(Event.ENTER_FRAME, updateSimulation, false, 0, true) to the constructor (or anywhere really)
-= change updateSimulation() to:

Code:
public function updateSimulation(e:Event):void
      {
         mouseDrag();
         world.Step( timeStep, iterations );
      }


-= create a .fla with this in the first frame:
Code:
import <point this to your copy of the "MobilePhysics">.MobilePhysics

var oSprite:Sprite = new Sprite()
addChild(oSprite)
oSprite.x = 100
var mobileTest = new MobilePhysics(oSprite)
oSprite.addChild(mobileTest)


Hope this helps!
Thanks for all the great work you guys/gals are doing.
-=b=-


I did your steps but it didnt work

"1046: No se encontró el tipo o no es una constante en tiempo de compilación: Event."
Hi all,

Some of you have been mailing and messaging me about how to use the class I posted a while ago.

To explain, I have created a simple implementation attached to this post. The main added value is it shows how to use the Physics simulation to draw your custom graphics, which happens in the Rope class.

It is in the form of a FlashDevelop project, which is an actionscripting environment I can highly recommend.

The package is structured like this:

/flash/project - FlashDevelop project files
/flash/as3_src - the source code

/site - the compiled SWF with html files etc

You could probably also compile this using the Flash IDE somehow, I forgot how that goes though 🙂

Good luck 🙂

Erik
OMG amazing class very very thxx!!! 😮 😀

you are the best!
could you explain a bit how the class works.
i trying to make it work that i could pass two instance names and the rope will be drawn between them.
thanks
it's a wonderfull rope
I need some help...
How can I put a clip in the extreme of the rope and not the star?
Hello all,
I can't seem to see any graphics in this simulation without turning on debug mode.
I must admit i'm a Box2d novice, so maybe its a simple fix?
What i'm trying to do is to add my own 'star', and give the rope a colour.
Any help is appreciated
Thanks,
James
Hello,
How to use this in a fla? I dunno how to implement it because i cannot see a fla file and how to work with it...
I want to be able to import this as a swf in my main movie...
Any help appreciated.. Thanks
First of all its great to share the code to everyone.. however, i have 1 question in mind.

How to increase the width of line and how to draw the image along the line instead black rope ?

anyone's reply will be really appreciate.

Thanks..

Pardon my English.

Original thread: https://box2d.org/forum/viewtopic.php?t=2094