Solved

Easy AS3 Question Regarding For Loop

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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.

696 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