Welcome to the AS3 Forum :: Resource Thread
Welcome to the forum for ActionScript 3 related questions.
Adobe ActionScript 3 (AS3) Resource Thread:
This isn't a conversation thread so please just post a link and brief description of any requirements/info on the sites. Posts may be edited or deleted in order to keep this as a useful resource thread for the future or add it to the exisiting sticky thread. Feel free to add to this thread; however it simply means that the posts will be added/removed as the Flashkit Mods see fit and as long as they add to the ActionScript3 resource thread.
If your post is added to this resource thread, you will be given proper acknowledgement. So feel free to add/share away!
Resource Links for Adobe ActionScript 3 (AS3):
Complements of walnoot
Complements of mr_malee
Complements of senocular
List of 3D engines and 3D tutorials (added by Cancerinform)
PLEASE BE AWARE THAT LINKS WILL BE ADDED TO THIS POST FOR EASY REFERENCE, I'VE DELETED ALL OTHER POSTS IN THIS THREAD. PLEASE POST YOUR LINKS AND THEY'LL BE ADDED HERE.
FlashInterface - Communicating between Flash 8 and Flash 9 SWFs
Hey gang, just thought I would let everyone know I built up a couple of classes that allow you to easily communicate between the ActionScript Virtual Machines (AVMs). You can dispatch events, talk to functions and properties synchronously through these class. The API is the same between both AS2.0 and AS 3.0. I needed to have this ability for a project I am currently working on and I am sure there will be many others who need this solution. Anyway check out the links below and have fun with them.
Article I wrote regarding the problem and solution:
http://www.flashextensions.com/blog/...and-solutions/
FlashInterface Page (Downloads, Documentation, and Examples)
http://www.flashextensions.com/produ...hinterface.php
Spread the news and let others know about these classes
Cheers,
Rob Taylor
info@flashextensions.com
Flash Extensions, LLC
Extend Flash. Extend Skills. Extend Possibilities!
[stuff] as3 sound visualising efx
Hi,
i´ve just finished some AS3 sound visualising stuff.
it comes up with a bunch of scripted sound spectrum
analytics, that visualise sound, react on sound or just
guide the sound.
show it to me
here is a short as3 script-snippet for you to play with.
it´s a tunnel effect, wich reacts on sound and turns
the tunnel inverse or straight forward. just a simple
little effect belonging on how high the sound spectrum
amplitude level is:
Code:
/////////////////////////////////////////////////////
// sound reactive tunnelizer
// author : frank reitberger
// site : http://www.dasprinzip.com
// copyright 2007
/////////////////////////////////////////////////////
// --------------------------------------------------------------------------------------------------
stop();
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// setup global vars
///////////////////////////////////
// sound related
var snd:Sound = new Sound();
var sndCnl:SoundChannel;
var byteArr:ByteArray = new ByteArray();
// sprite related
var dot0:Sprite = new Sprite();
var dot_vr:Number = 0;
var dot_ang:Number = 0;
stage.addChild(dot0);
// tunnelizer related
var zIndex1:Number = 0;
var modulo:Number = 0;
var tSwitch:Boolean = false;
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// start sound analytics
///////////////////////////////////
function sndAnalytics(event:Event) {
///////////////////////////////////
// sprite dot : move
///////////////////////////////////
var dot0:Sprite = stage.getChildAt(1);
dot_vr += Math.random()*.1-.05;
dot_vr *= .9;
dot_ang += dot_vr;
var vx = Math.cos(dot_ang)*3;
var vy = Math.sin(dot_ang)*3;
dot0.x += vx;
dot0.y += vy;
if (dot0.x > 380) {
dot0.x = 10;
} else if (dot0.x < 10) {
dot0.x = 380;
}
if (dot0.y > 390) {
dot0.y = 12;
} else if (dot0.y < 10) {
dot0.y = 390;
}
///////////////////////////////////
// analyse sound spectrum
///////////////////////////////////
getByte = 0;
SoundMixer.computeSpectrum(byteArr, true);
var i:int;
var w:uint = 2;
var num = undefined;
var type:String = undefined;
for (i=0; i<512; i+=w) {
var getByte:Number = byteArr.readFloat();
var n:Number = Math.floor(getByte * 100);
////////////////////////
// catch massiv amp
////////////////////////
if (i > 256 && n > 20) {
type = "massiv";
}
}
paintTunnelizer(type);
}
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// paint reactiv tunnelizer
///////////////////////////////////
function paintTunnelizer(type:String) {
zIndex1++;
modulo++;
var mc:MovieClip = new MovieClip();
mc.name = "circle__" + String(zIndex1);
mc.x = 200;
mc.y = 200;
stage.addChild(mc);
if (modulo==2) {
modulo=0;
mc.graphics.lineStyle(5,0x000033,.1);
mc.graphics.drawCircle(0,0,50);
} else {
if (type == "massiv") {
mc.graphics.lineStyle(5,0xffffff,5);
mc.graphics.drawCircle(0,0,50);
} else {
mc.graphics.lineStyle(5,0xffffff,.3);
mc.graphics.drawCircle(0,0,50);
}
}
dot0 = stage.getChildAt(1);
var getDotX:Number = Number(dot0.x);
var getDotY:Number = Number(dot0.y);
mc.x = getDotX;
mc.y = getDotY;
mc.sc = 1;
mc.alpha = 0.1;
for (var i:Number = 3; i < stage.numChildren; i++) {
var p = stage.getChildAt(i);
if (p.name.indexOf("circle__",0) != -1) {
var p1 = stage.getChildAt(i);
if (!tSwitch) {
p1.sc *= 1.2;
} else {
p1.sc *= .9;
}
p1.scaleX = p1.sc;
p1.scaleY = p1.sc;
p1.alpha+=.02;
if (type == "massiv") {
if (!tSwitch) {
tSwitch = true;
} else {
tSwitch = false;
}
}
if (p1.scaleX > 7) {
stage.removeChild(p1);
}
}
}
}
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// init
///////////////////////////////////
snd.load(new URLRequest("place path to your mp3 here"));
sndCnl = snd.play();
this.addEventListener(Event.ENTER_FRAME, sndAnalytics);
see it in action
get the source-fla
regards
drek
[Share] Load assets from external SWF files.
As learned a lot from Flash community, I would like to share mine if it could help some.
Here is a method I used in my recently Flash AS3 game, to load assets from external SWF files and use them dynamically. Download as followed.
http://www.neatfilm.com/flash/download/LoadExternal.zip
Lumineccs [ Lumines clone ]
Hey Everyone,
I managed to make Lumines in Flash9/AS3.0.
Enjoy!
http://131.104.197.22/sites/spearetest/lumines.html
- Brad
Actionscript 2.0 to 3.0 Migration
This is can be found from within the Language Reference link at the top. But just to point it out, here is the "Actionscript 2.0 to 3.0 Migration" table...
http://livedocs.adobe.com/flash/9.0/...migration.html
[CLASS] XMLLoader CLass (AS3)
http://blog.kreativeking.com/2008/07...-version-as30/
I recently released a class (XMLLoader) and after some suggestions and further research, I decided to revamp the class entirely. With this comes some good news and bad news. Bad news first, the class no longer automatically creates the event listener for you. This is not a big lose. I just wanted to keep to Encapsulation standards.
[CLASS] VideoViewer Class (AS3)
http://blog.kreativeking.com/2008/07...wer-class-as3/
The VideoViewer Class is a class I created to quickly put together a video player in a matter of minutes. This is just part of a package that includes other classes such as the ProgressionBar Class which controls the scrubber and the time line. I will release the other classes at a later date.
New Papervision Video Tutorial - Clickable Objects
Hey all,
Just sharing my latest tutorial on Papervision 3D. This video tutorial that I put together features an exercise that demonstrates how to make objects clickable in Papervision.
Heres the link: http://www.madvertices.com/2008/08/i...-exercise.html
Note: you may need to scroll to view the full captions at the bottom of the screen
I've also posted up a bunch of new blogs/walk-throughs of various Papervision features including the bend and twist modifiers.
http://www.madvertices.com
Cheers everyone! Happy Flashing.
Function Utility Functions
I've just posted a blog entry about some utility functions I just wrote.
One of the questions that comes up a lot here is "how do I pass extra values to my event listener?" This package addresses that and more.
Example:
Code:
closurizeOutput.addEventListener(MouseEvent.CLICK, FunctionUtils.closurizeEventHandler(cfunc, [1, 'test']));
//... later
private function cfunc(event:MouseEvent, n:int, s:String):void
{
var tf:TextField = event.currentTarget as TextField;
tf.text = n + ": " + s; //should change textfield to '1: test'
}
This does just what you'd expect: on click, cfunc is called with the event, 1, and 'test' arguments.
Also included in the package are thunk creation and memoization wrapper functions.
Enjoy
ExternalInterface utility
I've created a utility class to make it easy to expose functions through ExternalInterface.
The names of all exposed functions are put into an array, which is available through a function "getFunctionNames". getFunctionNames itself is exposed to javascript. There is also a "describeFunctions" function which returns a JSON string describing all exposed functions and arrays of their parameter types. These can be used for introspection on the javascript side. The example page automatically puts up buttons and input/output fields for each exposed function.
To do the JSON export, this now depends on as3corelib.
Usage:
First, if you're using Flex or FlashDevelop with the mxmlc compiler, you can use the nifty [Exposable] tags. In FlashDevelop, open up your project->properties->compiler options dialog, and put this in the "additional compiler options" box:
Code:
-keep-as3-metadata+=Exposable
Make sure that's "+=", rather than "=", otherwise other tags won't be preserved.
Second, import me.cosmodro.utils.ExposureUtil;
You can tag methods to expose via [Exposable], like so:
Code:
[Exposable]
public function anotherPublicFunction(i:int):void
{
tf.appendText("anotherPublicFunction\n");
return;
}
Or, if you want to override the function name, you can do it like this:
Code:
[Exposable(name="yapf")]
public function yetAnotherPublicFunction():void
{
tf.appendText("yetAnotherPublicFunction\n");
return;
}
If you're not using the mxmlc compiler, you can still expose all public functions (either inherited or only declared in the class) via:
Code:
ExposureUtil.expose(this, "");
The second argument there is an optional prefix to be added to all the js identifiers for this class. It would be useful if you're exposing more than one class for some reason.
There are two more parameters to expose, both booleans. The first is "tagOnly", which determines whether only tagged or all public functions are exposed.
The second is "inheritedToo", which determines if inherited functions are also exposed.
There's also a passthrough function for ExternalInterface.addCallback, but it takes a third argument which is an Array of Strings for the parameter types to expose through describeFunctions.
Try the demo
And get the source
Original blog post:
http://cosmodro.me/blog/2008/aug/31/expose-your-tool/
Compiz-like window behavior
Hello,
some time ago i wrote a proof-of-concept implementation of a quite crude compositing-ready windowing system: since i don't plan to spend some time on it sooner i thought it would be better to release the code in case someone interested could adapt to its needs: despite it's early-stages of development (and me tormenting something else) it's free for everyone to use :)
If you happen to modify and add your own effects and other stuff just let me know and i'll be happy to link back to you!
The demo can be found here or you can download the sources from here.
Can any one help AS3 Saving motion AS 3
Hi
Im new to AS3 , I have some clarification.. Iam using 3 images in 3 layer. first image start with frame and tween motion.
2 image will start 28th frame ( tween - from smaller to bigger image) start in 40th frame .will blur
when I save as motion. I got a error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.motion::Animator/set time()
at fl.motion::Animator/rewind()
at fl.motion::Animator/play()
at important_fla::MainTimeline/important_fla::frame1()
Iam basically new to flash AS 3 using Motion script.. can any one help me out that :
2 and 3 images Iam using after 28th frame. So frame 1 there is NO image. pls suggest what I have to do.
thanks
vesperOpifex AS3 framework
vesperOpifex has released its first candidate on google code, easily build huge Flash and Flex applications quickly and easily using XML and asset files.
http://code.google.com/p/vesper-opifex/