Be a Supporter!

Help with buttons and Links

  • 258 Views
  • 6 Replies
New Topic Respond to this Topic
NGPulp
NGPulp
  • Member since: Jan. 28, 2011
  • Offline.
Forum Stats
Member
Level 10
Writer
Help with buttons and Links 2011-03-17 21:36:55 Reply

I tried the GetURL command on a button but it dosen't work! I know that the URL is working but what went wrong?!

Skudge
Skudge
  • Member since: Dec. 16, 2010
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Help with buttons and Links 2011-03-17 21:56:39 Reply

Since mind reading is impossible, you should probably post your code and which version of Actionscript you're using.

NGPulp
NGPulp
  • Member since: Jan. 28, 2011
  • Offline.
Forum Stats
Member
Level 10
Writer
Response to Help with buttons and Links 2011-03-18 07:20:09 Reply

onRelease = function() {
getURL("URL" "_self");
};

Version2
Version2
  • Member since: Sep. 24, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help with buttons and Links 2011-03-18 07:29:52 Reply

At 3/18/11 07:20 AM, NGPulp wrote: onRelease = function() {
getURL("URL" "_self");
};

looks like you forgot a comma.

getURL("URL" , "_self");
Gimmick
Gimmick
  • Member since: Aug. 20, 2008
  • Offline.
Forum Stats
Member
Level 27
Programmer
Response to Help with buttons and Links 2011-03-18 08:55:05 Reply

At 3/18/11 07:29 AM, Version2 wrote:
At 3/18/11 07:20 AM, NGPulp wrote: onRelease = function() {
getURL("URL" "_self");
};
looks like you forgot a comma.

getURL("URL" , "_self");

No, he didn't.
It happens to me too, I don't really know how to get past it but just try this:

on(release){
_root.getURL("URL", "_self");
}

Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp
"Sit look rub panda" - Alan Davies

BBS Signature
Version2
Version2
  • Member since: Sep. 24, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help with buttons and Links 2011-03-18 16:40:42 Reply

At 3/18/11 08:55 AM, sanjeev98 wrote: No, he didn't.

Do you need glasses? There isn't a comma between the parameters in the code OP posted. So... yes, he did forget it. And it needs to be there or hes going to get an incorrect number of arguments error. _root, on the other hand, is not necessary to use getURL().

NGpulp: You may want to take a look at this blog post: factornine.wordpress.com/2008/09/10/getu rl-not-working-in-as2/

A relevant quote from the post: "I figured out that when the html and the swf are on separate servers, the getURL must specify "_blank" as the target."

And this is from the actionscript dictionary, as a reminder of what does what:
"_self" specifies the current frame in the current window.
"_blank" specifies a new window.
"_parent" specifies the parent of the current frame.
"_top" specifies the top-level frame in the current window.

Gimmick
Gimmick
  • Member since: Aug. 20, 2008
  • Offline.
Forum Stats
Member
Level 27
Programmer
Response to Help with buttons and Links 2011-03-19 04:10:08 Reply

At 3/18/11 04:40 PM, Version2 wrote:
At 3/18/11 08:55 AM, sanjeev98 wrote: No, he didn't.
Do you need glasses?

I wear some already.

There isn't a comma between the parameters in the code OP posted. So... yes, he did forget it. And it needs to be there or hes going to get an incorrect number of arguments error. _root, on the other hand, is not necessary to use getURL().

Oh shoot, I thought you were talking about a semicolon, sorry ^_^


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp
"Sit look rub panda" - Alan Davies

BBS Signature