Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

ActionScript 3 Tips

This is a discussion on ActionScript 3 Tips within the Flash CS3 eng forums, part of the English Forums category; Hi people, we all like as3 but sometimes the easiest things can give us lots of headaches. This is why ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 15-11-07, 20:19
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Post ActionScript 3 Tips

Hi people, we all like as3 but sometimes the easiest things can give us lots of headaches. This is why I open this thread. Here, myself and hopefully others will post tips on how to avoid headbanging

I would like to mention that I am also new to AS3 so if I say something stupid, don't hesitate to correct me.

Last edited by hard_overclocker; 15-11-07 at 20:51..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 15-11-07, 20:32
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Re: ActionScript 3 Tips

When you have a dynamic text field inside a Movie clip that you want to use as a button and you set
Code:
our_mc.buttonMode = true;
so the hand cursor apears when you hover over it, make sure you set the following atributes to the text field:
Code:
our_mc.mouseChildren = false;
our_text.selectable = false;
This will disable the mouse for the children of our_mc. You could also use
Code:
our_text.mouseEnabled = false;
our_text.selectable = false;
to disable the mouse just for the text field.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 15-11-07, 20:47
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Re: ActionScript 3 Tips

This is not realy AS3 news but, its good practice.
When you name your variables, it is very helpfull to add a specific suffix their name in order for flash to give you code hinting (flash opens the popup list with the available commands for selected item).

Here are some usefull suffixes:
  • myTextField_txt - for text boxes
  • myClip_mc - for movie clips
  • myButton_btn - for buttons
  • myArray_array - you got it
  • myXML_xml - for xml

Code hinting is very useful because it helps you prevent making some errors and keeps you on track. I like it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 29-02-08, 12:46
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: ActionScript 3 Tips

The importance of Event.ADDED_TO_STAGE:
Attached Files
File Type: zip ADDED_TO_STAGE.zip (64.1 KB, 104 views)

__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !

Last edited by Flep; 13-05-08 at 20:18..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 13-03-08, 13:17
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: ActionScript 3 Tips

Preventing cache in Flash Player

Just add this at the end of the call:
Code:
'?cachebuster='+new Date().getTime();
For example, if we want call info.xml:
Code:
'http://www.sitename.com/info.xml?cachebuster='+new Date().getTime();
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #6 (permalink)  
Old 14-03-08, 13:03
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: ActionScript 3 Tips

MouseWheel on MAC

Gabriel Bucknall has resolved the issue:

pixelbreaker : AS3.0 MouseWheel on Mac OS X
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #7 (permalink)  
Old 15-05-08, 06:31
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Set focus to TextField

Set focus to TextField
Let's say we have 2 TextFields: one_txt and two_txt.

If you want to give focus at one_txt:

Code:
stage.focus=one_txt;
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #8 (permalink)  
Old 18-05-08, 12:30
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Remove from the cache Flv video playback

Remove from the cache Flv video playback
Close the connection with the previous source and returns a player not more at cache.
Code:
my_flv_player.getVideoPlayer(my_flv_player.activeVideoPlayerIndex).close();
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #9 (permalink)  
Old 18-05-08, 12:34
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Many MovieClip to attach from library

Many MovieClip to attach from library
Create an Array with all your linkage Classes:
Code:
var classes:Array=new Array(NameLinkage1,NameLinkage2,NameLinakge3,NameLinkage4);
Use a loop and MovieClip as datatype:

Code:
for(var i:int=0;i < classes.length;i++)
{
	var clip:MovieClip=new classes[i]();
}
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Tips and Tricks - MovieClip.dropTarget Flep Tutorials 1 13-11-08 11:28
Tips abd Tricks Actionscript 3.0 - Loader.content Flep Tutorials 0 27-09-07 09:44
Tips and tricks - ghost instance Flep Tutorials 0 25-09-07 17:14
Tips and tricks - MovieClip.mouseChildren Flep Tutorials 0 23-09-07 11:50


All times are GMT. The time now is 14:02.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406