?
Solved

Easy AS3 Question Regarding For Loop

Posted on 2011-09-28
2
Medium Priority
?
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.
Suggested Courses

770 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