See how simple it is to create glossy buttons in Fireworks using simple layered effects.
More: continued here
See how simple it is to create glossy buttons in Fireworks using simple layered effects.
More: continued here
Difficulty: ModerateTime Taken: 25 minutesDescription: Script Injection in ActionScript 3: Using Wrapper Functions to inject JavaScript and VBScript into a webpage through Flash ActionScript 3This article will show how to inject and execute complete JavaScript and VBScript functions, class objects and applications into a webpage through ActionScript 3’s ExternalInterface Class. In addition, we will show how to store and modify complete JavaScript and VBScript scripts directly within AS3 sourcecode, where they may be safely kept until needed.Readers should be familiar with ActionScript’s ExternalInterface Class. In addition, competence with JavaScript and the Document Object Model (DOM) is recommended.
More: continued here
Time: 30 minutes Difficulty Level: Intermediate Requirements: Flash 6+in this tutorial you will learn how to create two classes which will be handy to apply a tint to a moviclip and also lear how to animate a tint over a movieclip.
More: continued here
If you are new to Flash templates, read up on how to use these to power your own video projects.
More: continued here
I wanted to try something fun withFlash, so I did a quick search for “Flash PhysicsEngine.” Lo and behold, I stuck gold. Box2DFlashAS3is an open source ActionScript 3.0 conversion of the C++ PhysicsEngine Box2D. I’m very impressed with its well coded structure and easilyimplemented nature. I learned a few new things that will change howI code forever just by reading through their example files.Still, they have limited resourcesright now as far as help documentation goes (”Please refer tothe source code from the examples provided to get an idea of how touse Box2DFlash in your projects.” — that’s the ReadMe.txt thatcomes with it… not very helpful,huh). I thought I might give youan example of my own and walk through it step by step.That was the thought, but it has takenme all weekend to understand the engine well enough to explain how itworks. The beauty of it though, is you don’t have to understand howit works to use it. Now to get right into it then! First of all, inorder to do anything with Box2DFlash you’re going to have to includemost (if not all) of the files. If you have the 349KB folder “Box2D”in your project folder, then your includes will work just like this:[as] // Classes used in this example import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.Contacts.*; import Box2D.Common.*; import Box2D.Common.Math.*;[/as]Easy.Now you have to create a b2World object(source code of the class is in Box2D/Dynamics/b2World.as). Theworld object is the entire body of the engine. Everything iscontained within it once your are done.NOTE: The brain of the engineis b2BroadPhase.as and the heart is the Step() function withing theworld object. Don’t go messing with the brain (b2BroadPhase.as)ever. You will totally mess up the engine.The world object constructor requires 3things:1.) Acoordinate system in the form of a b2AABB class object.2.) Avector that defines gravity. That will be in the form of a b2Vec2class object.3.) Aboolean variable that defines whether objects “sleep” ornot. (I recommend you make it true, thatthey can sleep)[as]//Create world AABBvar worldAABB:b2AABB = new b2AABB();worldAABB.minVertex.Set(-1000.0,-1000.0);worldAABB.maxVertex.Set(1000.0,1000.0);// Define the gravity vectorvar gravity:b2Vec2 = new b2Vec2(0.0,300.0);// Allow bodies to sleepvar doSleep:Boolean = true;// Construct a world objectm_world = new b2World(worldAABB,gravity, doSleep);[/as]My examples are not my own here. Thecode I’m showing is an excerpt from the “Hello World” codethey provided with the engine.After creating a world object you haveto bring it to life by setting its heart to beating:[as]//Add event for main loopaddEventListener(Event.ENTER_FRAME,Update, false, 0, true);public function Update(e:Event):void{m_world.Step(m_timeStep,m_iterations);}[/as]Running the Step() function every framewill update all the Body Definitions you add to your world.As of right now this world is emptythough. In order to add balls and boxes and any strange polygonalshapes you can think of, we need to create Body Definitions for them.A Body Definition consists of 2, 3, or4 things.1.) AShape Definition.2.) An(x,y) position.optional:3.) Rotation (inradians)4.) A pre-made Spriteobject.In the example flash movie at thebeginning of this post you will notice that all the shapes aresimple. That’s because everything is being redrawn every frame withonly lines and no fill. That’s right, EVERYTHING is made in code. Nothing was drawn by hand.If you want your game, or whatever, tohave a little more character then that example movie, then you willprobably want to associate hand made Sprites with your BodyDefinitions.In the “Hello World” example,they use Sprites to display their objects. You could leave theminvisible too if you really wanted. Either way they will still beaccounted for in the calculations.On to something very important. Whatis a Shape Definition!? We have 3 types of shape definition and theyall extend the base b2ShapeDef class.First we have the b2BoxDef class. Theb2BoxDef has 4 important properties:1.) Extents- this is a vector that essentially goes from one corner of the boxto the exact center. In other words, half the width and hight. (boxis a rectangle)2.)Density - in the collision equations we use density * area = massA density of 0 (zero) or null will makethe object static and it will never move in the case of a collisionor gravity.3.) Friction- this is used to calculate the friction between 2 objects… youshould keep it between 0.0 and 1.04.) Restitution- this is the bounciness of the object. Should probably also staybetween 0.0 and 1.0The b2CircleDef has only onedifferences in it’s properties. Instead of Extents it has Radius,which is easy to remember.The b2PolyDef has an array of (max 8)vertices instead of Extents or Radius. These vertices are justb2Vec2 vector objects.Now Adding a bunch of objects to ourworld should be easy:[as]varbodyDef:b2BodyDef;var boxDef:b2BoxDef;var circleDef:b2CircleDef;// Add ground bodybodyDef = new b2BodyDef();boxDef = new b2BoxDef();boxDef.extents.Set(1000, 100);boxDef.friction = 0.3;/*Notice that the ground object has nodensity like the laterdefinitions. That’s because it isstatic and we don’t want iteffected by any forces.*/bodyDef.position.Set(320, 400);bodyDef.AddShape(boxDef);// Add sprite to body userData/*We have a Sprite object in thelibrary called PhysGround. Herewe are associating that with our bodydefinition.*/bodyDef.userData = new PhysGround();bodyDef.userData.width =boxDef.extents.x * 2;bodyDef.userData.height =boxDef.extents.y * 2;addChild(bodyDef.userData);m_world.CreateBody(bodyDef);// Add some objectsfor (var i:int = 1; i < 20;i++){/*We are going to re-use the samebodyDef from before.It doesn't matter now, because it'salready been copied and storedin our world object.*/bodyDef = new b2BodyDef();// Boxif (Math.random() < 0.5){boxDef = new b2BoxDef();boxDef.extents.Set(Math.random() * 15+ 10, Math.random() * 15 + 10);boxDef.density = 1.0;boxDef.friction = 0.5;boxDef.restitution = 0.2;bodyDef.AddShape(boxDef);/*We have a Sprite object in thelibrary called PhysBox.*/bodyDef.userData = new PhysBox();bodyDef.userData.width =boxDef.extents.x * 2;bodyDef.userData.height =boxDef.extents.y * 2;}// Circleelse {circleDef = new b2CircleDef();circleDef.radius = Math.random() * 15+ 10;circleDef.density = 1.0;circleDef.friction = 0.5;circleDef.restitution = 0.2bodyDef.AddShape(circleDef);/*We have a Sprite object in thelibrary called PhysCircle.*/bodyDef.userData = new PhysCircle();bodyDef.userData.width =circleDef.radius * 2;bodyDef.userData.height =circleDef.radius * 2;}bodyDef.position.x = Math.random() *400 + 120;bodyDef.position.y = Math.random() *100 + 50;m_world.CreateBody(bodyDef);addChild(bodyDef.userData);}[/as]That's great isn't it? It's really notthat hard to add a whole bunch of objects to your world. You shouldknow that the Step() function that we added earlier will only takecare of moving and rotating our body definitions. If we have spritesto represent those definitions then we need to update themmanually... they made the code for that easy and you can copy andpaste it almost exactly into every one of your projects.We just have to rewrite our Updatefunction from before:[as]publicfunction Update(e:Event):void{m_world.Step(m_timeStep,m_iterations);// Go through body list and updatesprite positions/rotationsfor (var bb:b2Body =m_world.m_bodyList; bb; bb = bb.m_next){if (bb.m_userData is Sprite){bb.m_userData.x = bb.m_position.x;bb.m_userData.y = bb.m_position.y;bb.m_userData.rotation =bb.m_rotation * (180/Math.PI);}}/*This is an extreemly clever way todo this, and I suggest you copy it exactly in your own projects.*/}[/as]That's it for now. We have objects ina world that can collide with each other and are affected by gravity. There is still a lot more to talk about, but I am just walking youthrough the "Hello World" first. We still need to coverJoints, Pulleys, Gears, Compound Shapes, Forced rotation (like carstires), and a lot more... I doubt I will be able to cover all thesetopics anytime soon, but I will definitely write more tutorials onthis physics engine in the future.You can download my copy of the "HelloWorld" example project with all of my comments included (thereis almost no commenting in the original).DownloadHello World w/commentsYou can get all of the library filesneeded for Box2DFlashat their site. It's free.Credits:Box2D - Erin Catto (http://gphysics.com/)Box2DFlashAS3 - Matthew Bush (FlashActionScript 3.0 port of Erin Catto's work)
More: continued here
Use this guide both as an API reference and a tool to learn about the ActionScript APIs available within Adobe AIR, Flash Player, and the Flex framework.
More: continued here
Build a Flash video application that incorporates metadata into the live video stream.
More: continued here
Bring corporate-type presentations to life on the web by synchronizing text with the video.
More: continued here
Find out why Fireworks is an excellent tool for designers and developers working in an collaborative enterprise environment.
More: continued here