Linkage Tutorial.

5 posts

Flag Post

As it is a complex topic, linking to different mediums has been a difficult subject to learn in Flash. Fear not, as for the benefit of you, as well as a reference for me, I have written our savior.

First of all, create a button. This is simply done via selecting a drawn object such as a square with the words ‘Email me’ and pressing F8. Then, a popup is brought up with different options. Select the circle which has the word ‘button’ next to it and name it whatever you wish. I usually choose something memorable or vaguely obvious for edits later. Proceed to press F9 and typing the following code.

on(release){
    getURL("mailto:deltaforce123@gmail.com")
}

Wait, that is my email! I don’t want to take credit for your production. So lets figure this out. The On(release){ mechanic works as a handle for the script, and the getURL gets the action. The } at the end holds it together, so it must be my email you must change. Assume that your email is SeanBeggedMeForYe@rsForThisTut.com. Then, highlight my email, erase it completely, and paste SeanBeggedMeForYe@rsForThisTut.com. Easy enough? Want the user to be able to IM you also? Does Aim sound like a good message client? Good then, I have just the script for you. It begins and ends just as the prior one, but instead of mailto it reads

aim:goim?screenname=

and this is then followed by the screename promptly. End the parenthesis and cup the script. However, if you wish to add a message, in addition add

&message=Message

Change message to whatever you want the IM to read. Instead of spaces use addition signs. Your script for instant messaging should look like this.

on(release){
  getURL(" aim:goim?screenname=ForceDelta8&message=Hello")
}

Except my username and message being replaced with yours. Enjoy, and I hope you learned something and didn’t just copypasta.

 
Flag Post

Autoformat it, because something is making the script go horizantally.

 
Flag Post

Thanks Cema!

I added the code tags for you. See the sticky at the top of this forums if you want to know how to post code in the forums.

 
Flag Post

It’s probably worth noting that using release instead of press is very important if you’re opening up a new window, because press will get blocked by most pop-up blockers. I see that pretty often in games by people who probably should know better.

Here’s an example of URL linking:
<pre> on(release) { getURL("http://example.com/", "_blank"); } </pre>

The target "_blank" tells the browser to always open in a new window, which is usually the desired behavior for games.

 
Flag Post

Yeah, thanks for clarifing. Most browsers detect the signal being sent as an unknown source, and with on(release){ it knows that it is coming from a trustworthy thing, not a malicious ‘click this’ type.