IT Community - Software Programming, Web Development and Technical Support

Flash Tips & Tricks

This is a discussion on Flash Tips & Tricks within the Flash Actionscript Programming forums, part of the Web Development category; Yeah that is there. Thanks posting the tips. And now Flash CS3 came. I will try to post new techniques ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools Display Modes
  #11  
Old 07-20-2007, 06:45 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Smile Re: Flash Tips & Tricks

Yeah that is there. Thanks posting the tips. And now Flash CS3 came. I will try to post new techniques in that. Keep on posting new techniques here. So that the people who wants to know flash tips, they can get it from one place instead of searching all over the web for a single tips.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12  
Old 08-08-2007, 10:05 AM
kbala kbala is offline
D-Web Trainee
 
Join Date: Mar 2007
Posts: 5
kbala is on a distinguished road
Post Re: Flash Tips & Tricks

Hey All,

I have one tip for flash people who works with action script and the data comes from server programming or server side xml.

The tip is,

Use "mx.controls.Alert.show()" instead of using "getURL("javascript:alert('');")"

why because, the getURL function sometime fails to make alert, it will lead you to make false programming.

Thanks

-kb
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13  
Old 08-30-2007, 04:43 AM
nssukumar nssukumar is offline
D-Web Sr.Programmer
 
Join Date: Feb 2007
Posts: 155
nssukumar is on a distinguished road
Default Re: Flash Tips & Tricks

when we set number of text box or buttons or combo
when we click tab it moves to next,
for example if you have a clip in that order,
tab does not work on the clip, for that you had to
enable the tab to true.
for example;
clip1_mc.tabEnabled = true;

then only tab works on the clip.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14  
Old 09-20-2007, 07:02 AM
geoblow geoblow is offline
D-Web Trainee
 
Join Date: Jul 2007
Posts: 17
geoblow is on a distinguished road
Thumbs up Array copying (Array.concat method)

In actionscript if we copy an array like the below code. After that we changed any one array it will change that two arrays. See the code

Code:
var original:Array = [ 1, 2, 3 ];
var copy:Array = original;

copy[0] = 100;

trace( original[0] ); // 100
trace( copy[0] ); // 100
We can avoid this problem by using the method. See the below code

Code:
var original:Array = [ 1, 2, 3 ];
var copy:Array = [].concat( original );

copy[0] = 100;

trace( original[0] ); // 1
trace( copy[0] ); // 100
I hope it's useful.
Thanks
__________________
Geo
Actionscript Villain
geoblow.com
Atleast an inch move every day!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15  
Old 12-28-2007, 12:04 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Flash Tips & Tricks

This is the sample way to create a flash menu.
HTML Code:
import mx.controls.Menu;
import mx.controls.MenuBar;
import flash.net.FileReference;
var openListener:Object = new Object();	
var fileRef:FileReference = new FileReference();
fileRef.addListener(openListener);

var my_mb:MenuBar;

var file_menu:Menu = my_mb.addMenu("File");
var edit_menu:Menu = my_mb.addMenu("Edit");
var view_menu:Menu = my_mb.addMenu("View"); 
var control_menu:Menu = my_mb.addMenu("Control");
var help_menu:Menu = my_mb.addMenu("Help");

file_menu.addMenuItem({label:"New Playlist", data:"Control+N", instanceName:"newInstance"});
file_menu.addMenuItem({label:"Open", instanceName:"openInstance"});
file_menu.addMenuItem({label:"Open URL", instanceName:"openUrlInstance"});
file_menu.addMenuItem({label:"Exit", instanceName:"exitInstance"});

view_menu.addMenuItem({label:"Full Screen", instanceName:"fullScreenInstance"});
view_menu.addMenuItem({label:"Half Size", instanceName:"halfSizeInstance"});
view_menu.addMenuItem({label:"Minimize", instanceName:"minimizeInstance"});

control_menu.addMenuItem({label:"Play", instanceName:"playInstance"});
control_menu.addMenuItem({label:"Pause", instanceName:"pauseInstance"});
control_menu.addMenuItem({label:"Next", instanceName:"nextInstance"});
control_menu.addMenuItem({label:"Previous", instanceName:"previousInstance"});
control_menu.addMenuItem({label:"Volume Up", instanceName:"volumeUpInstance"});
control_menu.addMenuItem({label:"Volume Down", instanceName:"volumeDownInstance"});
control_menu.addMenuItem({label:"Mute", instanceName:"muteInstance"});

help_menu.addMenuItem({label:" Help", instanceName:"helpInstance"});
help_menu.addMenuItem({label:"Shortcuts", instanceName:"keyBoardInstance"});
help_menu.addMenuItem({label:"About", instanceName:"aboutInstance"});

//Create listener object.
var mbListener:Object = new Object();
mbListener.change = function(evt_obj:Object)
{
 var menuItem_obj:Object = evt_obj.menuItem;
 switch (menuItem_obj.attributes.instanceName) 
 {
	 case "newInstance":
	  trace("New menu item");
	  break;
	  
	 case "openInstance":
	  openFile();
	  trace("Open menu item");
	  break;
	  
	 case "openUrlInstance":
	  trace("Open URL");
	  break;
	  
	 case "exitInstance":
	  trace("Exit menu item");
	  fscommand("quit", "None");
	  break;
	  
	 case "fullScreenInstance":
	  trace("fullScreenInstance");
	  fscommand("fullscreen", true);
	  break;
	  
	 case "halfSizeInstance":
	  trace("halfSizeInstance");
	  fscommand("fullscreen", false);
	  break;
	  
	 case "minimizeInstance":
	  trace("minimizeInstance");
	  break;
	  
	 case "playInstance":
	  trace("playInstance");
	  break;
	 
	 case "pauseInstance":
	  trace("pauseInstance");
	  break;
	  
	 case "nextInstance":
	  trace("nextInstance");
	  break;
	  
	 case "previousInstance":
	  trace("previousInstance");
	  break;
	  
	 case "volumeUpInstance":
	  trace("volumeUpInstance");
	  break;
	  
	 case "volumeDownInstance":
	  trace("volumeDownInstance");
	  break;
	  
	 case "muteInstance":
	  trace("muteInstance");
	  break;
	  
	 case "helpInstance":
	  trace("helpInstance");
	  break;
	  
	 case "keyBoardInstance":
	  trace("keyBoardInstance");
	  break;
	  
	 case "aboutPlayerInstance":
	  trace("aboutPlayerInstance");
	  break;
 }
 //trace(menuItem_obj);
};
//Add listener.
file_menu.addEventListener("change", mbListener);
view_menu.addEventListener("change", mbListener);
control_menu.addEventListener("change", mbListener);
help_menu.addEventListener("change", mbListener);

function openFile() 
{
	fileRef.browse();
	openListener.onSelect = function(file1:FileReference):Void  
	{
	  trace("Opened " + file1.name);	  
	};
}
__________________
S.Balasubramanian
Nothing is impossible

Last edited by Balasubramanian.S : 02-20-2008 at 01:04 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16  
Old 12-28-2007, 09:42 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Flash Tips & Tricks

This is a simple way to create a right Click menu


onClipEvent(load)
{
//MENU.customItems.push(Functioned2);
MENU = new ContextMenu();
MENU.hideBuiltInItems();
Functioned = new ContextMenuItem("This movie is copyrighted by Your Company Name", doSomething);
Functioned2 = new ContextMenuItem("Visite Our Website", doSomething2);
MENU.customItems.push(Functioned);
MENU.customItems.push(Functioned2);
_root.menu = MENU;
function doSomething()
{
}
function doSomething2()
{
getURL("http://www.Discussweb.com", _blank);
}
}
__________________
S.Balasubramanian
Nothing is impossible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17  
Old 02-18-2008, 01:46 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Hi,
To Upload or Download a file using flash in web applications use "FileReference" class.
The FileReference class provides a means to upload and download files between a user's computer and a server. An operating-system dialog box prompts the user to select a file to upload or a location for download. Each FileReference object refers to a single file on the user's hard disk and has properties that contain information about the file's size, type, name, creation date, modification date, and creator type (Macintosh only).

FileReference instances are created in two ways:

When you use the new operator with the FileReference constructor: var myFileReference = new FileReference();
When you call FileReferenceList.browse(), which creates an array of FileReference objects

Thanks

A.Ramesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18  
Old 02-18-2008, 01:51 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Keyboard Keys and Key Code Values:

Letters A to Z and standard numbers 0 to 9:
HTML Code:
Letter or number key,           Key code,            ASCII key code
      A                            65                       65
      B                            66                       66
      C                            67                       67
      D                            68                       68
      E                            69                       69
      F                            70                       70
      G                            71                       71
      H                            72                       72
      I                            73                       73
      J                            74                       74
      K                            75                       75
      L                            76                       76
      M                            77                       77
      N                            78                       78
      O                            79                       79
      P                            80                       80
      Q                            81                       81
      R                            82                       82
      S                            83                       83
      T                            84                       84
      U                            85                       85
      V                            86                       86
      W                            87                       87
      X                            88                       88
      Y                            89                       89
      Z                            90                       90
      0                            48                       48
      1                            49                       49
      2                            50                       50
      3                            51                       51
      4                            52                       52
      5                            53                       53
      6                            54                       54
      7                            55                       55
      8                            56                       56
      9                            57                       57
      a                            65                       97
      b                            66                       98
      c                            67                       99
      d                            68                      100
      e                            69                      101
      f                            70                      102
      g                            71                      103
      h                            72                      104
      i                            73                      105
      j                            74                      106
      k                            75                      107
      l                            76                      108
      m                            77                      109
      n                            78                      110
      o                            79                      111
      p                            80                      112
      q                            81                      113
      r                            82                      114
      s                            83                      115
      t                            84                      116
      u                            85                      117
      v                            86                      118
      w                            87                      119
      x                            88                      120
      y                            89                      121
      z                            90                      122

Last edited by aramesh : 02-18-2008 at 02:31 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19  
Old 02-21-2008, 09:26 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

How to download Flash object embeded in HTML Page?

There are two ways to download the (.swf) file,

1. First we want to know the file name of .swf, we can get it by

Right click the mouse
View Source and
Enter the key word .swf in find option.

we can get the file name.

Now, we can take this file from Temporary Internet Files folder in our system. While we visit or browse a site all file are stored in Temporary Internet Files, from this folder we can take all the files.

2. Second method is by using some swf catcher (like Sothink Swf Catcher) softwares we can download the file.

By using these methods only ill download the Flash object.

Regards
A.Ramesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20  
Old 02-21-2008, 09:30 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

what is the other way of using Inheritance in flash?

Other way of inheritance in AS1 is "prototype"

and in AS2 its "interfaces"

Regards
A.Ramesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# .Net Tips & Tricks oxygen C# Programming 85 01-08-2009 12:25 AM
SAP Tips & Tricks leoraja8 Operating Systems 0 03-29-2008 12:11 AM
PHP Tips and Tricks Sabari PHP Programming 20 12-18-2007 05:26 AM
.NET tricks & Tips Karpagarajan VB.NET Programming 1 04-23-2007 08:17 AM
SEO Tips & Tricks spid4r Search Engine Optimization 0 03-08-2007 11:03 PM


All times are GMT -7. The time now is 09:41 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0