AS3 :: Use GetURL Function In It?
Jun 6, 2010How do I use the getURL function in AS3 ?
View 1 RepliesHow do I use the getURL function in AS3 ?
View 1 RepliesI'm trying to add a simple getURL script to a simple text button-- should be really simple, right? But when I select the instance of the button on the stage it says the current selection cannot have actions applied to it. This, despite the fact that I am able to open an old .fla that has the same type of button and it does have a getURL action applied. What gives?
Flash version 9.0 (CS3 Professional)
If i'm using the getURL method to call a JavaScript function:
getURL("javascript:myFunction('sections/1.html')");
How do I pass a string+variable as a parameter of that function?:
instead of:
[code].....
I was wondering if there was a way to get a function to run the getURL statement? something similar to this:
function go(){
getURL("www.whatever.com","_blank");
}
If i'm using the getURL method to call a JavaScript function:
getURL("javascript:myFunction('sections/1.html')");
How do I pass a string+variable as a parameter of that function?:
instead of:
[Code]....
What is the correct syntax for that parameter we're passing?
I recently formatted my disk and installed WindowsVista Ultimate. Now, I find that this simple piece of code is not working. But earlier when I was using Windows XP, this code would open a new browser window (in firefox) and automatically prompt me to log into Gmail account, and after I log into gmail I will have this 'userEmail' successfully inserted in the "To:" field (inside gmail)
Code:
var userEmail="myemail@gmail.com"
getURL("mailto:"+userEmail);
Can't figure out why this is not working in my new OS.
How to write the GetURL function to a button in AS3?
View 6 RepliesI have a simple Flash button with the following script attached:
on (release) {
getURL("http://URL/sample.pdf", "_new");
}
And I've also tried this:
[Code]...
my client (Who uses Firefox, on a PC) has to click on the button twice to view the PDF. The first time they click on the button, they have to close the blank window that pops up and then click on the Flash button again to view the PDF. It opens fine the second time. Is this just a PC problem? On my Mac (Safari) it works fine, but (Firefox) seems to want to save the document before I can view it.
I would like to call a jQuery pager function (p) defined as:
function p(page)
{
$('#pitch').load(page);
}
how can I call this function inner swf with method getURL..
note: normally I call it in html tag as:
<a href="#" onclick="p('somefile.php?id=someid');">link name</a>
I can't get my getURL to work. It works when I use "_blank" but not when I use "_self" or "_parent" or "_top" or leave it empty. I've got it right off the main timeline. I've also tried putting it within an onRelease function.
So, this doesn't work:
Code:
getURL("images/aboutus.jpg", "_self");
But this does:
Code:
getURL("images/aboutus.jpg", "_blank");
I'm modifying an mp3 player by flabell, and try to get some buttons to work. However, I can't seem to get the getURL to work, even though it works in other parts of the script. This is my code:
mc.rate1.onRelease = function() {
trace(this.ID);
getURL("[URL]","_blank");
};
The trace goes through fine. Here is the code that works:
Code:
private function downloadRelease(mc : MovieClip) : Void {
var title : String = mc._name;
var index : Number = Number(title.substring(title.lastIndexOf("n")+1,title.length));
getURL(songsSource[index], Main.getInstance().mcAlbums.linksTarget);
}
I'm on a mac with firefox.
how to add a variable to a getURL Javascript function. I have; ActionScript Code: getURL("javascript:JavascriptFunctionNAme(ASVariableName?);"); It works fine when I replace ASVariableName with "1" or some other plain text.
View 5 Repliesi have that header for my navigation here: [url] However I cannot get the getURL command to function properly. You can test it out by clicking on a key meta word (right hand side) than clicking on "home" to take you back.As you will see it does not work.The site is built around Joomla—it's pretty basic and I didn't care for any of the navigational options so I built a flash menu.
edit I can get this to work when I "cmd-return" out of flash and test the .swf - but online it's a no go.
I am trying to use the getURL function to open a new window with a variable URL, but it doesn't seem to be doing what I want it to. Here is the code i am using:
on (release) {
getURL("popup.htm?/projects/"+_root.foldername+"/"+_root.projname+"_1highres.jpg", "_blank")
}
The problem appears to be the question mark. If I remove the question mark it works fine.. but I need to use the question mark because the rest of the info is just information I am having popup.htm interpret
I have a button with some transition/easing on it...and a geturl function. However there is something weird happening, when the button is clicked, it sees the geturl alright, and the browser opens...but cant seem to get any further than that! [code]...
View 1 RepliesActionsctipt code:
on(press)
{
getURL(escape("address.html?0"));
}
This works absolutely fine in Internet Explorer but in Chrome in the question mark is obviously made into "%3F". how I can stop this from happening and still keep it compatible with IE and other popular browsers?
I have a file upload application I built that uses FLASH as a means to transfer file to/from users directories on a server. Once the file transfer has completed I fire a function that includes a call to a javascript function within my page that executes an AJAX refresh of one of the "div's" on my page.
ActionScript Code:
// COMPLETE FUNCTION
fileRefListener.onComplete = function (fileRef:FileReference):Void {
status_txt.text +="<font size="11" color="#E6E6E6"><b>" + fileRef.name + " uploaded.</b></font>
";
status_txt.vPosition = status_txt.maxVPosition;
filesCompleted++;
[Code] .....
And my JS is:
Code:
function handOff() {
new Ajax.Updater('manage_user_info', '/fileTransfer/manage_user.php?client=' + $('users_to_manage').getValue(), { method: 'get' });
}
This works flawlessly in IE6/IE7/IE8/FF3.6/Opera/Chrome/Safari on Windows Machines but for users on MAC's there seems to be an issue. Any particular reason this wouldn't be working in a MAC environment?
I am creating a gallery type site, I am loading xml data externally creating duplicate movie clips and it all works fine, my only problem is I want them to go to a URL, I have one of the nodes with the URL and in my actionscript I am calling a function to getURL on press, the problem is on each separate movieclip it links to the URL of the last movieclip in the stack.
View 1 RepliesI have a simple getURL below and have been looking around for a way to #1 - set a time a time delay#2 - call an external js function#3 - load my page
butMov.onRelease = function () {
getURL("http://www.mysite.com"+myURL);
}
When I use:
on (release){
this.stop();
getURL("page.html", "_blank");
}
Why is it that when that new page window is loaded the background flash window then runs my
on (rollOut){
this.play();
}
function? I am trying to pause the timeline I am clicking from in Flash. If I take this line out (this.play() it pauses, but if I were to go that way how would I start getting my MC to play again when the user gets back to the flash window?
How To Run A Shadowbox Gallery From A Flash getUrl function Call..
This Is What I Have In My Flash:
btn1.onRelease = function() {
getURL("javascript:MyGallery([page1,app1]);", "_self");
}
I want to be able to declare my arguments in flash like so
var page1 = {
title: 'Google',
player: 'iframe',
[Code].....
I have a flash gallery in side my movie I have a next button and a prev button that works just fine. The issue I am having is when you click next and then go back the getURL function no longer works. It might be easier to view the issue. here is the link [URL]
View 1 RepliesI've messed around with XML+FLASH menu systems (downloaded from various Flash resource sites) on a novice level . As in, I know how to modify the XML file to have the content I want and where to rename the XML file in the FLA if need be. But I've never had to actually manually modify any functions within the FLA before. I'm really green when it comes down to diggin' within the Flash coding. Anywho, I came upon this really nice horizontal/glide menu from a way talented flash guru who was nice enough to share his source files with me...
[Code]...
When the movies performs the getURL action, I want the music to continue playing, but the getURL function seems to stop the music at frame 152 (where the getURL action is placed), when I wanted the music to continue to frame 257 (the end of the movie). I hope I've explained this clearly
View 3 RepliesI've got a Vector of ViewToActionMap objects, which have following constructor:
public function ViewToActionMap(_forModule:eModule,
_forAction:eViewAction,
_toFunction:Function,
[code].....
I've created a 'flashvars' tag in my embed code (aid=test), which I simply wish to add to the end a GetUrl statement, contained in within a button (which is on the first level of the flash movie). This is the code I've added to the button...
on (release) { getURL("http://www.platinumselect.com?id="+aid);}
But this doesnt seem to work!? Is there anything else I need to do?
How i can use the function getURL with quotes? The reason that i need to quotes, is tu put a parameter to another function in Adobe Director.[code]...
View 1 RepliesXML test file
<Slides>
<slideNode linkURL="www.cnet.com" jpegURL="images/test1.jpg">test 1</slideNode>
<slideNode linkURL="www.zdnet.com" jpegURL="images/test2.jpg">test 2</slideNode>
<slideNode linkURL="www.pcmag.com" jpegURL="images/test3.jpg">test 3</slideNode>
<slideNode linkURL="www.newegg.com" jpegURL="images/test4.jpg">test 4</slideNode>
</Slides>
In the browser, www.cnet.com, does not work. The value it outputs is: file:///C:/Documents%20and%20Setting...w/www.cnet.com
ActionScript
----------------
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
[code]....
I want 2 open an image in a blank window, when user clicks on the button.I used the following coding to the button:
on (Press) {
getURL("www.domainname.com, "_blank");
}
But the above code is not working , when i click on it.
how to get variable from php and use its value to properly link button in flash?
example:
index.php contains variable VAR1 with value TEST
i need to crate flash with following button
on (release) {
getURL("http://www.test.com/index.php?VAR1=<<here goes the value of the VAR1 from php, which is 'test'>> , "_self");