getURL script error

  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: UK

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

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
  • Posts: 15
  • Loc: UK

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

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:
  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: UK

Post 3+ Months Ago

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
  • Posts: 15
  • Loc: UK

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

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:
  • DemonPixels
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: UK

Post 3+ Months Ago

No problem thanks :D

At this rate i'll give up and learn Flash before I dive in again :lol:
  • j4ymf
  • Born
  • Born
  • j4ymf
  • Posts: 3

Post 3+ Months Ago

can anyone tell me why this dosent work?


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

}


im using 2004

thanks jason
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

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 ')
  • j4ymf
  • Born
  • Born
  • j4ymf
  • Posts: 3

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

"_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.
  • j4ymf
  • Born
  • Born
  • j4ymf
  • Posts: 3

Post 3+ Months Ago

thankyou anyway for your time
  • liltman
  • Graduate
  • Graduate
  • liltman
  • Posts: 178
  • Loc: England, Hartlepool, UK

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

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:
  • suzie
  • Guru
  • Guru
  • User avatar
  • Posts: 1134
  • Loc: England

Post 3+ Months Ago

Can I jump in here please with a question...?
I moved my board now I need to do a re-direct for the members how do I get the new link to point to the new board address...?
I have an index. htm with a text link inside which does go to the board took out the old index.htm and put in the new one but it still goes to the old board - not the new one.
To all intents and purposes the board is now at the new address its been transferred by a friend, can I now delete old board (folder named forum)at old host now I have seen the board at a new address..?
This is all new to me so I am unsure what can be deleted.
Also I need to add this code how do I do this atno explained before but I would never find his instructions now lol

Code: [ Select ]
<html>
<head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=http://www.swishmagic.com/forum/index.php?act=portal">
<title>You shouldn't be here</title>
</head>
<body>
You are in the wrong place. The webpage is <a href="http://www.swishmagic.com/forum/index.php?act=portal">HERE</a> . If you are not automatically redirected click the link.
</body>
</html>
  1. <html>
  2. <head>
  3. <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://www.swishmagic.com/forum/index.php?act=portal">
  4. <title>You shouldn't be here</title>
  5. </head>
  6. <body>
  7. You are in the wrong place. The webpage is <a href="http://www.swishmagic.com/forum/index.php?act=portal">HERE</a> . If you are not automatically redirected click the link.
  8. </body>
  9. </html>


Thanks for any help!
:)
  • liltman
  • Graduate
  • Graduate
  • liltman
  • Posts: 178
  • Loc: England, Hartlepool, UK

Post 3+ Months Ago

ok that was weird, at home i used flash mx 2004 to make a button with a link and it got the error further up the page, but i made a button using flash mx (unsure what version, probs 2002 or 2003) and it worked fine, i didnt use a tutorial in college as its all in my head now after repeatingly trying to do the button at home in my version of flash mx, grrr i was really peed off at how easy it is to do but it wouldnt let me in flash mx 2004, was something wrong with the code lol but i know how to do it now :D
  • Dmoto
  • Born
  • Born
  • Dmoto
  • Posts: 1

Post 3+ Months Ago

Quick one for you guys hopefully. Trying to get code to open link in new window. here is code:

on (press) {getURL ("http://www.website.com/somethin.pdf", "_blank");}

this is on a movieclip symbol.

as far as I can tell this is the correct syntax. It does link to the page but uses current window.

How can I force it to open in new window?

....some much time for such an simple piece of code... blaaaahhh!!

Thanks in advance.
  • wegener
  • Born
  • Born
  • wegener
  • Posts: 1

Post 3+ Months Ago

take off the " " around _blank

should be
on (release) {

getURL("site", _blank);

}
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

No it shouldn't. The quotes define a string value to be passed, without strings it's looking for the value of a variable.

http://www.macromedia.com/support/flash ... ry377.html


And now that I see this again... I believe the issue is the fact that it's a PDF. It's an issue with Flash with opening file extensions with their default application... and file extensions that require this don't properly use the _blank attribute. I'm guessing Macromedia did this to prevent blank windows from opening up when such file extensions that require special applications are launched.
  • kidscrface
  • Born
  • Born
  • kidscrface
  • Posts: 1

Post 3+ Months Ago

Hello

Just like everyone else I am new To Flash Mx I have been trying to get my main page buttons to link to the other flash pages i have for my site. The site has a flash navigation header with the site as well. Everytime you click on a button and it has to load a different page the naviagation header is suppose to load as well but I have no idea how to do this. I know that on a button you can link it to the other pages with this command, on (release) {geturl("http://www.domain.com/whatever.html", "_Parent");} , but I do not know how to get the main header to load along with it. Can someone help me with this. Thanks any help is appreciated
  • cyprian
  • Born
  • Born
  • cyprian
  • Posts: 1

Post 3+ Months Ago

Hi Guys, I have a button/script issue:
I have a button with a basic on(release)getURL script in the button layer. main layers stop (done that by stop(); in the last keyframe in a layer under the button layer) after appearing to create the background and other movieclips loop. However the stop frame in the main timeline makes this button stop/inactive when it reaches the stop frame (the button has to be the first layer in timeline; webhost requirements:/).

could you help me to make it work so that the movie will stop however the button will remain active infinitive while the movieclips loop?

there is probably easy solution however I'm struggling to accomplish this and I suspect it's due to I'm an AS noob therefore any help would be appreciated!

Post Information

  • Total Posts in this topic: 22 posts
  • Users browsing this forum: No registered users and 9 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
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.