getURL script error

  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Joined: Sep 18, 2004
  • Posts: 15
  • Loc: UK
  • Status: Offline

Post October 16th, 2004, 1:02 pm

Hi,

I'm trying to get a button to open a website in a new window, the code i'm using is:

on (release) {
getURL("http://www.website.com", "_blank");

}

But when I check the syntax I get the following error:

**Error** Scene=Scene 1, layer=weblink, frame=1:Line 2: Wrong number of parameters; getURL requires between 1 and 3.
getURL();

Total ActionScript Errors: 1 Reported Errors: 1

Any idea why I get this? I'm using Flash MX Pro 2004
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 16th, 2004, 1:02 pm

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post October 16th, 2004, 6:20 pm

Well that is odd.... your syntax is 100% correct.... unless the syntax for getURL changed with 2k4 Pro, which I doubt.
  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Joined: Sep 18, 2004
  • Posts: 15
  • Loc: UK
  • Status: Offline

Post October 17th, 2004, 4:02 am

Ahh found the problem... I seemed to of missed the ", from the code using getURL("http://www.website.com"_blank");

How stupid do I now feel
:oops:
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 17th, 2004, 4:24 am

I bet next time you see,
Code: [ Select ]
Wrong number of parameters; FUNCTION requires between # and #.

You'll think to check your commas, I know I will :) I looked at this earlier :scratchhead:
Strong with this one, the sudo is.
  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Joined: Sep 18, 2004
  • Posts: 15
  • Loc: UK
  • Status: Offline

Post October 17th, 2004, 9:00 am

Its times like this I think how stupid are some of these programs not to realise what it is i'm trying to achieve and for a small error like " to cause so much stress is scary :lol:

Less "error reports" and more "problem solving" would be nice :D
  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Joined: Sep 18, 2004
  • Posts: 15
  • Loc: UK
  • Status: Offline

Post October 17th, 2004, 9:19 am

Didn't want to spam the board with topics so I will ask here...

I'll soon be uploading a flash site to the web and published the pages as both .swf and HTML files.... my main layout has 3 published html files...1 being main (which is the page name) 2nd is main_alternate and 3rd main_content ... do i upload all 3 of these html files?

Also as im uploading them as html do I need to change the syntax for my template sections to

on (release) {
loadMovieNum("page.html", 1);
}

and not

on (release) {
loadMovieNum("page.swf", 1);
}

I'm new to flash so apologise for the noobie questions :lol:
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 17th, 2004, 9:52 am

If you're navigating from each movie with "getURL()" then you will need to upload all 3 SWFs, & all 3 HTML pages.

If your using loadMovieNum() or loadMovie() then you will need all 3 SWFs, & the 1 HTML page that embeds the SWF that is loading the other two.

Someone correct me if i'm wrong, but I don't think .html is a valid extension for loadMovieNum() or loadMovie(). I'm almost positive the only valid extensions are .swf & .jpg I've yet to use 2004 so things may have changed on me :oops:
Strong with this one, the sudo is.
  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Joined: Sep 18, 2004
  • Posts: 15
  • Loc: UK
  • Status: Offline

Post October 17th, 2004, 10:12 am

No problem thanks :D

At this rate i'll give up and learn Flash before I dive in again :lol:
  • j4ymf
  • Born
  • Born
  • No Avatar
  • Joined: Oct 30, 2004
  • Posts: 3
  • Status: Offline

Post October 30th, 2004, 10:41 am

can anyone tell me why this dosent work?


on (release) {getURL(http://www.glynsart4life.greater-peterb ... upload.php);

}


im using 2004

thanks jason
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 30th, 2004, 11:11 am

j4ymf wrote:
can anyone tell me why this dosent work?


on (release) {getURL(http://www.glynsart4life.greater-peterb ... upload.php);

}


im using 2004

thanks jason

You need to wrap the address in " quotes " & add a target window as well,
Quote:
on(release){
getURL("www.glynsart4life.greater-peterborough.com/upload.php", "_blank");
}

Whenever a paramater of a method isn't a variable, it needs thoose quotes. (or theese ' single ')
Strong with this one, the sudo is.
  • j4ymf
  • Born
  • Born
  • No Avatar
  • Joined: Oct 30, 2004
  • Posts: 3
  • Status: Offline

Post October 30th, 2004, 11:43 am

thankyou are a star

all i needed to do was

on(release){
getURL("http://www.glynsart4life.greater-peterborough.com/upload.php");
}

an you tell ne what this bit does


, "_blank");
}


thanks jason
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 30th, 2004, 11:54 am

"_blank" is suposed to be required (perhaps they added a default clause in 2004 ?.)
It's the window or frame name to load the URL into. _blank is a new window, "myWindow" would either make a new window & name it "myWindow" or it would target a frame or window named "myWindow".

Even if it's not required in 2004 anymore it's still good to know.
Strong with this one, the sudo is.
  • j4ymf
  • Born
  • Born
  • No Avatar
  • Joined: Oct 30, 2004
  • Posts: 3
  • Status: Offline

Post October 30th, 2004, 12:00 pm

thankyou anyway for your time
  • liltman
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Sep 03, 2004
  • Posts: 178
  • Loc: England, Hartlepool, UK
  • Status: Offline

Post October 30th, 2004, 1:45 pm

hi i am new to flash and i thought making a button was easy until i had to link it :roll:

when i try to link it i get this message:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
getURL("http://www.google.com");

Total ActionScript Errors: 1 Reported Errors: 1


i have no idea what this means as i am a noob,

can anyone help me please, thanx in advance
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 30th, 2004, 2:33 pm

liltman, you have to wrap that inside,
Code: [ Select ]
on(event){
  getURL("url.ext", "target");
}
  1. on(event){
  2.   getURL("url.ext", "target");
  3. }

Where "event" will be "release" , "press" , ect.. When you have it on the button itself.

If you define it on a timeline it will look like,
Code: [ Select ]
buttonName.onPress = function(){
 getURL("url.ext", "target");
}
  1. buttonName.onPress = function(){
  2.  getURL("url.ext", "target");
  3. }


j4ymf wrote:
thankyou anyway for your time
You'll learn :wink:
Strong with this one, the sudo is.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 30th, 2004, 2:33 pm

Post Information

  • Total Posts in this topic: 22 posts
  • Users browsing this forum: No registered users and 60 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.