PDA

View Full Version : Unable to get "_self" to work properly


Binary_Solo
08-19-2009, 06:01 PM
Hello- I've created a flash sequence banner with each movie clip having it's own URL. It works and opens in a new window no problem, but when I add the "_self" to have it open in the same window nothing happens when I click. Any help would be appreciated. Here is the code I'm using for each movie clip - google url for example only:

button_mc.addEventListener(MouseEvent.CLICK, onClick);

function onClick(Event:MouseEvent):void
{
navigateToURL( new URLRequest("http://www.google.com"), "_self");
}

NealJMD
08-20-2009, 12:20 AM
Are you looking at it in a browser? If you just export the swf, it won't be able to work a "_self" because itself is not a browser that can go to your URL, it's just flash player. If you publish it and open the html in your browser, it should work.

Binary_Solo
08-20-2009, 01:19 PM
Hi NealJMD, thanks for the response- I have been previously uploading the .swf file only to my server which will open in a new window when using "_blank", but does nothing when I use "_self". I tested the html file on the desktop by using "open with firefox" and it worked properly with "_self", so am I suppose to upload both the html AND swf files to my server to get the file to work properly on my website? And if so, do they need to be in a folder together on my server? Thanks.

raydowe
08-20-2009, 02:25 PM
Your code is correct. I would clear you browser cache to ensure you aren't still looking at the old copy. You don't need anything special in the html file, it should work with any html page the swf is embedded in.

Binary_Solo
08-21-2009, 05:11 PM
Still can't get it to work. Like I said, it will work if I right-click and open html file with firefox, but when I have the swf file on my site it won't open in same window- clicking on link does nothing.

raydowe
08-26-2009, 12:43 AM
Can you provide a link to your files so I can have a look at them?

tinkutr
08-26-2009, 03:08 PM
your code is right. did u tried it in server??

---------------------------
http://www.trmmedia.com