background preloader

Actionscript code

Facebook Twitter

Actionscript Snippets. Rotating a Sprite around any point - Everyday 3D. Click once to activate, then click anywhere to move the registration point.

Rotating a Sprite around any point - Everyday 3D

Use SPACE to change the object or any other key to change the direction of the rotation. This time I want to share a simple solution to a relatively simple, but annoying problem. The problem: the Sprite.rotation property rotates the object always around the registration point of the Sprite. If you need to rotate it around some other point, it's not automatic. One way to achieve this is to move the content inside the Sprite in order to change its position in relation to the registration point. Another way is to wrap your Sprite into another Sprite and rotate the parent. Solution: the Rotator class can be used as a replacement for the default Sprite.rotation property. Source. Example. Use it like this: Actionscript: Flashtica // Free Open Source Actionscript and Flash code files and resources directory.

AnimatedBitmap - hexagon. My favorites ▼ | Sign in Project Home Wiki Issues Source Show details Hide details Change log r357 by sbalkau on May 19, 2010 Diff fixes in the animated bitmap class.

AnimatedBitmap - hexagon

Project members, sign in to write a code review Older revisions r355 by sbalkau on May 15, 2010 Diff [No log message] r353 by sbalkau on Apr 12, 2010 Diff r352 by sbalkau on Apr 4, 2010 Diff All revisions of this file File info Size: 22177 bytes, 863 lines View raw file Terms - Privacy - Project Hosting Help Powered by Google Project Hosting.

Points around circumference. /** Distribute the points clockwise around the circle.

Points around circumference

*/publicstatic const CLOCKWISE : String = "clockwise";/** Distribute the points counterclockwise around the circle. */publicstatic const COUNTERCLOCKWISE : String = "counterclockwise"; /** * This method accepts arguments based on the size and position of your circle * along with the amount of points to distribute around the circle, * what angle to start the first point, which direction to plot the points, * how much of the circumference to use for the distribution, and which direction * around the circle to plot the points. * @example example: * * @param centerx The center x position of the circle to place the points around. * @param centery The center y position of the circle to place the points around. * @param radi The radius of the circle to distribute the points around. * @param total The total amount of point to distribute around the circle. * @param startangle [Optional] The starting angle of the first point.

Return pts;} Explore. Preloader. The magic of creating a preloader in ActionScript 3 lies in the LoaderInfo class.


Every instantiated DisplayObject instance (all objects that appear on the stage, plus the stage itself) have a loaderInfo property that returns a LoaderInfo instance that contains information about the loading progress of that particular display object. Creating a preloader for the whole application is a matter of monitoring these LoaderInfo instances. Method 1: Monitor Stage LoaderInfo instance Under this method the loading progress is monitored via the LoaderInfo instance associated with the stage. Since all assets that will appear in the application need to be attached to the stage, the stage’s LoaderInfo instance will reflect the loading of all these assets. Graphics Save the file. Code Go to File → New… and select ActionScript File.Paste the following code and save the file as in the same directory as the .fla file saved earlier. Method 2: Monitor content SWF LoaderInfo instance.

Deep linking. SWFAddress is a small but powerful library that provides deep linking for Flash and Ajax.

Deep linking

It's a developer tool, allowing creation of unique virtual URLs that can point to a website section or an application state. SWFAddress enables a number of important capabilities which are missing in today's rich web technologies including: Bookmarking in a browser or social website Sending links via email or instant messenger Finding specific content with the major search engines Utilizing browser history and reload buttons Download SWFAddress 2.4 (12MB, Including docs, samples and sources) or just the core scripts and libraries (39KB). Samples Flash | Flex | Ajax | SEO | More » License SWFAddress is licensed under the MIT license. Source The latest and greatest development version of the project can be found at SourceForge. Twitter feed Loading... More SWFAddress related tweets » Snippets.