stop();
You can do a bunch of things with simple stop(); The first thing I learned by heart <3
seen from United States
seen from United States
seen from Taiwan
seen from China
seen from Canada

seen from United States
seen from United States
seen from Türkiye
seen from China

seen from China

seen from United States

seen from India

seen from Greece
seen from United States
seen from Russia
seen from Argentina

seen from United States

seen from United States
seen from Argentina
seen from Sweden
stop();
You can do a bunch of things with simple stop(); The first thing I learned by heart <3

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Custom cursor
I doupt I'll ever use this, but it was so clean and simple. First make a fancy cursor, convert it to symbol and give it an instance name cursor. Then:
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_MOVE, follow);
function follow(e:MouseEvent):void{
cursor.x = mouseX;
cursor.y = mouseY;
}
Welcome back!
A year or two flew by with my baby! Now back to graduation.
And back to basics. If I once knew how to do some little thigs with Flash and as3, that has long since gone.
Next few lines detects when my game hero ramps into a citizen of Medieval Turku:
this.addEventListener( Event.ENTER_FRAME, handleCollision)
function handleCollision( e:Event ):void
{
if(citizen.hitTestObject(character))
{
trace ("crash")
}
}
Move with the town
I have really cool screenfollow function made by my tutor. The function moves the map around my game character, so it looks like the character is runnign in the town.
I was starting to wonder if I could ever make a use of it. It took some time to make other town people move with the map.
It was simple, of course (Towner is by firs inhabitant):
var mX:Number=map.x;
var mY:Number=map.y;
Towner.x=mX;
Towner.y=mY;
Moving Background
This is the tutorial I've been looking for!
In my first game view I have kind of landscape with citizens, and I want the layers of landscape to have a subtle horisontal movement when user moves a mouse. I think this adds nice feeling of exploration!
The original tutorial is by Jesse Harding and the result should look like this. The original is made with as2, fortunately someone changed it to as3!
Later edit:
I actually had to change the code a bit as I didn't get it working. I guess my problems were connected somehow to stage width and height (my stage is 550*400). And now the objects move more like I need them to:
import flash.events.Event;
stage.addEventListener(Event.ENTER_FRAME, mouseMoveHandler);
function mouseMoveHandler(event:Event):void {
//If you want to hide the cursor, uncomment the next line
//Mouse.hide();
//Move against
var cursorX:int = 550 - mouseX;
var cursorY:int = 400 - mouseY;
cir1.x = (cursorX * .15);
cir2.x = (cursorX * .15 + 450);
cir3.x = (cursorX * .01 + 350);
cir4.x = (cursorX * .05 + 200);
cir5.x = mouseX;
}

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Classes
I do my best not to use classes in my game. I know it would benefit my game and improve my skills... but I'm on denial and in a hurry. Anyway, how much I wish to do with out it, I feel that's the way it have to be in the end.
At the moment I'm reading this tutorial by Michael James Williams to find out if I really need to use them and refresh my memories of classes.
And what's great, the same guy is writing the tutorial with HTML5 also! This is something I want to learn anyway...someday!
Basic Loop
I will forget this, so here's my crip sheet:
var container:Array = new Array;
addChild(container);
for (var i:int = 0; i < 10; i++) {
var citizen:Citizen = new Citizen;
citizen .x = Math.random()*1000;
citizen .y = Math.random()*1000;
container.addChild(citizen );
}