ActionScript 3.0 :: Major Problems With _self In AS3
Jan 6, 2010
Okay, so I'm pretty much a self-taught Flash newb, so please bear with me if this question has an obvious answer. I've searched different fixes, and none of them have worked.
I am making a simple button in Flash CS4 with AS3. The button has a hover effect and that's it. I am wanting the button to link to a different webpage when clicked on in the same window. I am using this code:
Button.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void{ var request:URLRequest = new URLRequest("http://www.mysite.com); navigateToURL(request, "_self");}
When I test the movie in Flash, it works fine. It takes me to the webpage. However, when embedded online, it does nothing. I can click on it, and I will remain there on the same page. Like it's just a pretty image with a hover effect and no link. I've tested the button in both IE and Firefox, and it does not work in either.
Now here's the funny thing....when I use _blank instead of _self, it works just fine in both Firefox and Explorer. Any ideas of what I am doing wrong?
Thank you.
View 10 Replies
Similar Posts:
Jul 25, 2010
Is there any way to detect flash-plugin crashes in major browsers (firefox, ie, chrome, safari and opera) via javascript?
View 4 Replies
Apr 25, 2011
NativeApplication.nativeApplication.runtimeVersion returns the runtime version, but what is the best way to create a function which will return the major version? For version 2.6.0.19120, the function should return 2 only. This function should work even when AIR reaches version 10.
View 2 Replies
Dec 5, 2011
In Actionscript 3, you quickly learn that using vector graphics is a guaranteed way to inflict massive damage to the performance of your project. Using a combination of Bitmap, its bitmapData property and its copyPixels() method in place of all vector graphics will yield a ridiculous performance boost and is essential for people like myself developing games within Flash. Beyond this I'm not really sure what the next major things that I should be targeting and attempting to optimize are.
I do use a lot of the inbuilt trigonometry functions, but they don't seem to affect it all that much. I know there are some libraries that optimize mathematics with some approximation methods and similar, but so far I haven't found these necessary. Are there any other massive known points I should be looking at? I'm more referring to the inbuilt things that I should be careful of (like avoiding vector rendering) rather than how to improve my own coding style.
View 1 Replies
Nov 15, 2011
i've got a pretty small (in my opinion) usage of motion tween on the following site: [URL]
the circles are moving around and rotating.. not that big of a deal compared to many much more flash intensive websites that i've seen.
on a few computers i've viewed the website on, this page slows down the rest of the computer, the circles move real choppy, etc so it's very taxing on the computer/processor. making this a less intense flash tween? is it something that i'm overlooking or is what my flash file is doing truly that difficult for a computer/browser to process?
View 7 Replies
Oct 20, 2010
We have a requirement to create a video demo of certain products. What is the best way to make sure that the video plays on as many browsers as possible on all popular platforms (on Windows, Mac, Android, and iOS devices)? Current implementation: we just have Flash videos that load in a Flash player.
View 3 Replies
Oct 7, 2011
I'm looking for a good solution to automate testing of a website, major parts of which are in flash/flex.
The preferred language is c#, but I wouldn't mind java, python or php if the solution on any of those languages is better (meaning, easier to write on, less bugs and more tutorials and samples).
What is the best framework around for flash automation in my case?
View 1 Replies
Jun 3, 2011
I'm making just a simple "website"-like project but I'm stuck on scripting the buttons for the drop down menu. I want the buttons, when clicked, to go to a different frame in the root timeline, but I just can't seem to get it work ). This is my code so far for the whole project.
import fl.transitions.Tween;
import fl.transitions.easing.Regular;
import fl.transitions.easing.Elastic;
import flash.events.*;
stop()
[Code] .....
Here's a link to download the .fla [URL].
View 6 Replies
Apr 4, 2012
I am making my second video, so I'm not too knowledgeable. Anyway, I imported audio into my video and it plays back fine. So I play the video, and pause it to try and synchronize the audio. The video stops, but the audio keeps playing, and it will not stop until the whole thing has played. If I try to start from the beginning again and play the audio to sort of override it, it just overlaps with the original audio, and the resulting noise gives me a headache. I don't know if somehow I can stop the audio a
portion of the way through
View 5 Replies
Oct 12, 2010
My site has a jQuery drop-down navigation menu and that is displayed beneath the Flash. How can I display the navigation menu above the Flash object? I tried with setting wmode="transparent" but it is not work.
View 1 Replies
Apr 28, 2008
I have a flash banner that is a simple animation and some text, and at the top layer an invisible hit area button that has the following AS on it...
Code:
on (release) {
getURL(url, "_self");
[code]....
View 14 Replies
Feb 8, 2010
Using AS2, I have a simple flash navigation built using getURL to open various pages of the web site. I'm using _self because it's necessary to open the pages in the same window.The functionality works fine, the only problem is my flash navigation is on every page and when I "getURL" on the pages linked to from the menu, the flash reloads when the page loads. This creates a blank spot on the page until the flash loads.What's the best way to do my navigation so that it doesn't reload the flash on every page? Or at least I don't get the blank spot when going to a new page.
View 2 Replies
Dec 2, 2010
from within a browser this will work:
function bobhome(evt:MouseEvent):void{ var urlRequest:URLRequest= new URLRequest ('home.html'); navigateToURL (urlRequest, "_blank"); }
this will not:
function bobhome(evt:MouseEvent):void{ var urlRequest:URLRequest= new URLRequest ('home.html'); navigateToURL (urlRequest, "_self"); }
View 5 Replies
Aug 18, 2010
I'm working on a Flash navigation using AS3. It can be seen as is @ PhilipK .ca /portfolio .
I want to make it so when you click the button on the far right, for the second time it opens a link in the tab that the flash video is embeded.
Here is the code I am having trouble with...
{
navigateToURL(new URLRequest ("philipk.ca/photo_gallery/photography"), '_self') ;
}
http removed before address because I am not able to post URLs untill 50 posts
I am wondering if I have to change part of the code within the HTML? Or am I doing something wrong with the AS3 code?
View 1 Replies
Aug 20, 2010
I've cobbled together a website for the family business using Flash CS4, but I'm having real trouble getting two interlinked .swf's to open in the same window. By the time you go from the homepage to the gallery and back to the homepage, you've got 3 tabs in the browser. How can I fix this? Here is my code.
ActionScript Code:
button4.addEventListener (MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void
{
[Code]....
The code is the same (different URL, obviously) for both links, but they open new tabs every time.
EDIT: It seems to have fixed itself. Maybe it didn't upload right when I put it on the FTP. So all is well now!
View 0 Replies
Feb 18, 2009
Strange Behavior in a flash I'm working on. And I must be doing something wrong because I can reproduce it in every flash I create. You can check out the behavior here at a test page on my under construction site:I have a menu bar at the top of the page, with the following code:
btnHome.addEventListener(MouseEvent.CLICK,btn1Clic kHandler);
function btn1ClickHandler(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.i2ctech.com/"),"_Self");
[code].....
View 2 Replies
Sep 4, 2009
How would I make this open in the same window instead of a blank popup window?
//Navigate to some URL
var urlRequest:URLRequest = new URLRequest("http://www.blah.com/links.php");
navigateToURL(urlRequest);
}
View 3 Replies
Feb 18, 2009
Strange Behavior in a flash I'm working on. And I must be doing something wrong because I can reproduce it in every flash I create. You can check out the behavior here at a test page on my under construction site: [URL]I have a menu bar at the top of the page, with the following
code:
btnHome.addEventListener(MouseEvent.CLICK,btn1ClickHandler);
function btn1ClickHandler(event:MouseEvent):void{
navigateToURL(new URLRequest("
http://www.i2ctech.com/"),"_Self");
[Code].....
If I open up a web browser and then click the menu buttons, the buttons open the link up in a new page. Once the NEW page opens, the menu buttons start acting as I would expect, then opening any further links in the same web page. Is this some internet explorer security setting? Every computer that I have utilized (total of 5) to view the web page exhibits this same behavior.
View 13 Replies
Jul 16, 2009
This is the code I am using:
main_btn.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):[code]...
When I click on the button, it does nothing but sit there with a blank stare like I did in physics class. It works fine if I switch it to _blank, but that is totally not what I want. Why is this not working?
View 3 Replies
Mar 8, 2011
Im using this code on a nav menu i have created.
on (release) {
getURL("http://mysite.com", "_blank");
}
[code].....
View 9 Replies
May 1, 2011
I have navigateToURL(new URLRequest("page address"),"_self"); still opening a new window for all of the buttons in my menu. I think I have the syntax correct so are there any other factors?
Here is the code
ActionScript Code:
Button1_btn.addEventListener(MouseEvent.CLICK,mouse1DownHandler);
function mouse1DownHandler(event:MouseEvent):void {
[Code]....
View 1 Replies
Mar 1, 2010
I have this site I am updating and I have a little issue. I made a button that navigates to a URL with a _self target. Well, in the script, i have it like this:
Code: Select allclickhere2Btn.addEventListener(MouseEvent.MOUSE_DOWN, myHandler);
function myHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("https://app.playmakercrm.com/register/eNortjK0UjJWsgZcMAkeAcs!"), "_self");
}
the "_self" isn't working on the page, but when i take out the target, it works just find, it opens in a new page which i don't want. You can check it out here Code: Select [URL] and watch that flash header for about 30 seconds, theres a button at the end that reads "Click Here" try clicking on that and it wont take you to the URL.
View 1 Replies
May 5, 2009
I'm working on a SWF that is a banner on a home page and the is opening links a new window despite my attaching the "_self" argument to the navigateToURL command.Like here is a snippet of code TO ME it looks right:
PHP Code:
var link_001:URLRequest = new URLRequest("http://www.lcc.edu/schedule/");button_001_btn.addEventListener(MouseEvent.CLICK,
[code]....
View 3 Replies
Mar 24, 2011
Here I create a button that when pressed opens specifies web site:
Code:var adresas:URLRequest = new URLRequest("some web site adress", _self);
var item:Sprite = new Sprite();
item.graphics.beginFill(0x000000);
item.graphics.drawCircle(30, 30, 20);
item.graphics.endFill();
[Code]...
View 0 Replies
Mar 1, 2010
I made a button that navigates to a URL with a _self target. Well, in the script, i have it like this:
Code:
clickhere2Btn.addEventListener(MouseEvent.MOUSE_DOWN, myHandler);
function myHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("https://app.playmakercrm.com/register/eNortjK0UjJWsgZcMAkeAcs!"), "_self");
}
the "_self" isn't working on the page, but when i take out the target, it works just find, it opens in a new page which i don't want.You can check it out here
Code:
dev.myhomecaresalescoach.com
and watch that flash header for about 30 seconds, theres a button at the end that reads "Click Here" try clicking on that and it wont take you to the URL.
View 1 Replies
Jan 14, 2011
I understand that the code below should work but it doesn't, I have to take the underline before self out, for the hyperlink to work at all, and then it creates another window for the file. There may some sort of glitch that I am not aware of. But the code below does not work as is in my app.
var t:TextField = new TextField();
t.htmlText = "hello world"+ "<a href='weeTestPage.html' target='_self'><u>click here</u></a>";
t.autoSize=TextFieldAutoSize.LEFT;
addChild(t);
View 1 Replies
Feb 7, 2007
When a user clicks on a URL, I want the new page to open up in a new window (or tab),instead of always in _self, which of course replaces the movie. I've trace'd the htmlText contents, and see TARGET="" where it's building the clickable links, which I assume the browsers interpret as the same thing as _self. Is there some better way to change the target for any URLs, short of doing a search and replace of the htmlText field
View 9 Replies
Apr 19, 2009
Im having a problem getting my code to navigate to a url in the same browser window, here is what I've got:
private function onClick(e:MouseEvent):void{ switch(e.target){ case casestudyBtn: navigateToURL(headerVO.caseStudyURL, "_self"); break; case campaignBtn: navigateToURL(headerVO.campaignURL, "_self"); break; } }
It keeps returning the error "1084: Syntax error: expecting rightparen before _self.
View 2 Replies
Apr 12, 2010
I'm trying to use navigateToURL with the "_self" parameter for a website navagation menu, but all I ever get is the url opening in a new window or new tab (depending on what browser you are using). What I would like is if it opens in the same window within the browser. For html validation purposes; I'm using a javascript ufo 3.22 (unobtrusive flash objects) method of embed. Here is my AS3 code which is in a standalone file (hope I got all necessary import packages included).
[Code]...
I know it's something real simple and I've read many a posts that scream "allowscriptaccess" issues, but even when I set that I still can't get it working properly.
View 1 Replies
Jan 22, 2011
code not opening website in the same window using "_self" I'm using a button called B_btn and a navigateToURL command on MOUSE_UP.
Code:
B_btn.addEventListener(MouseEvent.MOUSE_UP, getPage);
function getPage(Event:MouseEvent):void
{
navigateToURL( new URLRequest("http://www.google.com"),"_self");
}
I'm just checking the swf in Flash CS5 using ActionScript 3, publishing with command+F12 (key command on Mac OSX), but that alone should work right without exporting? And to go a little off topic, could someone kindly tell me how to embed the swf as HTML code, as I'm trying to setup this swf as an intro to my website and need to embed it as HTML for my index.html page.
View 1 Replies