Solved

Easy AS3 Question Regarding For Loop

Posted on 2011-09-28
2
263 Views
Last Modified: 2012-05-12
I have a movie clip instance in frame one named "s" and the following code in the same frame:

for (int i = 0; i < 10; i++) {
	s.x += 5;
}

Open in new window


I want to move the instance of "s" five pixels to the right every time the loop is done; basically trying to animate it as a simple intro to AS3.

I get an error that says "Scene 1, Layer 'Layer 1', Frame 1, Line 1      1084: Syntax error: expecting semicolon before i."
0
Comment
Question by:EMB01
2 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 36718671
Wrong decalration it must be

for (var i:uint = 0; i < 10; i++) {
      s.x += 5;
}
0
 
LVL 14

Author Closing Comment

by:EMB01
ID: 36718804
Great, thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
flash cs6 4 334
playing flash video on kiosk at startup 6 393
Firefox fullscreen video lags 4 147
Download Adobe Flash Player 6 55
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now