Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-28-2012, 01:17 AM   #1
Registered User
Join Date: May 2011
Posts: 42
Default Expecting semicolon before leftbracket?

ActionScript Code:
var coinCollection[i]:MovieClip = new coinDrop();

It says its expecting semicolon before leftbracket on this line. Ideas?
macdonjo is offline   Reply With Quote
Old 04-28-2012, 07:39 AM   #2
Holosuit User
wvxvw's Avatar
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,669
Send a message via ICQ to wvxvw

The variable identifier may not contain square brackers. I.e.
ActionScript Code:
var coinCollection[// here's the error
If you want the objects in coinCollection to be of type MovieClip:
ActionScript Code:
var coinCollection:Vector.<MovieClip> = new <MovieClip>[];
Or use array and cast them later to the proper type:
ActionScript Code:
var coinCollection:Array = []; (coinCollection[i] as MovieClip).gotoAndStop(i);
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:06 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.