Sunday, July 31, 2011

Basic Event Listeners and Hadlers Actionscript 3.0

0 comments
When you run a flash movie every time the mouse is clicked, it dispatches or broadcasts an event.

For example the below image shows an instance of simple button.This button has also been given the instance name of button1 in the Property inspector.


If you select frame 1 of the Actions layer and open the Actions panel, you will notice the following code, which will be responsible for detecting and responding to the CLICK event:
//Event Listerner
button1.addEventListener(MouseEvent.CLICK,Clicked)
//Event Handler
function Clicked(Evt:MouseEvent)
{
trace("Button1 Clicked");
}

The first two lines of code demonstrate what is needed for the invocation of the event listener.The second parameter in the addEventListener() method is the name of a function that
will execute when the event is detected, in this case Clicked().
Read more...

Monday, July 25, 2011

An intresting Jquery application and you can download and modify

0 comments

Click the following link
http://www.dhteumeuleu.com/runscript.php?scr=rotate3D.html
Read more...

How to play a internal sound file in action script 3.0

0 comments
1. First create a flash file named Mysound.fla
2. Impor sound into library. File -Import-Import to Library





4. Select the file you want to play. the selected file go to the Library window.
5.Then right click the sound file you want to play you can see the "Linkage ". Select the Linkage a window will open.

6.Give the class name to "mysound".
7. Tick  the Export  for Action Script then Click Ok button.



7.The flash give a warning window. It will create a class for sound file. Then clik ok.

8.Click the top frame. and Press F9 for the action script window.


9. Then type the following code.
var _mysound:mysound=new mysound();
var _channel:SoundChannel=new SoundChannel();
_channel=_mysound.play();

10.Then press the " Ctrl+Enter".The sound file will play.
Read more...

Monday, July 18, 2011

You want to load and playback progressive download Flash video.

0 comments
The following code constructs a NetConnection object and initializes it for use with progressive download video.This code comes under the flash.net.Netconnection.
var videoConnection:NetConnection = new NetConnection( );
videoConnection.connect(null);
This code constructs a NetStream object
var videoStream:NetStream = new NetStream(videoConnection);
This code constructs a new Video object and then adds it to the display list:
var video:Video = new Video( );
addChild(video);
You can associate a NetStream object with a Video object by using the Video object's attachNetStream( ) method, passing a reference to the NetStream object as a parameter to the method:
video.attachNetStream(videoStream);
The NetStream class defines a play( ) method that loads and starts the Flash video playback. The parameter can be a relative or absolute URL.
videoStream.play("example.flv");
or
videoStream.play("http://www.mysite.com/example.flv");
The full code is :
var videoConnection:NetConnection = new NetConnection( );
videoConnection.connect(null);
var videoStream:NetStream = new NetStream(videoConnection);
var video:Video = new Video( );
addChild(video);
video.attachNetStream(videoStream);
videoStream.play("example.flv");

Read more...

Jquery simple slide panel for designers

0 comments
I think you have probably seen lots of slide panel in websites. where you click on the link it will slide up/down. Many sites it use as menu and some other links.
when you click on the element "slide" it will slideToggle Up/down the element
and then also toggle the css "actv" to the id="slide". The "actv" CSS toggle the background position of the down arrow in css.The code of jquery is give below.

$(document).ready(function(){

$("#slide").click(function(){

$("#display").slideToggle("slow");
$(this).toggleClass("actv");


});


Read more...

Saturday, July 16, 2011

You want to store information in memmory using flash sharedObject

0 comments
Local shared Objecct are to Flash what cookies are to web browsers but more so. some developers because they allow you to store large amounts of data and store and retrieve.This is mainly using for saving "username" and "Passwords".

var example:SharedObject = SharedObject.getLocal( "example" );
The static getLocal( )in shared object are both created and opened for reading.
You want to add data to a SharedObject use the following code.
// Store a username value to the example shared object.
example.data.username = "myname";

You can store several datatypes to the shared object's data property, as follows.
example.data.exampleArray = new Array( "a", "b", "c" );
example.data.exampleDate = new Date();
example.data.exampleObject = { key1: "example", key2: -12, key3: null };
You want to save data in a Shared Object to the client computer.
var flushResult:String = example.flush( );

Read more...

How to load an external image using action script 3.0

0 comments
This is tutorial will help you to how to load an external Image using action script 3.
1. First create a flash document and save Sample.fla.
2. Go to the first frame then type the following code
var img_load:Loader = new Loader();
img_load.load(new URLRequest("myPhoto.jpg"));
addChild(img_load);
3.The "myPhoto" is a image stored where you are saving your flash file.
4.Press "Ctrl+Enter" See the result.


I think this will help you..
Read more...