Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- Formatting my post
- How to blend adsense inside your post?
- PHPWind-- A PHP forum script applcaition in China
- Promote your Forum/Blog/Website via major search Engines
- Install PHP ibm_db2 extension in Linux (redHat)
- Install PHPMailer 5.2.4 and use smtp gmail
- Google Adsense forum and pin number
- phpexcel toggle expand and hide column in EXCEL and summary
- Datatable export excel wraptext and newline
- PHP - Export Content to MS Word document
Thursday, September 15, 2011
Resize image using button in actionscript 3
The steps to design a "+" and "-" button to increase an image in actionscript 3.0
Here the button is not real button in AS3, it is a Movie Clip.
1) Click Adobe Flash CS3 Professional:
2) File->New ->ActionScript 3
3) In layer 1, import an image, draw a button using rectangular tool and duplicate it.
4) Create a new layer "text", type "+" and "-" in each button
5) Using selection tool (v), convert image and two buttons as "Movie Clip", and set
image instance name m_whale (click property), "+"button as m_plus, "-" button as m_minus
6) Create new layer " action",
press F9 to import following actionscript
m_plus.addEventListener(MouseEvent.CLICK, IncreaseSize);
m_minus.addEventListener(MouseEvent.CLICK, DecreaseSize);
function DecreaseSize(evt:MouseEvent){
m_whale.scaleX -= 0.1;
m_whale.scaleY -= 0.1;
}
function IncreaseSize(evt:MouseEvent){
m_whale.scaleX += 0.1;
m_whale.scaleY += 0.1;
}
4) Control + Test Movie (ctrl+enter) to test movie. Export movie to swf file.
5. The swf is below
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment