Blogroll

This blog is created for education about engineering students.All the engineering students are get free downloadable books here. not only books and also different software also available here

Assigning Actions to an Object


Imlement the program in ActionScript 2.0 
for applying actions to an objects
Procedure:
Step1: start--> programs--> Macromedia-->Flash 8
Step 2: Open a new Action script file
Step 3: Save the Action script file with “.as” file extension
Step 4: Write the source code for assigning actions to an object
Step 5: check the errors by clicking the symbol “√“(tick mark)
Step 6: Open the flash document
Step 7: write the actions under the control of button in Action Frames
Step 8: check the errors by clicking the symbol “√“(tick mark)
Step 9: save the document with “.fla” extension
Step 10: Run the above procedure by clicking “ctrl+enter”
 
Source Code for Action Script

1.student.as
Class student
{
  public var sname:String;
  public var snumber:Number;
public var sub1:Number;
public var sub2:Number;
public function student(sna:String,sno:Number,m1:Number,m2:Number)
{
Sname=sna;
Snumber=sno;
Sub1=m1;
Sub2=m2;
}
}


2.inherits.as
 
class inherits extends student
{
Public function inherits (a:String, b:Number, c:Number,d:Number)
{
Super(a,b,c,d);
}
Public function display():Void
{
trace(sname);
trace(snumber);
trace(sub1);
trace(sub2);
}
}



Source code for Flash Document


3.onclick.fla

on(click)
{
Var s:inherits=new inherits(“cvchiru”,1204,76,82);
s.display();
}




No comments:

Post a Comment

Total Pageviews