GetURL not working
Hi,
I'm a bit stuck at the moment with using a button in Flash 8
to launch a new URL in the browser.
This is what i've done (after searching the web for answers):
- Created my button (yes, it has the proper "button" icon
- Selected the button and gone to Actions
- Turned on Script Assist
- I've added the getURL function for on (release) and entered
my URL (i've tried multiple URLs to see if that was the issue)
- Published the SWF
As I said, I launch the published Html file and click on my
button, but nothing happens.
I can't find any explanation for this. Can someone help at
all?
Really sorry if this is a really simple thing - I just can't
figure it out.
Thanks in advance for any help.
Chris
I would upload the .swf to a server somewhere, and test it
there. Sometimes local environments cause problems with getURL.
Also, pop-up blocker can cause issues. Check those when you get a
chance.
Similar Messages
-
GetURL not working in IE 8 or Firefox 3
I am trying to create a button which links to another website upon clicked. My code is as follows:
on(release) {
getURL("http://www.adobe.com", "_blank");
However, this does not work as the button act as if no event has been triggered. I am using Flash CS4 and my movie was exported for actionscript 2. I have attached the fla for your reference. Thanks in advance.I'm going through Classroom in a Book for ActionScript 3.0 and I'm having the same problems. I beat my brains out trying to figure out why my simple link to the Flash site wouldn't work, only to find out the completed files didn't work either. They do seem to work in Safari so I'm guessing it's some kind of security setting ? It lauches the browser but just sits there without opening any URL.
Anyone got an answer for this ? -
Geturl not working of ferris wheel effect
Hi,
Thanks to Rob i have managed to get the effect i want and he
has kindly given me the code to add a geturl to each of the images
on the ferris wheel effect. The only thing is that when i view it
it does not work so maybe i am missing somthing, see what you guys
think:
// create an onRelease function for each of the movieClips in
the
//objectsInScene array...
for (i in objectsInScene) {
objectsInScene.onRelease = function() {
useLink(this);
// this function will figure out which pane was clicked on
and execute a
//getURL for a specific URL...
//substitute your own urls...
function useLink(thisOne) {
switch (thisOne) {
case theScene.pane :
getURL("firstURL.html", "_blank");
break;
case theScene.pane1 :
getURL("secondURL.html", "_blank");
break;
case theScene.pane2 :
getURL("thirdURL.html", "_blank");
break;
case theScene.pane3 :
getURL("fourthURL.html", "_blank");
break;
case theScene.pane4 :
getURL("fifthURL.html", "_blank");
break;
case theScene.pane5 :
getURL("sixthURL.html", "_blank");
break;
case theScene.pane6 :
getURL("seventhURL.html", "_blank");
break;
case theScene.pane7 :
getURL("eighthURL.html", "_blank");
break;
case theScene.pane8 :
getURL("ninthURL.html", "_blank");
break;
case theScene.pan9 :
getURL("tenthURL.html", "_blank");
break;
case theScene.pane10 :
getURL("eleventhURL.html", "_blank");
break;
case theScene.pane11 :
getURL("twelvthURL.html", "_blank");
break;
case theScene.pane12 :
getURL("thirteenthURL.html", "_blank");
break;
break;
case theScene.pane13 :
getURL("fourteenthURL.html", "_blank");
break;
case theScene.pane14 :
getURL("fifteenthURL.html", "_blank");
break;
default :
trace ("uh oh");
Any suggestions please post.
Thanks,
NeilThis is all of my code:
// create a scene movieclip to contain all 3D elements
// and center it on the screen.
this.createEmptyMovieClip("theScene", 1);
theScene._x = 290;
theScene._y = 220;
// now we'r going to create an array to keep track of all the
// objects in the scene. That way, to position all the
objects
// you just need to loop through this array.
objectsInScene = new Array();
var paneArray:Array = ["pane", "pane1", "pane2", "pane3",
"pane4", "pane5", "pane6", "pane7", "pane8", "pane9", "pane10",
"pane11", "pane12", "pane13", "pane14"];
var paneArray:Array ;
paneArray[0] = "pane";
paneArray[1] = "pane1";
paneArray[2] = "pane2";
paneArray[3] = "pane3";
paneArray[4] = "pane4";
paneArray[5] = "pane5";
paneArray[6] = "pane6";
paneArray[7] = "pane7";
paneArray[8] = "pane8";
paneArray[9] = "pane9";
paneArray[10] = "pane10";
paneArray[11] = "pane11";
paneArray[12] = "pane12";
paneArray[13] = "pane13";
paneArray[14] = "pane14";
// no camera, but a rotation will be needed to keep track of
the
// spinning involved (though its the same as the camera)
spin = 0;
// focal length to determine perspective scaling
focalLength = 250;
// the function for controling the position of a friend
displayPane = function(){
var angle = this.angle - spin;
var x = Math.cos(angle)*this.radius;
var z = Math.sin(angle)*this.radius;
var y = this.y;
var scaleRatio = focalLength/(focalLength + z);
this._x = x * scaleRatio;
this._y = y * scaleRatio;
this._xscale = this._yscale = 40 * scaleRatio;
// on top of the normal scaling, also squish the
// _xscale based on where in the rotation the pane is
// since you would be looking at its side when at a z
// of 0, it would be at its thinnest which would be
// 0 since its a completely flat pane. So for that,
// we can use the trig function of z (sin) to squish the
// _xscale based on its position in z.
this.swapDepths(Math.round(-z));
// attach each pane in a loop and arrange them in a
// circle based on the circumference of the circle
// divided into steps
angleStep = 2*Math.PI/15;
for (i=0; i<15; i++){
attachedObj = theScene.attachMovie(paneArray
, "pane"+i, i);
attachedObj.angle = angleStep * i;
attachedObj.radius = 160;
attachedObj.x = Math.cos(attachedObj.angle) *
attachedObj.radius;
attachedObj.z = Math.sin(attachedObj.angle) *
attachedObj.radius;
attachedObj.y = 30;
attachedObj.display = displayPane;
objectsInScene.push(attachedObj);
panCamera = function(){
// rotate camera based on the position of the mouse
spin += this._xmouse/4000;
// Now, with the camera spun, you need to perform the
rotation
// of the camera's position to everything else in the scene
for (var i=0; i<objectsInScene.length; i++){
objectsInScene.display();
// make each figure run backAndForth every frame
theScene.onEnterFrame = panCamera;
// create an onRelease function for each of the movieClips in
the
//objectsInScene array...
for (i in objectsInScene) {
objectsInScene.onRelease = function() {
useLink(this);
// this function will figure out which pane was clicked on
and execute a
//getURL for a specific URL...
//substitute your own urls...
function useLink(thisOne) {
switch (thisOne) {
case theScene.pane :
getURL("
http://www.totalamber.com/default.htm",
"_blank");
break;
case theScene.pane1 :
getURL("secondURL.html", "_blank");
break;
case theScene.pane2 :
getURL("thirdURL.html", "_blank");
break;
case theScene.pane3 :
getURL("fourthURL.html", "_blank");
break;
case theScene.pane4 :
getURL("fifthURL.html", "_blank");
break;
case theScene.pane5 :
getURL("sixthURL.html", "_blank");
break;
case theScene.pane6 :
getURL("seventhURL.html", "_blank");
break;
case theScene.pane7 :
getURL("eighthURL.html", "_blank");
break;
case theScene.pane8 :
getURL("ninthURL.html", "_blank");
break;
case theScene.pan9 :
getURL("tenthURL.html", "_blank");
break;
case theScene.pane10 :
getURL("eleventhURL.html", "_blank");
break;
case theScene.pane11 :
getURL("twelvthURL.html", "_blank");
break;
case theScene.pane12 :
getURL("thirteenthURL.html", "_blank");
break;
break;
case theScene.pane13 :
getURL("fourteenthURL.html", "_blank");
break;
case theScene.pane14 :
getURL("fifteenthURL.html", "_blank");
break;
default :
trace ("uh oh");
} -
I have this simple code on a button and all seemed to be
working well until I cut the movie to CD. From the CD I click on
the button and nothing happens. I am not sure what additional
information to provide so please ask me for the whatever you may
need to assist. Thanks in advance.
on (release){
getURL("docs/tm9-2815-257-24.swf","_blank")
}Hi
Having the same problem here...
You can't use absolute path because you dont know drive letters, you can't infere CD is grabbing D: letter, or E:
Relative path is not working for me too, dunno why :/
i'm working in a CD too, but my animation is having clicks only, so i tried
on(release) {
getURL("./33903.htm", "_self");
my flash file is in that folder, one level up, not working thought XD -
Javascript calls via getURL not working anymore
After upgrading to flash player 9,0,115,0 a simple call like
getURL("javascript(alert'message')); doesn't work anymore on
Internet Explorer (it fails without any error in policyfiles.txt,
but it still work on Firefox). My IE version is 7.
I can't use ExternalInterface 'cause i need to publish as
Flash Player 7 AS2.0.
Any comment or suggestion?I have a similar problem. When running a local HTML file,
using IE7 and FP 9,0,115,0, all the getURL function calls cease to
work.
If I downgrade to FP8, still using IE7, everything works.
If I downgrade to IE6, still using FP9.0.115.0, everything
works.
If I load the HTML via HTTP (instead of local), using IE7 and
FP9.0.115.0, everything works.
If I use Firefox, with FP9.0.115.0, everything works.
So, the function calls fail only when the swf is contained on
a
local HTML file, using
IE7, and
FP9.0.115.0. The problem is, most of our customers have that
software profile, and all of them need to load the content locally
(its very heavy for network transmission).
All the getURLs are like this:
getURL("javascript:someFunction()");
We're setting the 'allowScriptAccess' to 'always'.
Also, if we put the OBJECT tag inside the HTML (instead on an
external JS file), the function calls still do not work. -
HELLLLLLLP! GetURL not working!!!
Hello All,
I'm working in CS3. and have created buttons using the
following code:
myButton_btn.onRelease=function(){
getURL("
http://www.arcticfalls.com/home-Water.html/",
"_self");
The page is not found when clicked. Here's what it is going
on in the address bar.
http://02aa6aa.netsolstores.com/page-not-found.aspx?404;http://www.arcticfalls.com:80/home -Water.html/
Page Not Found
The page you have requested cannot be found or has been
removed. Please use the menus provided to navigate this store.
Seems it is adding a :80 after the .com.
Any ideas... or am I using the wrong code.
This worked prior to adding the full link to page:
myButton_btn.onRelease=function(){
getURL("
http://www.arcticfalls.com/",
"_self");
Direct links to website work... why is the direct link not
working?
It used to work the same way a couple versions back.
Any help is appreiciated.
Thanks,
dbrox08It should be like this:
myButton_btn.onRelease=function(){
getURL("
http://www.arcticfalls.com/home-Water.html",
"_self");
The "/" shouldnt be in the end of the URL.
/ Pinnennet -
Button with GetURL not working
HI,
I have made a button symbol (trying to make a skip intro
button) which is just unselectable text. I have made all 4 states
including the hit state.
I have used the either
on (release) {
getURL("who.html", "_self");
or
getURL("who.html", "_self");
Nothing works when i click the link,. I know the button works
because my over state happens.
I'm sure I'm missing something simple. I have done this all
the time and I actually have a getURL that works but its not on a
button, its just at the end of the flash.this is a scope issue, unless the swf file is mounted online,
it wont' be able to open a relative path. If you want to test the
swf from your local machine, mount the 'who.html' online and then
use a fully-qualified path as in:
getURL( '
http://www.thedomain.com/who.html'
, '_self');
(if in the root directory folder) -
GetURL not working without WWW
Hi there,
I have created one website www.slcc.sg.
Problem is I type www.slcc.sg , links its work
but I type
http://slcc.sg, all link are not
working,
please tell me whats problem this
Thanks,
Regards,
Darpani don't see a problem.
-
GetURL not working on all computers?
I have a banner with a link to a site, but it won't activate
on most browsers. On my computer it works on Firefox or Safari, but
for most other people, clicking has no effect. Maybe it's a Flash
setting, or a Flash player setting? How can I change this so that
when people click they get redirected?
Thank youHi Jean,
Actually, we have an issue with scalable HTML content and smartshapes where smartshapes do not work as buttons in scaled mode.
Please try switching off the "Scalable HTML Content" option in the Publish dialog before publishing. Then it should work.
Regards,
Chinmay -
GetURL not working when swf is loaded into another swf
Ok, I need some help for something relatively simple which
for some reason I've not been able to find any information on at
all?
Hopefully it will be something easy to fix.
Essentially I have the following:
my main movie "Home.swf"
another movie "Sub.swf"
I've loaded "Sub.swf" into "Home.swf" via an empty movieclip.
Within "Sub.swf" I have some links which when clicked call
getURL and open a HTML page in the browser.
But for some reason the getURL isn't working and I believe
its because the getURL is called from a loaded movie within
"Home.swf".
I've tried changing the actionscript to:
_root.getURL('/mypage.html');
_parent.getURL('/mypage.html');
but neither (_root / _parent) seems to work?
Need help here please.
Many thanks.
Kind regards,
M.Hi kglad,
Yes the button is definitely firing ok.
In the "Sub.swf" movie, on the second frame of the timeline
(the first frame is some preloader code) there is the following
code:
imgMC.mascara.onPress = function() {
//trace('mc[activo] = ' + mc[activo]);
switch(mc[activo])
case _level0.imgMC.MC0:
trace('0 - ' + mc[activo])
break;
case _level0.imgMC.MC1:
trace('1 - ' + mc[activo])
break;
case _level0.imgMC.MC2:
trace('2 - ' + mc[activo])
break;
case _level0.imgMC.MC3:
trace('3 - ' + mc[activo])
break;
case _level0.imgMC.MC4:
trace('4 - ' + mc[activo])
break;
case _level0.imgMC.MC5:
trace('5 - ' + mc[activo])
break;
If I run this movie in Flash (ctrl-enter) then the trace
works fine.
But the trace stops working when I run the main "Home.swf"
movie in Flash (ctrl-enter) when the "Sub.swf" is loaded into an
empty movie clip.
And when I change the trace for a getURL and test in a
browser it still doesn't work?
What do you reckon?
Thanks.
M. -
I have a file in the root of a web server and prior to Flash
Player 9 (I believe this to be the culprit) I was able to simply
attach the following code to a button and the file would download
(it will work in Mozilla browsers, just not IE):
on(release){
getURL("file.zip", _blank);
Any ideas?I removed _blank and it works now.
-
GETURL not working in exported movie
I hate to beat a dead horse but I'm at my wit's end. I've
tried everything I have read online and it still doesn't work...
I have created a keyframe at the end of my flash with...
getURL("www.blahblahblah.ca/underconstruction.html");
I export the flash and then in my web page builder I add a
flash to the main site www.blahblahblah.ca/index.html
the flash plays wonderfully but then the next page doesn't
load.
all I want to do is have a webpage come up AFTER the flash
plays.
somebody please help !!!!make sure you put
http:// before www.blahblahblah.ca/index.html
maybe thats why it doesn't work -
GetURL not working without WWW in web address
Been banging my head against this forever. Running a SWF banner running AS2.0. If you view the banner's page with www before it, it works fine. If you visit the url WITHOUT the www the geturl script doesnt work at all
http://www.maxtool.com - works
http://maxtool.com - doesnt work
I've tried changing the allow access setting from domain only to always and I changed the actionscript to be document relative instead of a full link and none of that has fixed the problem.
Anyone ever encounter this?that probably is causing a security sandbox error. those 2 urls look like different domains to flash.
use cross-domain security files to remedy. -
I've been told that a Flash navigation I worked on is not
functioning in IE 5 for Mac. I know what you're thinking... who
uses IE 5 for Mac these days? So anyway, I've been asked to fix it
and cannot seem to find anything with my searches. Maybe I'm using
too many key words in my search. I don't know.
It works in FF, Safari on Mac and FF, IE on PC. I am using
the most recent version of swfObject in the page. I've published to
FP 6 and it's using AS 2.0.
I'm basically just throwing this out there to see if anyone
remembers this being an issue.Just a thought, aniebel, but maybe IE5 can handle SWFObject
script? Have you tried embedding with a <embed> or
<object> tag? Maybe you could set up a JS browser version
reader script and fire it only in that instance? I dunno? -
Array inside getURL not working
I'm trying to put links on multiple images using the titles of the images that I keep inside an array
var imagesTitles = new Array("Image title1", "Image title2", .... );
I'm starting a for loop here and after I replace the empty spaces with hyphens and lowercase the image titles I'm trying to attach a link to every instance like this:
getURL(imageLinks[i], "_blank");
If I trace imageLinks it looks like this http://www.mysite.com/image-title
The browser opens and I get http://www.mysite.com/undefined
What would be the correct way to use getURL with an array?Here is my code:
String.prototype.replace = function(s, r) {
return this.split(s).join(r);
for (var i:Number = 0; i < imagesTitles.length; i++) {
imageLink[i] = imageTitles[i];
imageLink[i] = imageLink[i].replace(" ", "-");
imageLink[i] = imageLink[i].toLowerCase();
imageLink[i] = "http://www.mysite.com/" +imageLink[i] + "/";
trace (imageLink[i]); // trace here shows a list of valid urls
gallery_mc["image" + i.toString()].onRelease = function(){
trace (imageLink[i]); // trace here shows undefined
getURL(imageLink[i], "_blank");
Must be a scope problem but I just started using AS2, I don't know how to fix it.
Maybe you are looking for
-
When you get a apple receipt for itunes songs and you paid with a itunes gift card do they charge you or give you store credit what's store credit is it good or bad or does it charge you if you have a free account with no credit cards at all is it ba
-
I am a new iPad owner with Mac OS 10.4.11 on my desktop. Currently I have iTunes 9.2.1. What do I need to do to be able to sync my iPod settings in iTunes to my new iPad? The newest version of iTunes says I can't install it since it requires 10.5 or
-
How to find table used in java based forms
In R12 how can i find table name used in Java Based forms.
-
WEP wont work but WPA will since 10.4.10 update
Since 10.4.10 update anywhere i go that has a WEP security wont connect no matter what yet if I ask the person to flip to WPA it does work. If i boot a windows laptop WEP connects no worries on any of these various routers. It is very frustrating as
-
Tie this code to a button, if I repetitive press as fast as I can, an error exception would appear in the application. I found that it would not throw an error if I stop the sound when it completely fade out. However, I wish the fade out function