x


how to make an web link?

hello

I need some help, For my game i need a menu button so when pressed it opens a web browser to my website but I dont know how to do it

Please can someone help

Thanks

more ▼

asked Apr 20 '12 at 11:08 AM

dalekandjedi gravatar image

dalekandjedi
30 3 5 12

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

hi dalekandjedi,

here you didn't specify that which type of build you're trying with, if it's webplayer build, hope this link will help you.

http://answers.unity3d.com/questions/50138/open-link-in-new-tab-from-webplayer-hosted-on-any.html

void OnGUI () 
{   
    if(GUILayout.Button("Google"))
    {
        Application.ExternalEval("window.open('http://www.google.com', '_blank');");
    }
}
more ▼

answered Apr 20 '12 at 11:45 AM

sriram90 gravatar image

sriram90
460 33 37 47

it dosent work :( i would like it so it works on a 3d text and the player would be the web player

Apr 20 '12 at 04:23 PM dalekandjedi

if you dont want to use GUI, you may take 3d text on a gameobject. make it click by OnMouseDown() method or some otherscript. inside of that you may give that Application.ExternalEval(). try it ...

Apr 25 '12 at 05:21 AM sriram90
(comments are locked)
10|3000 characters needed characters left

Is there a way to replace the 'http://' content with a variable and still allow the ExternalEval to work properly???

eg.

public var linkURL = "http://www.google.com";

Application.ExternalEval("window.open( linkURL, '_blank');"); ... does not work

So far I've been slightly unsucessful in overcoming this. Anyone know how to solve this issue???

more ▼

answered Mar 06 at 02:46 PM

DreadKnight007 gravatar image

DreadKnight007
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x211
x126
x73

asked: Apr 20 '12 at 11:08 AM

Seen: 3674 times

Last Updated: Mar 06 at 02:46 PM