Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-17-2009, 03:47 AM   #1
godbar
Registered User
 
Join Date: Oct 2009
Posts: 2
Default 1084 syntax error expecting rightparen before semicolon.

Hi,

I'm new to AS3 so please be gentle with me.

This is what I'm trying to do. I need to call some javascript when a button in my flash movie is clicked on. This javascript in turn launches a flash audio player on the page.

This is the code I'm obviously getting wrong.

button.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("javascript:Play('120','arabian_breaks_ v1_demo_mix.mp3')");
}

I've tried obvious stuff like inserting a } before the semicolon, this just gives more errors.

I know I'm fairly close because if I change the code to this:

var r:URLRequest = new URLRequest("javascript:Play('120','arabian_breaks_ v1_demo_mix.mp3')");
navigateToURL(r,'_self');

the player launches as soon as my flash movie has loaded up, but obviously I'd rather the player was launched only when I click on the desired button

Can someone please put me out of my misery?

Cheers
Godbar
godbar is offline   Reply With Quote
Old 10-17-2009, 04:05 AM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

You were missing a closing ')' at the end of the navigateToURL() line...
ActionScript Code:
// button.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); function mouseDownHandler(event:MouseEvent):void {     navigateToURL(new URLRequest("javascript:Play('120','arabian_breaks_ v1_demo_mix.mp3')")); }
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 10-17-2009, 06:08 AM   #3
godbar
Registered User
 
Join Date: Oct 2009
Posts: 2
Default

Ok, thanks. I just had a quick try with your suggestion but but all it does is open a blank window: so I must have misunderstood.

I also tried this and got no errors but all it does is open a blank window:

button.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("javascript:Play('120','arabian_breaks_ v1_demo_mix.mp3')")
)}

So thats two methods that appear to have clean code but fail to launch the js. Would it help if i provided a working text link so you can see that launch code?

Last edited by godbar; 10-17-2009 at 06:41 AM.
godbar is offline   Reply With Quote
Old 11-25-2009, 04:44 AM   #4
dapidmini
Registered User
 
Join Date: Nov 2009
Posts: 5
Default

Hi, I'm new to this forum and AS3 itself.

I have a problem with rightparen too so I thought I should post it here rather than making new threads.. the error says "expecting rightparen before end". here's the code:
ActionScript Code:
function timerListener (e:TimerEvent):void{       if (gerak.x>20 and gerak.y==380) {gerak.x-=40;}       if (gerak.x==20 and gerak.y>20) {gerak.y-=40;}       if (gerak.x<380 and gerak.y==20) {gerak.x+=40;}       if (gerak.x==380 and gerak.y<380) {gerak.y+=40;}     }

can someone help me with this? this assignment is supposed to be completed by tomorrow... thanks in advance.
dapidmini is offline   Reply With Quote
Old 11-25-2009, 02:41 PM   #5
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

Change 'and' to '&&' and it should compile fine... I believe 'and' or 'or' are deprecated in AS3...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


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 03:53 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, 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.