Code.GeekInterview.com
 
Code Samples Flash
 

Generation of Duplicate Image


Code ResourceAuthor: lavanyarani  

Difficulty Level: Intermediate

Published: 10th Nov 2009   Read: 2317 times  

Filed in: Flash
Add Comment


 

 

Sponsored Links


 

 
This code generates duplicate images based on the number you provide in the text field.
 


Sample Code
  1. Step-1: Create an input text(box) and give the name “n” to it in the  
  2.              properties panel.
  3. Step-2: Create a button with the name on it as “click”.
  4. Step-3: Create an image and convert it into movie click and give name as  
  5.              “face” in the properties panel.
  6. Step-4: Select the button and open the action panel and write the        
  7.              following code in the script pane.
  8.  
  9.  
  10. on (release) {
  11.         count=1;
  12.         while(count<=Number(n.text))
  13.         {
  14.         duplicateMovieClip("_root.face", "face"+count, count);
  15.         setProperty("_root.face", _x, 3+count*70);
  16.         setProperty("_root.face", _y, 300+count*1);
  17.         count++;
  18.         }
  19. }
  20.  
  21. Step-5: Press ctrl+enter to test the movie and enter any number in the
  22.              input box and click on the button then the duplicate images will  
  23.              be generated
  24.  
  25.  
Copyright GeekInterview.com


Next Article: Implement Custom Sort


 

Latest Code Samples

 

Popular Code Samples

 

Related Code Samples

 

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    



Popular Coders

# Coder NameHits
1. lavanyarani35483

Active Coders

# Coder NameCodes
1. lavanyarani13

Refined Tags