Solved

Easy AS3 Question Regarding For Loop

Posted on 2011-09-28
2
305 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 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

724 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