Results 1 to 4 of 4

Thread: Need help creating a linked button in flash

  1. #1
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help creating a linked button in flash

    I have created a button in Flash CS3 Proffessional, the button works fine but I keep getting errors when I try to add the getURL, I cannot find the appropriate place to have flash link to the getURL so I have been typing in the actions panel the following...

    instance_cross.onRelease = function() {
    getURL("http://www.ednadesigns.com/crosses.htm");
    }

    I also tried in the fisrt layer, first frame

    on(release) {
    getURL("site.com");
    }

    I think I am just not puttin it in the right place, or using the wrong language for Flash CS3

    Anyway any help would be greatly appreciated, I cant believe it is so difficult to link a button in Flash, but I guess once I know how it wont be ....thanks and happy sunday to all. Traci

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hi Traci..

    That is the right code if you're using ActionScript 2.0.

    Flash CS3 has the capability of compiling in both AS 2.0 and AS 3.0.

    Make sure that you're in an AS 2.0 project and within the publish settings, make sure you're publishing to Flash 8 or lower.

  3. #3
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i received and error saying...
    scene 1, layer 1, frame 1, line 1
    mouse events are permitted only for button instances

    perhaps I have put the action scrpt in the wrong place? thank you so much for your help. Traci

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Ahh, I just reread your first post. I see what you're doing.

    The following should go in the actions panel on whatever frame that the button. Again, on the timeline not on the actual movieclip.

    Code:
    instance_cross.onRelease = function() {
    getURL("http://www.ednadesigns.com/crosses.htm");
    }

    If you want to add the action on the actual movieclip, click on the movieclip then open the actions panel and add this:

    Code:
    on(release) {
    getURL("site.com");
    }
    I don't recommend the second way because it gets really difficult to troubleshoot should something not work. If all AS is one place, it makes it easier. BOTH will work though and do the same thing

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •