Feb 21 2010

Getting started with AS3 as soon as possible

Category: tutorialali @ 9:20 am

Hi everybody,

I know how felt for the first time that you wanted to start learning AS3! specially when you were not familiar with any other languages before.

Alright, now it’s time for you to be relax that you have found a quick post finally to get you started with AS3 as soon as possible.

I myself when I was starting to learn about AS3, I found it so hard to get started… I had to spend so much time on finding different books, video tutorials, etc… and hehe, it was just the beginning, then I had to start studying the books and watching the videos… you know? it takes so much time for you to get started like that, but in the other hand it’s good for those who are not also familiar with using Adobe flash interface, etc… in the following I let you know whose this tutorial is for.

WHOSE THIS TUTORIAL IS FOR?

This tutorial is good for those who know a little about Adobe flash interface and don’t know anything about AS3 but know a little about computer languages and are a little familiar with variables, functions, etc… and love to get familiar with the AS3 world and don’t know where to start! so they don’t want to waste their times on seeing the tutorials that explain functions and variables from the beginning and explain every littile tiny thing from scratch… they need to have a resource for them to get them as soon as possible on their ways, so that’s why this post is written by me.

Alright, so for those who doesn’t know anything about Adobe flash interface or something and like to study some books and watch video tutorials, there are a dozens of books and videos out there to put you on your way but here I just want to mention the main facts. Continue reading “Getting started with AS3 as soon as possible”

Tags: , , , , , , , , , , , , , , , , ,


Feb 21 2010

Custom Event Listener

Category: AS3admin @ 2:22 am

When writting your AS3 projects, you will need events. The main thing that events do is to help you make a bridge between your instances of classes. take the adobe’s MouseEvent as an example. you add a MouseEvent.CLICK listener to a movieclip so that when you click on a movieclip instance it will dispatch the “CLICK” event. it works like below as you know.

import flash.events.MouseEvent;
mc.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void
{
    trace("mc is clicked")
}

this is all good, you have used an event being built by adobe (there are many other premade events by flash if you just check the package flash.events) Continue reading “Custom Event Listener”

Tags: , , , , , , ,


Jan 23 2010

Unload an externally loaded swf file

Category: FAQadmin @ 12:09 am

How to remove or unload an externally loaded swf file from your project?

It happenes a lot that you try to load an external SWF file into your project. maybe in your portfolio or some swf movies or sound files. The problem I am going to talk about here is about the common problem of unloading the swf files!

you see, if you have loaded an swf file which has some music on it playing constantly, when you try to unload/remove that swf, the sound keeps playing! (not just sounds, maybe some Event.ENTER_FRAME or other listeners are still working)

to avoid this problem, the best solution I can think of is to add a REMOVED_FROM_STAGE listener in your external swf file so it can listen to when it’s removed from the stage so it can kill the running processes inside itself.

simply add it like this:

1
2
3
4
5
6
import flash.events.Event;
this.addEventListener(Event.REMOVED_FROM_STAGE, onStageRemoved);
function onStageRemoved(e:Event):void
{
// kill all listeneres and running processes here.
}

Regards,
Hadi

Tags: , , ,