Skip to main content
Inspiring
June 17, 2013
Answered

What's wrong with my syntax?

  • June 17, 2013
  • 1 reply
  • 1071 views

I'm getting an error with this. What's wrong with my syntax?

Error: Scene 1, Layer 'actions', Frame 1, Line 21 1084: Syntax error: expecting rightparen before semicolon.

// Line 21

holder.load(new URLRequest("Interactive_StrategyMap.swf" + "?random=" + Math.random();));

This topic has been closed for replies.
Correct answer Ned Murphy

You need to get rid of that semi-colon siiting just after Math.random()   Leave the one at the end only.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
June 17, 2013

You need to get rid of that semi-colon siiting just after Math.random()   Leave the one at the end only.

Inspiring
June 17, 2013

Thanks Ned,

That took care of that error but I'm still getting an undefined error. Do you know why this URLRequest is not loading the .swf? Lines 21 and 22

//THIS IS THE PRELOADER CONTAINER THAT LOADS THE INTERACTIVE
//STRATEGY MAP (Interactive_StrategyMap.swf).

// CREATE A NEW LOADER OBJECT TO HOLD THE LOADED CONTENT
var holder:Loader = new Loader();
addChild(holder);

// CREATE EVENT HANDLERS TO TRACK THE LOADING PROGRESS
// AND TO TRACK THE COMPLETION OF THE LOADED CONTENT
holder.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoading);
holder.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onComplete(e:Event):void {
this.loadingClip.visible = false;
}
function onLoading(e:ProgressEvent):void {
var pcent:Number = e.target.bytesLoaded / e.target.bytesTotal * 100;
loadingClip.loadingText.text = int(pcent) + "%";
}

// LOAD THE EXTERNAL CONTENT
holder.load(new URLRequest("Interactive_StrategyMap.swf" + "?random=" + Math.random()));
trace(holder.load(new URLRequest("Interactive_StrategyMap.swf" + "?random=" + Math.random())));

Ned Murphy
Legend
June 17, 2013

You should include the error message and you should identify which lines are 21 and 22 if you think they are relevant.