function dateSubtraction(d1y:int,d1m:int,d1d:int, d2y:int,d2m:int,d2d:int): Number { |
Showing posts with label AS3. Show all posts
Showing posts with label AS3. Show all posts
Sunday, November 21, 2010
Subtraction between 2 dates
Monday, July 19, 2010
iPhone touch motion
View
import flash.events.MouseEvent; |
DisplayUtils and fitIntoRect
Useful to create thumbnails and resizing
From http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle
From http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle
Sunday, July 18, 2010
Slide Transition
View DEMO
How to use:
import binhpro.SlideTransition; |
SlideTransition.as
package binhpro { //binhpro.SlideTransition |
ClickPageEvent.as
package binhpro { //binhpro.ClickPageEvent |
ImageUtils.as
package binhpro.utils { // binhpro.utils.ImageUtils |
Friday, July 16, 2010
Grid of Items Container
This post introduces to you a container that can help you create a grid of items that list in horizontal or vertical direction.
You can customize the ItemRenderer and ScrollBar by passing the name of it's Linkage Class.
HORIZONTAL CANVAS:
VIEW
VERTICAL CANVAS:
VIEW
EXAMPLE CODE:
Checkout SVN: https://flashtraining.googlecode.com/svn/trunk/AS3/BDCFramework
You can customize the ItemRenderer and ScrollBar by passing the name of it's Linkage Class.
HORIZONTAL CANVAS:
VIEW
VERTICAL CANVAS:
VIEW
EXAMPLE CODE:
import binhdocco.containers.canvas.Canvas; |
Checkout SVN: https://flashtraining.googlecode.com/svn/trunk/AS3/BDCFramework
Monday, July 12, 2010
Easy mouse panning
Make the movie panning with moving mouse.
Example:
View
Source code:
Code on the thumbnail map:
Example:
View
Source code:
|
Code on the thumbnail map:
this.addEventListener(Event.ENTER_FRAME, onEF); |
Global Dispatcher
The purpose of this post is to use a dispatcher class to handle events between all content movies in a project.
For example, in movie A, you want to notify an event to movie B and movie C, instead of using movieA.addEventListener(movieAEvent) in movie B and movie C, now we only need to use simple below code in movie A:
and in movie B and movie C, we use:
The Dispatcher class can also use for communication between any objects with any instances or the stage. Very simple and useful.
For example, in movie A, you want to notify an event to movie B and movie C, instead of using movieA.addEventListener(movieAEvent) in movie B and movie C, now we only need to use simple below code in movie A:
var dispatcher: Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(movieAEvent);
and in movie B and movie C, we use:
var dispatcher: Dispatcher = new Dispatcher();
dispatcher.addEventListener(movieAEvent, eventHandler);
The Dispatcher class can also use for communication between any objects with any instances or the stage. Very simple and useful.
package com.binhdocco.dispatcher { |
Subscribe to:
Posts (Atom)