A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: can't link to self

  1. #1
    Member
    Join Date
    Apr 2010
    Posts
    34

    can't link to self

    Hi!
    Can anyone see a reason why When I put in this code I get buttons that do nothing? Not even sending me to the url in a new page.

    var url1:String = "necessity.html";
    var request1:URLRequest = new URLRequest(url1);

    bl1_mc.addEventListener(MouseEvent.CLICK, ftemp3);

    function ftemp3(e:MouseEvent):void{
    try {
    navigateToURL(request1, "_self");
    } catch (e:Error) {
    trace("Error occurred!");
    }
    }

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    If you're using standard button, you can't add MouseEvent.CLICK to it. Use ComponentEvent.BUTTON_DOWN instead

  3. #3
    Member
    Join Date
    Apr 2010
    Posts
    34
    thanks, but I'm using MovieClips for the buttons

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    What's the structure of this movie clip?
    Does it contain any children?

  5. #5
    Member
    Join Date
    Apr 2010
    Posts
    34
    Its an imported png file I f8-ed into a MovieClip- nothing special. I also applied a code to make it grow on mouse over and get small again on mouse out and it works OK

  6. #6
    Member
    Join Date
    Oct 2010
    Posts
    55
    have you tried running it without this mouseover effect?

  7. #7
    Senior Member
    Join Date
    Feb 2006
    Location
    Düsseldorf, Germany
    Posts
    142
    it shows me

    SecurityError: Error #2137

    so if you are using the _self, then try not use _self, but some JS workaround

    Flash -> button -> click -> JS -> redirect page
    --
    there is a place for those who dare to dream...

    Flash Developer
    VISTAPARK GMBH
    BÄRENSTRASSE 11-13
    D-42117 WUPPERTAL

  8. #8
    Senior Member
    Join Date
    Feb 2006
    Location
    Düsseldorf, Germany
    Posts
    142
    or

    go here: http://goo.gl/Hwz9V

    And set the trusted folders, where all your project are. it will solve the problem.
    Last edited by ifmi; 03-13-2011 at 07:19 AM.
    --
    there is a place for those who dare to dream...

    Flash Developer
    VISTAPARK GMBH
    BÄRENSTRASSE 11-13
    D-42117 WUPPERTAL

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center