bmills
July 13th, 2009, 05:26 PM
Hello,
I'm not very fluent with AS3, however, I have successfully changed the following script from AS1 to AS3. All is working with the exception of the "target". When I use "_self", nothing happens. However, when I remove _self and click on the button (image), it opens a new window.
All of the tut's I have followed have suggested the same thing, but it is not working for me. Any assistance with resolving this issue is greatly appreciated.
Here is the URL in question: http://design.1105media.com/sitecore/sites/THE_Journal/govConn/stimulus.aspx.htm l (http://design.1105media.com/sitecore/sites/THE_Journal/govConn/stimulus.aspx.html)
And, the AS (below) I'm using. The first block of code is another attempt at correcting this, however, you'll see that it is commented out.
Thanks again,
B
--------------
stop();
//actions to redirect user to new page in same window
/*var link:URLRequest = new URLRequest("http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx"); (http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx%22%29;)
thumbsdown_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent) :void
{
navigateToURL(link);
}*/
thumbsdown_btn.addEventListener(MouseEvent.MOUSE_D OWN, thumbDownHandler);
function thumbDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx"), (http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx%22%29,) "_self");
}
// triggers animation on mouseOut
thumbsdown_btn.addEventListener(MouseEvent.MOUSE_O UT, mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void {
gotoAndPlay(16);
}
I'm not very fluent with AS3, however, I have successfully changed the following script from AS1 to AS3. All is working with the exception of the "target". When I use "_self", nothing happens. However, when I remove _self and click on the button (image), it opens a new window.
All of the tut's I have followed have suggested the same thing, but it is not working for me. Any assistance with resolving this issue is greatly appreciated.
Here is the URL in question: http://design.1105media.com/sitecore/sites/THE_Journal/govConn/stimulus.aspx.htm l (http://design.1105media.com/sitecore/sites/THE_Journal/govConn/stimulus.aspx.html)
And, the AS (below) I'm using. The first block of code is another attempt at correcting this, however, you'll see that it is commented out.
Thanks again,
B
--------------
stop();
//actions to redirect user to new page in same window
/*var link:URLRequest = new URLRequest("http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx"); (http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx%22%29;)
thumbsdown_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent) :void
{
navigateToURL(link);
}*/
thumbsdown_btn.addEventListener(MouseEvent.MOUSE_D OWN, thumbDownHandler);
function thumbDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx"), (http://thejournal.com/microsites/govconnection/21st-century-classroom.aspx%22%29,) "_self");
}
// triggers animation on mouseOut
thumbsdown_btn.addEventListener(MouseEvent.MOUSE_O UT, mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void {
gotoAndPlay(16);
}