Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-16-2007, 02:51 PM   #1
Registered User
Join Date: Aug 2007
Posts: 4
Default need converting of some simple as2 to as3


im extremely new to flash

however photoshop, illustrator and 3dstudio max are my backgrounds
so i'm not a complete noob

anyways, i've been using the craig campbell tutorial for making a webpage in flash and after creating a movieclip for an animated button ive discovered that the tutorial being for flash 8 uses as2, whereas i'm using flash cs3... obviously using as3

can anyone help convert my script so that it will work?

here's the script:
ActionScript Code:
btn_design_mc.onRollOver = function (){     btn_design_mc.gotoAndPlay("_over"); } btn_design_mc.onRollOut = function (){     btn_design_mc.gotoAndPlay("_out"); }

anyhelp would be great

Last edited by dr_zeus; 08-16-2007 at 05:38 PM. Reason: formatted code
createns is offline   Reply With Quote
Old 08-16-2007, 03:39 PM   #2
Join Date: Sep 2002
Location: Toronto, ON
Posts: 2,068

ActionScript Code:
import flash.display.MovieClip; import flash.events.MouseEvent; btn_design_mc.addEventListener( MouseEvent.MOUSE_OVER, onRollOver ); btn_design_mc.addEventListener( MouseEvent.MOUSE_OUT, onRollOut ); btn_design_mc.addEventListener( MouseEvent.CLICK, onClick ); function onRollOver( event:MouseEvent ):void {      var btn:MovieClip = event.target as MovieClip;      btn.gotoAndPlay( "_over" ); } function onRollOut( event:MouseEvent ):void {      var btn:MovieClip = event.target as MovieClip;      btn.gotoAndPlay( "_out" ); } function onClick( event:MouseEvent ):void {      trace( "You clicked: " + event.target ); }
o Please do a search before you post
o Please use the [ as][ /as] tag for your code (so we can read it clearly)
Slowburn is offline   Reply With Quote
Old 08-16-2007, 05:29 PM   #3
panel's Avatar
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel

is you are using Flash CS3 you don't have to use as3. You can still create as2 project.
panel is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending events to multiple listeners in as3 sebacuello ActionScript 3.0 0 05-31-2007 04:05 PM
AS2 Component into AS3 shell red penguin ActionScript 3.0 0 05-29-2007 08:11 PM
Action Script Help Needed! - Simple, fun, RPG Shopping Cart... N!KtheAL!EN ActionScript 1.0 (and below) 5 01-28-2005 08:13 AM
:: i need help converting simple AS1.0 script into AS2.0 marzstar ActionScript 2.0 1 12-19-2004 11:14 AM
simple simple down state button question Pixel ActionScript 1.0 (and below) 3 11-23-2001 03:49 PM

All times are GMT. The time now is 02:13 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.