Results 1 to 7 of 7

Thread: Going to URL after clicking frame

  1. #1
    Join Date
    Aug 2006
    Location
    Ireland
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Going to URL after clicking frame

    Hi.

    Im just starting with Flash, and would like to have it so that if the user clicks on a certain frame, then its bring them to another website. I presume this can be done in ActionScript. If it can, can someone please tell me how.

    Thanks.

  2. #2
    Join Date
    Aug 2006
    Location
    North Las Vegas, Nevada
    Posts
    24
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    depending on when you want that action to kick in, heres two ways of going about it that i know of

    Code:
    on (release) {
    	getURL("http://s10.invisionfree.com/Jahs_vision_of_Love/index.php?act=idx",diff);
    }
    or

    Code:
    on (press) {
    	getURL("http://s10.invisionfree.com/Jahs_vision_of_Love/index.php?act=idx",diff);
    }
    the difference between them is the first code waits until the user releases the left mouse button and the 2nd one waits until theres any click at all

  3. #3
    Join Date
    Aug 2006
    Location
    Ireland
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for replying. When I try to export the movie, I get this:

    Code:
    **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Mouse events are permitted only for button instances
         on (press) {
    
    **Error** Scene=Scene 1, layer=Layer 1, frame=40:Line 1: Mouse events are permitted only for button instances
         on (press) {
    
    **Error** Scene=Scene 1, layer=Layer 1, frame=80:Line 1: Mouse events are permitted only for button instances
         on (press) {
    
    **Error** Scene=Scene 1, layer=Layer 1, frame=120:Line 1: Mouse events are permitted only for button instances
         on (press) {
    
    **Error** Scene=Scene 1, layer=Layer 1, frame=160:Line 1: Mouse events are permitted only for button instances
         on (press) {
    
    Total ActionScript Errors: 5 	 Reported Errors: 5
    Like I said, I'm only strating with Flash, and have no clue what this means. Any help would be great.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You need to convert your graphic/movie clip object to a "button".

    why? flash is stupid. I really don't understand why they don't merge them. BUT... that's what you've got to work with.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Aug 2006
    Location
    Ireland
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much. Now... how do I do that? lol.

    I bought a book, and Im working through it, but it asnt covered this yet.

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It's not too hard to find. I don't have flash open at the moment.
    Right click it, convert to button. Or somehting like that. In a menu?
    Just look around... should be there.
    I think it might be in the properties window too.
    Might depend on your version of flash, too.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    If you have version 7 (MX2004) or version 8, MCs can have button attributes.

    Select the item you want to be clickable and when the whole thing is selected right click and choose "convert to symbol"

    the pop up that shows up, give it a name, and select "button" click okay and viola, done

    However, the code above wont do too well anymore (past version 5) as "diff" isn't recognized anymore.

    instead once you have your button, click ONCE on it, open the ActionScripts panel and put this:

    Code:
    on(release){
        getURL("http://yoursite.com" _blank);
    }
    Thats it.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •