-
1. Re: Click tag
Ned Murphy May 24, 2010 5:45 AM (in response to Smitch1581)The first code you show is AS2, the second code you show is AS3. The two cannot work in the same file, and your Publish Settings define which applies.
The first code you show gets attached to a button symbol, it is not placed oin the timeline. To place the code on the button you select the button and place the code in the actions window.
-
2. Re: Click tag
Smitch1581 May 24, 2010 8:56 AM (in response to Ned Murphy)Hi ned thanx for the reply.
What would you suggest i do? Change the publishing settings to support AS2 or rewrite the code for AS3?
I tried changing the settings to AS2 but that didn't work, looks like i need more code to assign the button instance name and event and not sure how to do that yet!.
I'm still very new to this but 4t i was getting the hang of AS3! Is it easier to change the code to work in AS3 and can you help me on that please?
Thankyou very much for your help so far
-
3. Re: Click tag
Ned Murphy May 24, 2010 9:08 AM (in response to Smitch1581)The AS2 code you showed requires no instance name since it gets applied directly to the button. As long as you have a variable named "clickTag" sitting in the main timeline, that code should work. But for the record, placing code on objects is generally frowned upon and was discontinued in AS3.
You can go the instance name route in AS2, but the code is fairly similar and doesn't get as wordy as AS3... for instance, using that button you named, the timeline code in AS2 would be...
Clicky.onRlelease = function(){
getURL(_root.clicktag, _root.target);
}
AS3 doesn't allow placing code on objects, thus the need for the instance name. THe button code you showed for the AS3 end of things appears to be fine.
In AS3, if you want to reference something in the root timeline you normally need to add some additional info they don't mention in the help docs... MovieClip(root).clickTag
-
4. Re: Click tag
Smitch1581 May 26, 2010 1:18 PM (in response to Ned Murphy)Thats perfect, thank you very much! That is greatly appreciated as i produced my first piece of Flash magic but couldn't get that link to work and was getting very frustrated!
Thank you very much for your clear answers as i now know a bit more about AS2 than i did and have some background info on what the publish settings are all about.
Thank you again
-


