|
-
[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
-
Senior Member
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
-
trace("AKA: Biro Barna");
^ 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.CLICK, onClick);
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. |
-
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í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="clsid 27CDB6E-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...
-
trace("AKA: Biro Barna");
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. |
-
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í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...
-
trace("AKA: Biro Barna");
-
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="clsid 27CDB6E-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>
-
Well I figured it out. I needed the quotation marks around _self. So the code should say "_self" instead of just _self.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|