A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: [CS3] navigateToURL with "_self")

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    3

    [CS3] navigateToURL with "_self")

    Hi there,

    I've started a web page and have a flash menu on it and am wondering the best way to hook up the buttons to other url's (index, profile, services, etc.). Should I just put in an actionscript action for each button or is there a way to do them all in one actionscript?

    Next it's my code that doesn't work with "_self" only works with "_blank" and that is my problem, I need the urls to display in the same window.

    ......................

    ins_ini.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void
    {
    var targetURL:URLRequest = new
    URLRequest("http://romulocantorjimenez.com/");
    navigateToURL(targetURL,"_self");
    }
    trace("I am clicked");

    .......................

    Can anybody help?

    Thanks in advance...

    RCantor

  2. #2
    Senior Member random25's Avatar
    Join Date
    Apr 2002
    Posts
    566
    have you tried using getURL(targetURL,"_self");

    If you want to make an apple pie from scratch, you must first create the universe. Carl Sagan

  3. #3
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    ^ That won't work because he is not using AS 2.0 but 3.0;

    PHP Code:
    var urlTarget:URLRequest = new URLRequest("http://www.plenarycreation.com/");

    this.btn.addEventListener(MouseEvent.CLICKonClick);

    function 
    onClick(event:MouseEvent):void
    {
        
    navigateToURL(urlTarget"_self");
    // end of onClick 
    Your code looks ok, no idea why it's not working, it should.



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  4. #4
    Junior Member
    Join Date
    Jan 2008
    Posts
    3

    About my problem...

    Hi,

    For any help here is the code in dreamweaver that calls the swf...

    .................................................. ............................

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Documento sin t&iacute;tulo</title>
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    </head>

    <body>
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','heigh t','800','src','dos','quality','high','pluginspage ','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','dos' ); //end AC code
    </script><noscript><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="800">
    <param name="movie" value="dos.swf" />
    <param name="quality" value="high" />
    <embed src="dos.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="800"></embed>
    </object></noscript>
    </body>
    </html>

    .................................................. ................

    thank you...

  5. #5
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    I don't think that has anything to do with it, but to keep your html code cleaner and valid, you should embed your .swf files with SWFObject. http://blog.deconcept.com/swfobject/



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  6. #6
    Junior Member
    Join Date
    Jan 2008
    Posts
    3

    Nothing with flash it's only dreamweaver...

    My flash code it's ok, the problem was with the "allowScriptAccess" parameter in dreamweaver...

    Here is the code that works ok:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Documento sin t&iacute;tulo</title>
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    </head>

    <body>
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','heigh t','800','src','dos','allowscriptaccess','always','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','dos' ); //end AC code
    </script><noscript><object classid="clsidD27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="800" allowscriptaccess="always">
    <param name="movie" value="dos.swf" />
    <param name="allowScriptAccess" value="always" />
    <param name="quality" value="high" />
    <embed src="dos.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="800" allowscriptaccess="always"></embed>
    </object></noscript>
    </body>
    </html>

    Thank you...

  7. #7
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    Ahh, I didn't see that was missing. Too many lines...

    Anyways, it's good your solved it.



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  8. #8
    Junior Member
    Join Date
    Jan 2010
    Posts
    2
    Hello,
    Sorry for digging this thread up. My flash animation opens a new window the first time and then the rest open on the same window. You can try it at www.houstonpremiumdoors.com. I have used the "_self" and tried setting the allowscriptaccess. Can you please help me make it always open on the same window. This is what it looks like:

    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="766" height="273" allowScriptAccess="always" vspace="0" align="absbottom">
    <param name="movie" value="flash/flash.swf">
    <param name=quality value=high>
    <param name="wmode" value="transparent">
    <param name="LOOP" value="false">
    <param name="allowScriptAccess" value="always">
    <embed src="flash/flash.swf" width="766" height="273" vspace="0" loop="false" align="absbottom" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always"></embed>
    </object>

  9. #9
    Junior Member
    Join Date
    Jan 2010
    Posts
    2
    Well I figured it out. I needed the quotation marks around _self. So the code should say "_self" instead of just _self.

  10. #10
    Junior Member
    Join Date
    Feb 2010
    Posts
    1
    I got the _self to work but it doesn't work with; Bottomframe or other selfnamed frames!
    anyone know why?

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