Pages

Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Wednesday, 16 October 2013

My own Puzzle Game with 5 pictures (+ 1 prize game)


The developing of this game took only two days. It has 280 lines of code. And I still didn't finish the work with a timer. I need to add the "Pause" button as well. The main problem was the lack of knowledge about .mouseChildren command (It works with events propagation).



        puzzle.mouseEnabled = true;      
        puzzle.addEventListener(MouseEvent.MOUSE_DOWN, onDrag);
        puzzle.addEventListener(MouseEvent.MOUSE_UP, onDrop);
        puzzle.mouseChildren = false;

This application has 348 Kb size and uses 89% of CPU when you play a prize Game due to having 48 interactive animations.

Monday, 14 October 2013

Adobe Flash. AS3. Reparenting Children.

Сlicking on the car image, you can attach a trailer to it:
Get Adobe Flash player

Below you can see my source code:

Wednesday, 9 October 2013

Adobe Flash. AS3. Enter Frame Event.

This is the code:

stage.addEventListener(Event.ENTER_FRAME, onFrameLoop);

function onFrameLoop(evt:Event):void {
    cycle.x = mouseX;
    cycle.wheel1.rotation = mouseX;
    cycle.wheel2.rotation = mouseX;
    label1.text = "x = " + mouseX;
}


Monday, 7 October 2013

Adobe Flash. Rotation and Drag and drop events.

My simple example of using Event Listeners.
There is an instance of MovieClip called a box.
I applied three Mouse Events Listeners:
for events MouseEvent.MOUSE_UP for the button btn and for events MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_UP for the box.
The code is simple, but as a result you can rotate, drag and drop the object.

The code is simple (That it's. Nothing else):
btn.addEventListener(MouseEvent.MOUSE_UP, onRotateRight);
function onRotateRight(evt:MouseEvent):void {
    box.rotation += 20;
}

box.addEventListener(MouseEvent.MOUSE_DOWN, onStartDrag);
box.addEventListener(MouseEvent.MOUSE_UP, onStopDrag);

function onStartDrag(evnt:MouseEvent):void {
    evnt.target.startDrag();
}
function onStopDrag(evnt:MouseEvent): void {
    stopDrag();
}


My own Flash Fashion Game (as a part of a assignment for LSBF)

I decided to publish on here my own fashion game for big girls. I just want to show my abilities to work with Adobe Flash and Action Script 3. I publish here a trimmed version with some restrictions (I removed possibilities to apply patterns to outfit) but it's enough to play with this game. This applications involves more than 2 thousands of lines of code.


I used following predefined components:  Labels and ColorPickers.
In order to add text to the Label component you need to use its property text:
ControlMenu.txtLabel.text = "text";

In order to use the ColorPicker (and apply a selected colour to your object) you need create the function which will become the event handler for that ColorPicker:
    ControlMenu.cp1.addEventListener(ColorPickerEvent.CHANGE, colorApply);

    function colorApply(event:ColorPickerEvent):void { 

       var hexColor:Number = 0xffffff; //white
       var myCT:ColorTransform = new ColorTransform();
       hexColor = event.target.selectedColor;
       myCT.color = hexColor;
       outerwear.transform.colorTransform = myCT;

    }
The instance of the Color Transform is requested as a intermediate element to apply colour to any object. Outerwear is a name of a movie clip instance.

Sunday, 29 September 2013

Zombies & Monsters Shop. First scene from my Flash application (Avatar game) project.

Before to publish only one first scene I had to delete other ones from my flash application. In order to execute it I had to open the scenes panel (Shift + F2 ), select and delete all requested scenes (all scenes except first one).

This Flash application is a project for my education establishment. I finished it in August 2013 and handed in for estimating with a project report. This is a reason why I don't want to publish entire application at the moment. This is the next step in progress of a Avatar game project. The user can choose and apply different parts of dress to the game character. On the picture above you can see the possible outfit for zombies and monsters. But first scene is a welcome screen only. The shop entrance is disabled.

ActionScript in first scene involves only following code:

stop();
reloadBtn1.addEventListener(MouseEvent.CLICK, fl_reload);
function fl_reload(event:MouseEvent):void
{
    background1.play(); //to repeat the sunrise
}

goSceneTwoBtn.addEventListener(MouseEvent.CLICK, fl_goSceneTwo);
function fl_goSceneTwo(event:MouseEvent):void
{
    //MovieClip(this.root).gotoAndPlay(1, "Scene 2"); //disabled transition to the next scene
}


London Views. My Flash Animation with pictures' fading.

This animation involves only six pictures. In order to have the infinit loop I used first pictures twice: in the beginning and in the end of animation. Each following picture appears on the scene before then the previous picture will vanish. This flash animation has only timeline navigation without any scripting.





Catwalk avatar game. My second Flash application with the real pictures of Anthony Greenfield.

I made a pictures research on internet and found several suitable pictures with famous model at the catwalk. I used photo with Anthony Greenfield only for academic purposes. This is my next step in learning of a user interface developing. My aim was to find the easiest UI. The simpler the better. Now you can see the result of my developing. Clicking on the different areas you can apply different shirts and pants separately.

Saturday, 28 September 2013

Easiest Avatar game. My first simple Flash application with a timeline navigation.

Now I want to check: can I publish flash-movie on here. This is my first attempt. ActionScript contains only several EventListeners - the buttons click reactions:

emptyBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_1); function fl_ClickToGoToAndStopAtFrame_7(event:MouseEvent):void { gotoAndStop(1); }