Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Firefox 3 And NavigateToURL()



I have this code


ActionScript Code:
btnmc.addEventListener(MouseEvent.CLICK, launchurl)public function launchurl(event:Event):void{            if(urllink.length){                navigateToURL(new URLRequest(urllink), "_blank");            }        }

It works in Safari but Firefox 3 is blocking the link.
Is there any way I can make it work in Firefox 3?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 07-09-2008, 02:03 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

NavigateToURL In Firefox
Has anyone else had trouble when calling navigateToURL and setting the target to _blank and a new window not getting launched? This is not a problem in any other browsers excpt Firefox. It only seems to occur when the swf file is embedded in an HTML page.

Has anyone found a workaround?

(seems to work fine in IE, Netscape, Safari, and Opera on Windows and Macs)

[AS3] NavigateToURL And Firefox Pop-up Blocker Problem
Hi, im using this code

Code:
navigateToURL(new URLRequest("http://www.knorcedger.com/"), "_blank");
and i use firefox, which blocks flash from opening a new tab. I read around internet, and i find out that it may be possible to make it work with javascript.

Can someone write an example on how to do it with javascript, or any other possible way?

NavigateToURL Help
Hello All,
This is my first time on this forum, but I was told this was where to come to ask this question.

the code:
/**
* Handles onMouseClick events, calls the associated url
*/

private function onMouseClick(evt:MouseEvent):void {
var request:URLRequest = new URLRequest(u);
navigateToURL(request, "_self");
}

/**

The problem:
Even though I am sure this is right, as I have looked all over the place for the answers, still when clicked it opens a new window.
The onMouseClick calls out a link from an XML file.
It opens the link no problem, just in a new tab or window depending on browser. (Firefox-new tab/IE7-new window)

I have spent at least 15 hours trying to sort this out but to no avail.
Please anyone have any advice or suggestions.

NavigateToUrl - Please Help.
Hey everyone.

I made a short flash intro for a website. In the last frame of the intro it has:

Code:
import flash.display.Sprite;
import flash.net.navigateToURL;
import flash.net.URLRequest;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void{
navigateToURL(new URLRequest("main.php"), "_self");

}
Which is supposed to automatically make the user go to main.php when the movie's done playing.
For some reason though it doesn't work.. Instead it tries to refresh the page or something.. Only that it tries to do it like every second, so nothing happens except for the "waiting for host..." line at the bottom of the browser blinking.

Please help

NavigateToURL
I have 2 flash files on the same web page that use AS3 to open a web link when clicking a symbol. One file activates the IE7 pop-up blocker and the other does not.

The file that activates the pop-up blocker uses 6 button symbols in the same scene. The file that does not has 5 button symbols, 1 in each scene with a seperate script in each scene.

Why does the first file activate the pop-up blocker but the second file does not?

Link to web page:
http://tornquist.com/product_lines/MAG/mag_main.html

NavigateToURL
How can I use the navigateToURL function to open a URL in the same browser window? The code below opens the URL in a new window:

var approach:URLRequest = new URLRequest("energenic_b/approach/index.html");
approach_btn.addEventListener(MouseEvent.CLICK, onClick1);
function onClick1(event:MouseEvent)
{
navigateToURL(approach); void
}

Should 'void' be changed?

AS3.0 NavigateToURL
Hi All,
Iam using asc.jar to compile the as scripts which i have written. But when i try to compile the code using the following command

java -jar asc.jar sample.as

It gives an error 1017: The definition for BaseClass Object is not found.

My Sample.as is a very simple one.

Please find the code below.

package
{
import flash.net.URLRequest;
import flash.net.navigateToURL;

public class Sample
{
public function keynoteOpenUrl(url:String) : void {
var absUrl:String = "

Why Does NavigateToURL Do Nothing?
I am writing an Actionscript 3.0 program, intended to be standalone run, and when the user clicks a button I want to open up a browser and go to a specified web page. I thought all I had to do was call:

var urlRequest:URLRequest = new URLRequest("

NavigateToURL()...
I want to be able to make a request for let's say abc.swf and NOT display it inside my running movie.
Instead I just want it to be shown just as an swf-file (just like when you test your movies by pressing CTRL+ENTER) but I don't seem to get it right.

I thought it would be as simple as this:

var myURL:URLRequest = new URLRequest("port/abc.swf");

//buttons//
this.cnt1.Butt.addEventListener(MouseEvent.CLICK, BIG1);

function BIG1(myevent:MouseEvent):void{
navigateToURL(myURL);
}


So.. What is wrong? Or can it be done at all the way I want it to?

I hope you get my idea and the reason for NOT creating an simple html-page is that I'd rather deal with swf-files. For me it's just easier to work with and creating html-files for my swf-files would just give me more files to control. And I don't want to be given a such control although it would be funny to become a dictator controlling billions of files.... :D..

Navigatetourl And Ie6
Hi, we have developed a website with as3, we are using navigate to url with html parameters.

every thing is working ok except whith ie6 and local.

if we access to the site over internet with ie6 it works but the same thing over a cd does not work.

someone has the same issue?.

Tia

Fcardo

NavigateToURL - Help PLEASE
I am two minutes from entering into an irate fit of rage!!!! I understand that the OOP in AS3 allows flexibility, yadda yadda yadda..... but this is killing me!!! I only need the simple things in life... Please look at my code... it does not work.... I have a banner where the name and listen button loop.... there is an alpha tween on the name.... when you click the listen button, the persons website should appear in a seperate window... Can you please tell me what I am doing wrong? Thanks in advance..

Code:

//Loop name and listen
gotoAndPlay("name");

//Listen btn gets URL
function gotoPage(event:MouseEvent):void
{
var targetURL:URLRequest = new URLRequest("http://myspace.com");
navigateToURL(targetURL);
}

listenBtn.addEventListener(MouseEvent.CLICK, gotoPage);

Using NavigateToURL To Run Javascript?
I'm not sure I'm doing this right...

I'm trying to have a simple browser window pop-up when the user clicks on an element in my page. This is what I'm working with at the moment:

In the flash document


Code:
import flash.net.*;

...

imageLink = thumbnailLink + "big.html";
var launcher:String = "javascript:Launch('" + imageLink + "')"
trace(launcher);
navigateToURL(new URLRequest(launcher), 'seetoys');
and then in the html page that the flash is embedded in:


Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Launch(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=550,height=250");
}
// End -->
</SCRIPT>
now the trace(launcher) is returning javascript:Launch('thumb1big.html') which is prettyt much what I expected it to. However when I test the movie in a browser it isn't doing anything at all when I click on the button.

Now my question is, have I missed some new way to run a javascript from flash (I used to use getURL in 2.0 but am trying to learn 3.0 as I go along)

NavigateToURL Problems
Im trying to make a flash header for a website, with buttons in it to navigate through the website. Im using Flash CS3 and AS3 to program it but im having problems with the navigateToURL function. it works, when run in flash, but if i put the flash movie into dreamweaver then test in browser, and click the button i get 'stopped potentiall unsafe operation' error aka 'sercurity error # 2028' Will this happen if the flash file is hosed on the web and not just being previewed in browser?

"allowScriptAccess="always"" is in my html code.

Anything is helpfull! thanks

Navigatetourl With Frames
hi im having trouble with getting one of my buttons to change the page in a different frame on my page. i can get it to use the _self but if i use the frame names (mine is bottomFrame) it changes the whole page and not the bottom frame.

navigateToURL(videoURL, "bottomFrame");

any help? or somewhere that explains this?

Pass URL From XML Into NavigatetoURL
Hey everyone,

I having some trouble here, I have an xml file which Im pulling data out of and passing it into my flash file using as3. I have successfully been able to pull out data into text fields, but now running into to pass the url into a navigatetoURL function. I cant seem to figure it out, but I am successfully able to trace the node, so I know the URL is correct. Any help would be much appreciated!

Here is my as3 code:

ActionScript Code:
// variables
var popInfo:popMc;
var url:URLRequest = new URLRequest(urlNY;

var urlNY =xml.city[0].@weburl.toString();

// load xml
var xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("data/cities.xml"));
loader.addEventListener(Event.COMPLETE,
    function(evt:Event):void {
        xml = XML(evt.target.data);
        trace(xml.city[0].@weburl.toString());
    }
);

 

// event listeners
seattleBtn.addEventListener(MouseEvent.CLICK, onClickSEA);
losangelesBtn.addEventListener(MouseEvent.CLICK, onClickLA);

// functions
function onClickSEA(event:MouseEvent):void
{
    popInfo = new popMc();
    popInfo.x = 100;
    popInfo.y = 50;
    addChild(popInfo); 
    popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove);
    popInfo.nyopBtn.addEventListener(MouseEvent.CLICK, onClickNYOP);
    popInfo.carsizeText.text = xml.city[1].bidlist.carsize.descendants().toXMLString();
    popInfo.priceText.text = xml.city[1].bidlist.price.descendants().toXMLString();
    popInfo.savingsText.text = xml.city[1].bidlist.savings.descendants().toXMLString();
    popInfo.stateText.text = xml.city[1].@name.toString(); 
}

function onClickLA(event:MouseEvent):void
{
    popInfo = new popMc();
    popInfo.x = 100;
    popInfo.y = 50;
    addChild(popInfo); 
    popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove);
    popInfo.nyopBtn.addEventListener(MouseEvent.CLICK, onClickNYOP);
    popInfo.carsizeText.text = xml.city[2].bidlist.carsize.descendants().toXMLString();
    popInfo.priceText.text = xml.city[2].bidlist.price.descendants().toXMLString();
    popInfo.savingsText.text = xml.city[2].bidlist.savings.descendants().toXMLString();
    popInfo.stateText.text = xml.city[2].@name.toString(); 
}


function onClickRemove(event:MouseEvent):void
{
    removeChild(popInfo);
}

function onClickNYOP(event:MouseEvent):void
{
    navigateToURL(url, "_blank");
}

// set button mode here
seattleBtn.buttonMode = true;
losangelesBtn.buttonMode = true;

Vraag: NavigateToURL
Haha oops, my bad... anyways here's my question in English :P

Hey
I'm currently working on a project that I need to make for my exam Multimedia. I made an animated splash screen in Flash and made a link of it with a navigateToURL function. When I upload my project on a website it works in both IE7 and Firefox

(Caviar from Russia)
http://kaviaar.mywebcommunity.org/

But when I run it local on my computer it only works in Firefox (the navigateToURL function), in IE7 this doesn't work and since I have to show my project local and it has to work in both Firefox and IE7 I'd like to get this working as well in IE7.. I think this is a security thing from IE7 but I already enabled the active X elements for local files

Is there anyone who knows how to fix this?

Kind regards

Wouter

NavigateToURL + POST
Is it possible to use a URLRequest with POST variables through the navigateToURL function?

When I set the URLRequest to POST, it still sends the vars by GET

AS:

Code:
var url:String = "http://127.0.0.1/test.php"
var variables:URLVariables = new URLVariables();
variables.test = "Something";
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.data = variables;
try {
navigateToURL(request);
}
catch (e:Error) {
// handle error here
}
test.php:

Code:
<?php

if(isset($_POST['test']))
{
echo "POST";
}
if(isset($_GET['test']))
{
echo "GET";
}
?>

NavigateToURL Not Working In IE7
So I have a file with buttons that link to external web pages, using the actionscript below.

They work perfectly in every browser on PC and Mac, except IE7.

In IE7 (on PC) when the buttons are clicked, nothing happens, as if the buttons have no ActionScript.

Any ideas why? Any solutions?

(This happens whether or not I use code to circumvent the "Click here to use this control" ActiveX issue you get with Flash in IE.)

Actionscript:

Code:
var page5:URLRequest = new URLRequest("page-six_v2.shtml");

buttonFive.addEventListener(MouseEvent.CLICK, onClick6);

function onClick6(event:MouseEvent):void

{
navigateToURL(page6, "_self");
}
HTML:

Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="555" height="405" title="FlashMovie" usemap="#map">

<param name="loop" value="false">

<param name="WMode" value="Transparent">

<param name="allowScriptAccess" value="always" />

<param name="movie" value="SD-ASO-0803-04.swf">

<param name="quality" value="high"><param name="BGCOLOR" value="ffffff">

<embed src="SD-ASO-0803-04.swf" width="555" height="405" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="ffffff" allowScriptAccess="always" wmode="Transparent" ></embed>
</object>

Help With NavigateToURL And Javascript
Can someone help me out with my code? I am trying to call javascript to open a popup window using navigateToURL, but it doesn't work...
I also tested my movie from flash, and I get a window internet explorer saying: "Internet Explorer cannot download. Unspecified error."


ActionScript Code:
this.newsletterButton.addEventListener(MouseEvent.CLICK, clickNewsletter);

function clickNewsletter(e:MouseEvent):void {
    var jscommand:String="window.open('http://www.url.com/newsletter/main.html', 'newsletter', 'height=500, width=400, toolbar=no, scrollbar=no');";
    var url:URLRequest = new URLRequest("javascript:" + jscommand + "void(0);");
    navigateToURL(url, "_blank");
}

NavigateToURL + Mailto Help
I'm having an issue with navigateToURL and mailto. We have a flash app that gets wrapped in a WinForm wrapper and when navigatetoURL(new URLRequest("mailto:asdf"),"_self") is called it opens a new browser window. This happens even if the target is set to "_self." This only happens when you view the executable and IE is the default browser. It works perfectly when viewing the swf, the executable just doesn't seem to like navigateToURL for some reason.

Anyone experienced this before?

Thanks.

NavigateToURL Not Working
Hello Guys,

I do have a previous post regarding this issue, put here is where I am at. I have ajusted my coding to the following:


ActionScript Code:
work.addEventListener(MouseEvent.CLICK, callLink);
function callLink(e:MouseEvent):void {
  var url:String = "http://www.hologramdesigns.com";
  var request:URLRequest = new URLRequest(url);
  try {
    navigateToURL(request, '_self');
  } catch (e:Error) {
    trace("Error occurred!");
  }
}

And it compiles without a problem, but when viewing the .swf file you click on the button and nothing happens. Can anyone tell me where I am going wrong?

NavigateToURL And Opener
ok I can send post variables and navigate to a url like this:

ActionScript Code:
var request:URLRequest = new URLRequest("mypage.php");
            request.method = URLRequestMethod.POST;
           
           
            request.data = _urlVars;
            navigateToURL(request, "_self");


but this window is a popup...so I want the main window the one that opened this popup to navigate to the url and receive the variables.

in javascript you can refer to the main window with the keyword opener

but I am unsure the correct way to set the opener as the target for the navigateToURL. Or if its even possible?

does anyone know?

Thanks!!

NavigateToURL Query
When Creating a funtion that contains the navigateToURL function, is there a way to specify the area of a HTML page to navigate to. Ideally it would be another function within the original. Or is this not possible to do within Flash

Any help would be gratefully received

NavigateToURL Question
Hi.... I am trying to use this function after a button is clicked.. but for some reasons it didn't work.Flash says its a duplicated variable defination...
What is the proper way to do this to go around the duplicated issue?
...many thanks!




Quote:






function clicksprite(event:MouseEvent):void {

if (i == 2) {

var url:String = "test1.html";

} else if (i == 3) {

var url:String = "test2.html";

} else if (i == 4) {

var url:String = "test3.html";

}

var request:URLRequest = new URLRequest(url);
navigateToURL(request);
}




Thanks again!

NavigateToURL Request
I'm using the following code to link to another page. The instance name of the button is "oosLink." Getting error messages pertaining to syntax issues or something like that.

Anyone see what I'm doind wrong here?

oosLink.addEventListener(MouseEvent.CLICK, callLink);

function callLink:void {
var url:String = "http://www.thispage.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank');
} catch (e:Error) {
trace("Error occurred!");
}
}

Problem With NavigateToURL
Hi
I have a problem with linking to html pages in the same directory.
I started with:
function workinghereclick ( ev:MouseEvent ):void
{
navigateToURL( new URLRequest( "workinghere.html" ) );
}
which worked fine, however it opened a new window.
So I changed it to this:
function workinghereclick ( ev:MouseEvent ):void
{
navigateToURL( new URLRequest( "workinghere.html" ), "_self" );
}
But this didn't work - clicking on the buttons didn't appear to do anything at all.
If I use a full url for the link it works, but this is not ideal.
Does anyone know what's going on here? Is it a bug?

Many Thanks in advance

NavigatetoURL Trouble
hello,
i have a series of buttons that are supposed to link to pdf files. i'm kind of new to as3, so i can't figure out what's going wrong. the code for the first button works, but that's it. i've got some other code in there too, so i wonder if something is interfering with it? any suggestions?

also, if anyone could suggest how i'd go about getting the swf to start at frame 11, i'd appreciate it. i thought a gotoAndStop(11) would do the trick, but doing that pretty much screws up everything.







Attach Code

this.stop();


//button 11//
b11.addEventListener(MouseEvent.CLICK, eleven);
function eleven (event:MouseEvent): void {
gotoAndStop(11) }

//button 10//
b10.addEventListener(MouseEvent.CLICK,ten);
function ten (event:MouseEvent): void {
gotoAndStop(10) }

//button 9//
b9.addEventListener(MouseEvent.CLICK, nine);
function nine (event:MouseEvent): void {
gotoAndStop(9) }

//button 8//
b8.addEventListener(MouseEvent.CLICK, eight);
function eight (event:MouseEvent): void {
gotoAndStop(8) }

//button 7//
b7.addEventListener(MouseEvent.CLICK, seven);
function seven (event:MouseEvent): void {
gotoAndStop(7) }

//button 6//
b6.addEventListener(MouseEvent.CLICK, six);
function six (event:MouseEvent): void {
gotoAndStop(6) }

//button 5//
b5.addEventListener(MouseEvent.CLICK, five);
function five (event:MouseEvent): void {
gotoAndStop(5) }

//button 4//
b4.addEventListener(MouseEvent.CLICK, four);
function four (event:MouseEvent): void {
gotoAndStop(4) }

//button 3//
b3.addEventListener(MouseEvent.CLICK, three);
function three (event:MouseEvent): void {
gotoAndStop(3) }

//button 2//
b2.addEventListener(MouseEvent.CLICK, two);
function two (event:MouseEvent): void {
gotoAndStop(2) }

//button 1//
b1.addEventListener(MouseEvent.CLICK, one);
function one (event:MouseEvent): void {
gotoAndStop(1) }

//forward and back//
forward_btn.addEventListener(MouseEvent.CLICK,forward);
back_btn.addEventListener(MouseEvent.CLICK,backward);

function forward(event:MouseEvent) {
if (this.currentFrame == this.totalFrames)
{
gotoAndStop(1);
}
else
{
nextFrame();
}
}

function backward(event:MouseEvent) {
if (this.currentFrame == 1)
{
gotoAndStop(this.totalFrames);
}
else
{
prevFrame();
}
}



//issue1 download//
iss1.addEventListener(MouseEvent.CLICK, gotoissue1);
function gotoissue1(event:MouseEvent): void {

var issue1: URLRequest = new URLRequest("http://www.celerymagazine.com/celery01.pdf");
navigateToURL(issue1);
}

//issue2 download//
iss2.addEventListener(MouseEvent.CLICK, gotoissue2);
function gotoissue2(event:MouseEvent): void {

var issue2: URLRequest = new URLRequest("http://www.celerymagazine.com/celery02.pdf");
navigateToURL(issue2, "_blank");
}

//issue3 download//
iss3.addEventListener(MouseEvent.CLICK, gotoissue3);
function gotoissue3(event:MouseEvent): void {

var issue3: URLRequest = new URLRequest("http://www.celerymagazine.com/celery03.pdf");
navigateToURL(issue3, "_blank");
}
//issue4 download//
iss4.addEventListener(MouseEvent.CLICK, gotoissue4);
function gotoissue4(event:MouseEvent): void {

var issue4: URLRequest = new URLRequest("http://www.celerymagazine.com/celery04.pdf");
navigateToURL(issue4, "_blank");
}
//issue5 download//
iss5.addEventListener(MouseEvent.CLICK, gotoissue5);
function gotoissue5(event:MouseEvent): void {

var issue5: URLRequest = new URLRequest("http://www.celerymagazine.com/celery05.pdf");
navigateToURL(issue5, "_blank");
}
//issue6 download//
iss6.addEventListener(MouseEvent.CLICK, gotoissue6);
function gotoissue6(event:MouseEvent): void {

var issue6: URLRequest = new URLRequest("http://www.celerymagazine.com/celery06.pdf");
navigateToURL(issue6, "_blank");
}
//issue7 download//
iss7.addEventListener(MouseEvent.CLICK, gotoissue7);
function gotoissue7(event:MouseEvent): void {

var issue7: URLRequest = new URLRequest("http://www.celerymagazine.com/celery07.pdf");
navigateToURL(issue7, "_blank");
}
//issue8 download//
iss8.addEventListener(MouseEvent.CLICK, gotoissue8);
function gotoissue8(event:MouseEvent): void {

var issue8: URLRequest = new URLRequest("http://www.celerymagazine.com/celery08.pdf");
navigateToURL(issue8, "_blank");
}
//issue9 download//
iss9.addEventListener(MouseEvent.CLICK, gotoissue9);
function gotoissue9(event:MouseEvent): void {

var issue9: URLRequest = new URLRequest("http://www.celerymagazine.com/celery09.pdf");
navigateToURL(issue9, "_blank");
}
//issue10 download//
iss10.addEventListener(MouseEvent.CLICK, gotoissue10);
function gotoissue10(event:MouseEvent): void {

var issue10: URLRequest = new URLRequest("http://www.celerymagazine.com/celery10.pdf");
navigateToURL(issue10, "_blank");
}
//issue11 download//
iss11.addEventListener(MouseEvent.CLICK, gotoissue11);
function gotoissue11(event:MouseEvent): void {

var issue11: URLRequest = new URLRequest("http://www.celerymagazine.com/celery11.pdf");
navigateToURL(issue11, "_blank");
}

NavigateToURL Outside Of My Domain
This is the code I want to use to direct a user to a different web page-

function linkToBiblioteca(event:MouseEvent) {
var request = new URLRequest('www.biblioteca.buap.mx');
navigateToURL(request,"_blank");
}

- but it trys to open inside of my directory. How can I avoid this?

NavigateToURL Syntax
I would like to try replacing getURL with navigateToURL, but I'm unsure if they really do the same thing, and I can't seem to find an example of the syntax I need to use.

Please post thoughts. Thanks!

Cant Pass Var Url To NavigateToURL
So Im stumped, Im trying to pass a var url - which grabs the URL out of the xml file. I have the code setup correctly and I can see the URL being pulled out of the XML - but I cant seem to get it into the onClickNYOP function. I get all sorts of errors, can someone please tell what Im doing wrong?

Here is my code:

Code:
stop();
// variables
var popInfo:popMc;
var star1sp:Sprite = new Sprite();
var star2sp:Sprite = new Sprite();
var star3sp:Sprite = new Sprite();
var star4sp:Sprite = new Sprite();
var star5sp:Sprite = new Sprite();

//star1Num
var star11:MovieClip = new Star1();
var star12:MovieClip = new Star2();
var star13:MovieClip = new Star3();
var star14:MovieClip = new Star4();
var star15:MovieClip = new Star5();

//star2Num
var star21:MovieClip = new Star1();
var star22:MovieClip = new Star2();
var star23:MovieClip = new Star3();
var star24:MovieClip = new Star4();
var star25:MovieClip = new Star5();

//star3Num
var star31:MovieClip = new Star1();
var star32:MovieClip = new Star2();
var star33:MovieClip = new Star3();
var star34:MovieClip = new Star4();
var star35:MovieClip = new Star5();

//star4Num
var star41:MovieClip = new Star1();
var star42:MovieClip = new Star2();
var star43:MovieClip = new Star3();
var star44:MovieClip = new Star4();
var star45:MovieClip = new Star5();


// load xml
var xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("data/ht_vday08.xml"));
loader.addEventListener(Event.COMPLETE,
function(evt:Event):void {
xml = XML(evt.target.data);



}
);

// event listeners
stage.addEventListener(MouseEvent.CLICK, onClickStageRemove);

for (var j:int = 0; j < 22; j++)
{
getChildByName("carBtn" + j).addEventListener(MouseEvent.CLICK, onClickLoadData);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OVER, onCarHover);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OUT, onCarOut);
}



// button mode
buttonMode = true;

// functions
function onCarHover(event:MouseEvent):void
{
event.target.gotoAndPlay(11);
}

function onCarOut(event:MouseEvent):void
{
event.target.gotoAndPlay(10);
}

// loads data and populates popUp movieclips
function onClickLoadData(event:MouseEvent):void
{
if (popInfo) removeChild(popInfo);
popInfo = new popMc();
popInfo.x = 130;
popInfo.y = 50;
addChild(popInfo);
popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove);
popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP);
var index = String(event.target.name);
while (index != String(uint(index))){
index = index.substr(2);
}
popInfo.stateText.text = xml.city[index].@name.toString();
var url:String = xml.city[index].@weburl.toString();
trace(url);

popInfo.cityPrice1.text = xml.city[index].cityprice.citypricename[0].toString();
popInfo.cityPrice2.text = xml.city[index].cityprice.citypricename[1].toString();
popInfo.cityPrice3.text = xml.city[index].cityprice.citypricename[2].toString();
popInfo.cityPrice4.text = xml.city[index].cityprice.citypricename[3].toString();

popInfo.fromPrice1.text = xml.city[index].cityprice.fromprice[0].toString();
popInfo.fromPrice2.text = xml.city[index].cityprice.fromprice[1].toString();
popInfo.fromPrice3.text = xml.city[index].cityprice.fromprice[2].toString();
popInfo.fromPrice4.text = xml.city[index].cityprice.fromprice[3].toString();

var star1Num:Number = xml.city[index].cityprice.starcount[0].toString();
var star2Num:Number = xml.city[index].cityprice.starcount[1].toString();
var star3Num:Number = xml.city[index].cityprice.starcount[2].toString();
var star4Num:Number = xml.city[index].cityprice.starcount[3].toString();

popInfo.addChild(star1sp);
star1sp.y = 70;
star1sp.x = -10;
if (star1Num == 1) {
star1sp.addChild(star11);
}
else if (star1Num == 2) {
star1sp.addChild(star12);
}
else if (star1Num == 3) {
star1sp.addChild(star13);
}
else if (star1Num == 4) {
star1sp.addChild(star14);
}
else if (star1Num == 5) {
star1sp.addChild(star15);
}

popInfo.addChild(star2sp);
star2sp.y = 105;
star2sp.x = -10;
if (star2Num == 1) {
star2sp.addChild(star21);
}
else if (star2Num == 2) {
star2sp.addChild(star22);
}
else if (star2Num == 3) {
star2sp.addChild(star23);
}
else if (star2Num == 4) {
star2sp.addChild(star24);
}
else if (star2Num == 5) {
star2sp.addChild(star25);
}


popInfo.addChild(star3sp);
star3sp.y = 70;
star3sp.x = 142;
if (star3Num == 1) {
star3sp.addChild(star31);
}
else if (star3Num == 2) {
star3sp.addChild(star32);
}
else if (star3Num == 3) {
star3sp.addChild(star33);
}
else if (star3Num == 4) {
star3sp.addChild(star34);
}
else if (star3Num == 5) {
star3sp.addChild(star35);
}

popInfo.addChild(star4sp);
star4sp.y = 105;
star4sp.x = 142;
if (star4Num == 1) {
star4sp.addChild(star41);
}
else if (star4Num == 2) {
star4sp.addChild(star42);
}
else if (star4Num == 3) {
star4sp.addChild(star43);
}
else if (star4Num == 4) {
star4sp.addChild(star44);
}
else if (star4Num == 5) {
star4sp.addChild(star45);
}


}

function onClickNYOP(event:MouseEvent):void
{

navigateToURL(url, "_blank");
}

function onClickRemove(event:MouseEvent):void
{
popInfo.closeBtn.removeEventListener(MouseEvent.CLICK, onClickRemove);
popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP);
removeChild(popInfo);
popInfo=null;

}

function onClickStageRemove(event:MouseEvent):void
{
if(event.eventPhase == EventPhase.AT_TARGET) {
removeChild(popInfo);
popInfo=null;

}
}

Cant Pass Var Url To NavigateToURL
So Im stumped, Im trying to pass a var url - which grabs the URL out of the xml file. I have the code setup correctly and I can see the URL being pulled out of the XML - but I cant seem to get it into the onClickNYOP function. I get all sorts of errors, can someone please tell what Im doing wrong?

Here is my code:
Code:

stop();
// variables
var popInfo:popMc;
var star1sp:Sprite = new Sprite();
var star2sp:Sprite = new Sprite();
var star3sp:Sprite = new Sprite();
var star4sp:Sprite = new Sprite();
var star5sp:Sprite = new Sprite();

//star1Num
var star11:MovieClip = new Star1();
var star12:MovieClip = new Star2();
var star13:MovieClip = new Star3();
var star14:MovieClip = new Star4();
var star15:MovieClip = new Star5();

//star2Num
var star21:MovieClip = new Star1();
var star22:MovieClip = new Star2();
var star23:MovieClip = new Star3();
var star24:MovieClip = new Star4();
var star25:MovieClip = new Star5();

//star3Num
var star31:MovieClip = new Star1();
var star32:MovieClip = new Star2();
var star33:MovieClip = new Star3();
var star34:MovieClip = new Star4();
var star35:MovieClip = new Star5();

//star4Num
var star41:MovieClip = new Star1();
var star42:MovieClip = new Star2();
var star43:MovieClip = new Star3();
var star44:MovieClip = new Star4();
var star45:MovieClip = new Star5();


// load xml
var xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("data/ht_vday08.xml"));
loader.addEventListener(Event.COMPLETE,
    function(evt:Event):void {
        xml = XML(evt.target.data);
           
           

    }
);

// event listeners
stage.addEventListener(MouseEvent.CLICK, onClickStageRemove);

for (var j:int = 0; j < 22; j++)
{
getChildByName("carBtn" + j).addEventListener(MouseEvent.CLICK, onClickLoadData);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OVER, onCarHover);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OUT, onCarOut);
}



// button mode
buttonMode = true;

// functions
function onCarHover(event:MouseEvent):void
{
    event.target.gotoAndPlay(11);
}

function onCarOut(event:MouseEvent):void
{
    event.target.gotoAndPlay(10);
}

// loads data and populates popUp movieclips
function onClickLoadData(event:MouseEvent):void
{
    if (popInfo) removeChild(popInfo);
    popInfo = new popMc();
    popInfo.x = 130;
    popInfo.y = 50;
    addChild(popInfo);   
    popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove);
    popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP);
    var index = String(event.target.name);
    while (index != String(uint(index))){
        index = index.substr(2);
    }
    popInfo.stateText.text = xml.city[index].@name.toString();
    var url:String = xml.city[index].@weburl.toString();
    trace(url);
   
    popInfo.cityPrice1.text = xml.city[index].cityprice.citypricename[0].toString();
    popInfo.cityPrice2.text = xml.city[index].cityprice.citypricename[1].toString();
    popInfo.cityPrice3.text = xml.city[index].cityprice.citypricename[2].toString();
    popInfo.cityPrice4.text = xml.city[index].cityprice.citypricename[3].toString();
   
    popInfo.fromPrice1.text = xml.city[index].cityprice.fromprice[0].toString();
    popInfo.fromPrice2.text = xml.city[index].cityprice.fromprice[1].toString();
    popInfo.fromPrice3.text = xml.city[index].cityprice.fromprice[2].toString();
    popInfo.fromPrice4.text = xml.city[index].cityprice.fromprice[3].toString();
   
    var star1Num:Number = xml.city[index].cityprice.starcount[0].toString();
    var star2Num:Number = xml.city[index].cityprice.starcount[1].toString();
    var star3Num:Number = xml.city[index].cityprice.starcount[2].toString();
    var star4Num:Number = xml.city[index].cityprice.starcount[3].toString();
   
    popInfo.addChild(star1sp);
    star1sp.y = 70;
    star1sp.x = -10;
    if (star1Num == 1) {
    star1sp.addChild(star11);
    }
    else if (star1Num == 2) {
    star1sp.addChild(star12);
    }
    else if (star1Num == 3) {
    star1sp.addChild(star13);
    }
    else if (star1Num == 4) {
    star1sp.addChild(star14);
    }
    else if (star1Num == 5) {
    star1sp.addChild(star15);
    }

    popInfo.addChild(star2sp);
    star2sp.y = 105;
    star2sp.x = -10;
    if (star2Num == 1) {
    star2sp.addChild(star21);
    }
    else if (star2Num == 2) {
    star2sp.addChild(star22);
    }
    else if (star2Num == 3) {
    star2sp.addChild(star23);
    }
    else if (star2Num == 4) {
    star2sp.addChild(star24);
    }
    else if (star2Num == 5) {
    star2sp.addChild(star25);
    }

   
    popInfo.addChild(star3sp);
    star3sp.y = 70;
    star3sp.x = 142;
    if (star3Num == 1) {
    star3sp.addChild(star31);
    }
    else if (star3Num == 2) {
    star3sp.addChild(star32);
    }
    else if (star3Num == 3) {
    star3sp.addChild(star33);
    }
    else if (star3Num == 4) {
    star3sp.addChild(star34);
    }
    else if (star3Num == 5) {
    star3sp.addChild(star35);
    }

    popInfo.addChild(star4sp);
    star4sp.y = 105;
    star4sp.x = 142;
    if (star4Num == 1) {
    star4sp.addChild(star41);
    }
    else if (star4Num == 2) {
    star4sp.addChild(star42);
    }
    else if (star4Num == 3) {
    star4sp.addChild(star43);
    }
    else if (star4Num == 4) {
    star4sp.addChild(star44);
    }
    else if (star4Num == 5) {
    star4sp.addChild(star45);
    }
   

}

function onClickNYOP(event:MouseEvent):void
{

    navigateToURL(url, "_blank");
}   

function onClickRemove(event:MouseEvent):void
{
    popInfo.closeBtn.removeEventListener(MouseEvent.CLICK, onClickRemove);
    popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP);
    removeChild(popInfo);
    popInfo=null;

}

function onClickStageRemove(event:MouseEvent):void
{
    if(event.eventPhase == EventPhase.AT_TARGET) {
        removeChild(popInfo);
        popInfo=null;

    }
}

NavigateToURL And Popupblocker
I have a website for students to download ppt, doc, etc and i use URLRequest and navigateToURL for them to download these items. some are fine, others aren't getting anything and i believe it is from the popup blockers in firefox etc.

any ideas how to avoid this?

NavigateToURL...to Send An Email
The following code works, but I have a question...the code opens the default email account and fills it with the information provided in the code (variables to, subject and body)...but can the email be sent without opening the default email...it can be done in php?


PHP Code:




import flash.events.MouseEvent;
import flash.net.*
import flash.net.navigateToURL;
import flash.net.URLRequest;

function openPage(event:MouseEvent):void {
    
    var to:String = "billymyth@gmail.com";
    var subject:String = "Application"
    var body:String = "Test";
    
    var request:URLRequest = new URLRequest("mailto:"+to+"?subject="+subject+"&body="+body);
    
    navigateToURL(request, "_self");
}

myButton.addEventListener(MouseEvent.CLICK, openPage);

NavigateToURL Using RELATIVE Links
In the script below, navigateToURL will only open complete.htm in the 'content' frame when the entire link is present. ie. http://...complete.htm

how can i set navigateToURL to use just the relative links. ie. complete.htm instead of http://...complete.htm?


cr.addEventListener(MouseEvent.CLICK, rClick);
function rClick(event:MouseEvent):void{
var url1:String = "http://therestaurantdesigngroup.com/new/complete.htm";
var request1:URLRequest = new URLRequest(url1);
try {
navigateToURL(request1, 'content');
} catch (e:Error) {
trace("Error occurred!");
}
}

NavigateToURL / Open In Same Window
Hello,
I would like to have the link open in the same window. _self... how do I edit this code? THANKS!!!

-------------

btn_main_featured.addEventListener(MouseEvent.MOUS E_DOWN, mouseDownHandler1a);

function mouseDownHandler1a(event:MouseEvent):void {
navigateToURL(new URLRequest("http://x.com/x/index.php?category_name=x" ));
}

---------------------

NavigateToURL - Open In Same Window
For some reason my link in a movie clip is opening in a new window and I want it to open (default) in the same window.

Following is the action script:

Code:
var headlink:URLRequest=new URLRequest("head.htm");

head.addEventListener(MouseEvent.ROLL_OVER, headOver);
head.addEventListener(MouseEvent.ROLL_OUT, headOut);
head.addEventListener(MouseEvent.CLICK, headClick);

function headOver(event:MouseEvent):void{
head.gotoAndPlay("Over");
}
function headOut(event:MouseEvent):void{
head.gotoAndPlay("Out");
}
function headClick(event:MouseEvent):void{
navigateToURL(headlink);
}
I also tried:

Code:
navigateToURL(headlink, "self");
And I tried:

Code:
navigateToURL(headlink, "_self");
Not sure what else to try.

NavigateToURL - In Same Window Not Popup?
I have this code:


Code:

// handlers
private function nav1Click(event:MouseEvent):void
{
trace("nav1Click");
var adobeURL:URLRequest = new URLRequest("index.html");
navigateToURL(adobeURL);

}
//
It opens the new URL in a blank window, anyone know off the top of their heads how to set the target to self?

Thanks, Dvl

Redux: NavigateToURL & Pop-up Blockers
Searching this forum I've read a few threads on this topic, but none that resolve the issue. Is there still no way to successfully open a new window in a browser without triggering the now built-in pop-up blockers (like firefox for example).

This doesn't work:

ActionScript Code:
NavigateToURL(new URLRequest("http://www.google.com"), "_blank"); // neither universal nor local links work

How are we supposed to link externally, besides using htmlText? Is there a way to use the htmlText anchor event capability to trick a hidden textfield into thinking that it was clicked? I wonder why this capability is so limited..

NavigatetoURL Issues In Browser
I'm putting together a video page for a website. Everything works fine when opened with flash player, but when I've tested the SWF in browser windows (IE7 and Firefox) the button linking to the main site's home page doesn't function at all. All the other controls work perfectly

Heres the relevant code


ActionScript Code:
function gotoFaiths(event:MouseEvent):void
{
    var faithsURL:URLRequest = new URLRequest("name of website is here");
    navigateToURL(faithsURL,"_self");
}

home_link.addEventListener(MouseEvent.CLICK,gotoFaiths);

I've adjusted the browser security settings already

Any advice please?

I'm new to this, so it could well be something obvious

Cheers

Pass Vars With NavigateToURL()
I want to use navigateToURL() to go to a page but I also want to pass that page some POST vars, is this possible?

Thanks!

NavigateToURL In A Costum Class
Hi - I hope this problem will seem quite easy to you guys:
I've created a drag and drop game with af Costum Class that extends movieClip. When all the pieces are in place, a button "Go on" turns up, which calls a function "goOn":

ActionScript Code:
if(_currentPieces >= _totalPieces)
                {
                    trace("done");
                    _button = new mcButton();
                    addChild(_button);
                    _button.x = 1246;
                    _button.y = 536;
                    _button.addEventListener(MouseEvent.CLICK, goOn)
                    _button.buttonMode = true;
            }

I want the goOn function to open up an URL:

ActionScript Code:
private function goOn(event:MouseEvent):void
            {
trace("the button works")
navigateToURL(link);
        }

I've did write:
import flash.net.URLRequest; and
private var link:URLRequest = new URLRequest("http://www.xxx.com");

If I comment out the navigateToURL(link); it all works beautyfully. But when I remove the comment and try to make the button link to the web page, I get the compiler error "1180: Call to a possibly undefined method navigateToURL. What's wrong?

Problem With NavigateToURL To A Certain Frame
Hi!
I'm kinda new with Flash but I've managed to create a menu for a homepage. Now when I click on one of the menu links - the page opens up in a new window.
But I don't want that at all.
I want the page to open up in another frame called mainframe.
I've tried a number of things already; changing from "mainframe" to "_mainframe" and back, trippelchecking that the frames name really is mainframe so there's no typo. I've also changed the name of the mainframe both in the htmlfile and the code but that didn't work either.

Please help!
Here's my code:

1. var linkabout:URLRequest = new URLRequest("about.html");
2. //...//
3. function aboutClick(event: MouseEvent):void
4. {
5. if(subDown[1] == true)
6. {
7. //true = submenyn är nere o ska upp
8. subAbout_mc.gotoAndPlay(15);
9. stage.addEventListener(Event.ENTER_FRAME, subUpAbout);
10. }
11. else
12. {
13. //false = submenyn är uppe o ska ner
14. navigateToURL(linkAbout, "_mainframe");
15. btnHit[1] = true; //visar att det är denna sub som ska ner
16. checkSubDown();
17. }
18. }

GetURL And NavigateToURL Not Working
Hi, new to scripts in Flash, using MX2004 on Flash 7 and latest Flash Player.

In a simple symbol in the swf file, it is set to link to Google. When previewing in browser IE7 or FF both latest updates, the active area of getURL shows as the cursor changes to a hand, but on click or release or over it will not link out, nothing happens, no error msg, nothing.

I have scoured many topics on this. I changed the swf html file to make the value of script access to 'always' for both cases of it. I have tried "_blank" and parent and self. My AS 2 code is

on (dragOver) {

//Goto Webpage Behavior
getURL("

Will The NavigateToURL() And SendToURL() What Is The Difference?
In flash.net package:

Will the navigateToURL() and sendToURL() What is the difference?

Thanks. ^_^

NavigatetoURL Is Not Working Properly
I am using a single command getURL in my project It is a simple Menu template that has some animated buttons.On clicking they will get the required URL.I am using Flash 9 that is AS 3.0 version.
At first the Links are not working in IE and working best in Mozilla.I found that a tag in OBJECT embed statement.allosripaccess= always.then It was solved.Now It is causing problem in Mozilla new version 3.0.The animation is working.But that navigateToURl is not fetching the required Web pages.The Links are silent.No action is there.I am unable to scratch the Mystery.
If Anybody could solve it, i am so thanfull.From the begening the getURL is a rough function in flash ActionScript Kit.Now in As 3 only name is changed.I don't know Why the developrs of ActionScrip Left it with such ambigous functionality.

Variable Encoding - NavigateToURL
Hello, I am sending data to a CGI script from within a SWF.
I have allocated an email address string to an URLVariables object which forms the data property of a naviagteToURL function.
The navigatetoURL function calls the CGI Script whilst submitting it's data component.
The problem is that when the client uses Internet Explorer to do this, the CGI script cannot interpret the submitted data correctly. Firefox users have no problems at all.
Has anyone else encountered problems with Internet Explorer and the submission of variables ?

1180 Error On NavigateToURL
I'm trying to understand why I get the error "1180: Call to a possibly undefined method navigateToURL." when I use the following code:







Attach Code

public function nowPrint(evt:MouseEvent) {
var url:String = "javascript:window.print()";
var req:URLRequest = new URLRequest(url);
navigateToURL(req, '_self');
}

NavigatetoURL Opens Dreamweaver
why doesnt this open in my web browser when testing? its opens dreamweaver and sits... is it a pref I have somewhere?









Attach Code

home_btn.addEventListener(MouseEvent.CLICK, powerClick2);
function powerClick2(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.cnn.com"));
}

Probem With Mailto NavigateToURL
I have a problem doing an email link, this is my code

var myEmail:String = "mailto:roxa@ixtaparent.com";
contactBtn.addEventListener(MouseEvent.MOUSE_UP,function() {
navigateToURL(new URLRequest(myEmail), "_blank");}
);

It works fine with Firefox, but when I use explorer, it does open the Outlook, but it also opens a browser windows and sends me this:
Navigation to the webpage was canceled

What you can try:
Retype the address.

Copyright © 2005-08 www.BigResource.com, All rights reserved