Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Basic getUrl action in CS3

This is not working like it used to!

7:18 pm on Jul 30, 2008 (gmt 0)

5+ Year Member

For crying out load! I am trying to perform a simple Flash action and it's not working. I have done this a hundred times before but the upgrade is killing me.

I have a little Flash movie. One scene. It's got a bunch of symbols and movie objects in it. I thought I would make top layer, put a big blue box over it, tune the Alpha down to 0, convert it to a symbol and add the following Actionscript:


But no! I get this annoying little message:

"Current Selection cannot have actions applied to it."

I get this even when I set the Actionscripting to 1.0 & 2.0

Does anyone know a simple way to add a link to a small Flash banner using CS3?

Thank you.

7:44 pm on Jul 30, 2008 (gmt 0)

5+ Year Member

I think you have to click on the object then go up to the time line add new layer and call it actions (preferred) then add the code there and see if it works.
1:31 pm on Jul 31, 2008 (gmt 0)

5+ Year Member

Great, thank you. That works half way.

It works perfectly in Firefox and Safari. However, in IE and Opera, I get the hand pointer but when I click, it doesn't take me to my page.

What the hay! I need some help.


4:36 pm on Jul 31, 2008 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

When you convert the transparent box to a symbol, make sure it's a button symbol, not a movie symbol. Also make sure "Export for Action Script" is checked.

- Select the button and give it an instance name (myButton).

- Select the FIRST FRAME of the timeline, not the button.

- Paste the following:

myButton.onRelease = function() {

If it doesn't work, use a full URL, as above.

You can also apply similar methods to a symbol that is a movie, as opposed to a button.

However, in IE and Opera, ....

This should mean those plugins are too old and don't support AS3. You can look into that, or just re-publish the SWF and set your publish settings to AS 2.0 as this function is compatible with all older versions. This approach won't work if other parts of your Flash use AS 3.0 programming.

7:31 pm on Jul 31, 2008 (gmt 0)

5+ Year Member

Ok. I have take back some of what I said before. It actually dose not work in Firefox and Safari either. It doesn't work in any of them. It only worked before because in an act of desperation, I wrapped the object tag in an <a> tag. Desperate times. Could the object tags be doing something? This is an old page that I am trying to add something too.

Nonetheless, I am also getting these errors when I publish from Flash:


1119: Access of possibly undefined property onRelease through a reference with static type Class.


myButton.onRelease = function() {


1180: Call to a possibly undefined method getURL.



What the hay. I used the code you gave me Rocknbil and I saved the symbol as a Button with "Export for Action Script". I left the other boxes unchecked. I then clicked on the first frame and added the code:

myButton.onRelease = function() {

I also checked by browsers and my Flash player and everything is up to date.

What is happening?! :(

P.S. Can anyone recommend a good book for Flash CS3 and Actionscript 3.0?

2:38 am on Aug 1, 2008 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

The best book is right there on the help menu in Flash. :-)

Hard to say what is happening. Start with basics:

1. open new file. You should be able to do AS2 or 3.

2. Draw a box on the stage.

3. Select box, select convert to symbol, name it myButton, check Export for ActionScript, make sure the behavior is Button, not movie.

4. With the symbol selected, go to the properties pane and name this instance myButton. It's probably bad practice to name the instance and the symbol the same, but it will work. What's important is that the instance is named myButton.

5. Paste the code above in frame 1 of the movie.

Run the program, you don't even have to save it. There is no way this won't work. :-)

When you figure out why this one works and your live one doesn't, problem solved!

1:57 pm on Aug 1, 2008 (gmt 0)

5+ Year Member

Rocknbil! That was a great idea. I did just what you said. I opened 2 new files. One as an AS2 and one as an AS3. I put a blue box into each one and then followed your instruction to the letter. The funniest thing happened. The AS2 file worked perfectly and the AS3 file would not work (link) at all. The files were exactly the same except one was AS2 and one was AS3.

With that knowledge, I downgraded my movie to a Flash 8 file and it worked. At least I can get something online. I still want to know though why the AS3 is not working for me. I wonder if it has something to do with this.

When I convert the blue box to a symbol in AS3, I get this warning box: "A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export."

Any ideas?

5:34 pm on Aug 1, 2008 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Well, that's different, and I stand corrected - getURL is deprecated in 3.0 for a more robust set of methods. :-) If you select only the AS3 manual in help for getURL, you will see a section for ActionScript 2.0 migration. It's done a little differently. A modified example from the help files that will work for "myButton:"

function gotoAuthorPage(event:MouseEvent):void
var targetURL:URLRequest = new URLRequest("http://google.com/");

myButton.addEventListener(MouseEvent.CLICK, gotoAuthorPage);


Featured Threads

Hot Threads This Week

Hot Threads This Month