Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How do I give html link to flash files in Macromedia flash ?

  1. #1
    Join Date
    Apr 2007
    Posts
    52
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How do I give html link to flash files in Macromedia flash ?

    I did create a flash file, now i want to put it on my webpage and give html link to it. I went to action and found getURL

    getURL(http://mysite.com);

    it's giving me error, what and where do I give link and also do i save the image as ,fla or swf to publish in the web page ? Thank you

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

    Default

    are you trying to link the entire flash movie to a link? or a button within the flash?

    simply putting getURL() into the actions layer (or wherever else you have it) won't do anything. You need to apply that action to an object (a movieclip or button).

    If you're linking the entire movie to a webpage...
    1) Create a rectangle that covers the entire stage, set it's alpha to 0
    2) Turn that rectangle into a movieclip and give it an instance name in the properties panel
    3) In the actions panel, add:

    Code:
    instance_name.onRelease = function() {
       getURL("http://www.mysite.com");
    }
    just replace instance_name with the instance name of the rectangle (or button, if you're linking a button).

  3. #3
    Join Date
    Apr 2007
    Posts
    52
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    I did create new symbol and named it link , set it to alpha 0

    and I went to action panel > Global function > Browser/Network > GetUrl and added

    link.onRelease = function() {
    getURL("http://mysite.com");
    }

    but it didn't work

  4. #4
    Join Date
    Apr 2007
    Posts
    52
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    PS: I want to link it to whole movie. Thanks

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

    Default

    Is the actionscript on the save frame as the movie clip?

  6. #6
    Join Date
    Apr 2007
    Posts
    52
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    yes it is, when i clicked check syntax it gave me this error
    Code:
    **Error** Scene=Scene 1, layer=Layer 7, frame=1:Line 1: Statement must appear within on/onClipEvent handler
         action1.onRelease = function() {
    
    Total ActionScript Errors: 1 	 Reported Errors: 1

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

    Default

    ahhh, so it's not on a frame at all. you're adding it directly to the object.

    i don't advise that, but if you're doing it that way the syntax is different.

    use:

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


    The other code would be appropriate for an actions layer, added to the timeline.

  8. #8
    Join Date
    Apr 2007
    Posts
    52
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Sorry, I am getting this error again, I don't know where I have done wrong, I am new in flash


    Code:
    **Error** Scene=Scene 1, layer=Layer 6, frame=101:Line 1: Mouse events are permitted only for button instances
         on (release) {
    
    Total ActionScript Errors: 1 	 Reported Errors: 1

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

    Default

    What version of Flash are you using? Must be Flash 5 or before. I assumed you were using AS 2.0, sorry! I don't really encounter many people using anything lower than Flash 8 (sometimes a few MX 2004 users, but certainly not Flash 5).

    Go into the properties of that movie clip and chang the type to "Button" instead of "Movie Clip".

  10. #10
    Join Date
    Apr 2007
    Posts
    52
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    hi medyman , I am using MX2004, sorry I am new in flash, may be I am not being able to explain you correctly. But Is there a short cut way, so that I just put url and it will work ? Thank you so much for the help.

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
  •