Wednesday, January 16, 2008

Flash Tips - Using Objects - To get Date

Hi
This is about getting date dynamically and displaying on the swf using objects.

Create a Dynamic Text Field on a key frame
Give it an instance name
Open the actions panel for that keyframe where you kept the dynamic field.Type in the below code:
var myDate_date:Date;
myDate_date = new Date();
myTextField_txt.text = myDate_date.getDate();

Publish it and you will get the today's date on the swf.

Regards,
Muthaiah Thiagarajan
http://www.fmass.in/

Using Objects - To get Date

Create a Dynamic

var myDate_date:Date;

myDate_date = new Date();

myTextField_txt.text = myDate_date.getDate();

Tuesday, January 15, 2008

Flash Tips - Drawing with Pointer on the stage

Hi,

It's a simple technique to create a pencil tool on the stage to draw live, on the swf file in the browser.

Create a blank .fla file
Select the first key frame of layer 1 on the timeline
Press F9 key, You will get the action layer

Paste this code on the Actions pane:

_root.onMouseMove = function()
{
_root.lineStyle(1, 0xFF0000, 100);
_root.lineTo(_root._xmouse, _root._ymouse);
updateAfterEvent();
};


Publish the file as swf and html.
View it on the browser.

Regards,
Muthaiah Thiagarajan

http://www.fmass.in/