ActionScript 3.0 :: Multiple URL Links In One Banner?
Jun 22, 2011
I'm working on a project for a client and I'm doing something I have never done in Flash. The Flash first loads four images that have been converted to buttons. Those four by itself link correctly, but when I add the code for the next two sets of images the code breaks and none of the links work. I'm not sure what to do. Here is the code for the first two sets of images:
The last two links cause a problem. I get Error 1120 access of undefined object. However, when I click the button and look in the properties box it says Instance of BTN_Adult01 and Instance of BTN_ModelFemale so I'm not sure what the problem is.
I tried to paste my source code but it won't let me because it contains links and I don't have enough posts, but I did attach the file.
I have a banner that I'm creating, it has 5 images that rotate via motion tweening. I've created an invisibile button (and also attempted to create multiple buttons) so that when you click on a specific image it will bring you to that URL. So far I have only gotten it to work for the final URL. No matter which image I click on, it only brings up that last URL.
Here is my code:
btn1.addEventListener(MouseEvent.CLICK, buttonClickHandler1); function buttonClickHandler1(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.google.com")); }
i have created some flash banners with a url embedded in them, so when they are placed on a web page the banner links through to my website when clicked. Fairly simple.But, i tested them on a website on my server to link to another website on the server and they worked fine. When i gave them to a client to embed on their own website (the flash files are hosted on my server still), the links no longer work.
Is this a security issue to stop the links working? i also checked it in linux and the banners worked, but in windows they do not. I dont want the client to have their own local copy of the flash file, as i may update it in the future and dont want to chase up lots of different copies everywhere.
Flash noob here using cs3/as3. I'm trying to create a simple banner which fades between 2 images, looped. (This I can do!). What I'd like is to have each image link to a different url. I've tried changing the images to buttons with the following actionscript:
on (release) { getURL('http://www.mysite.com', '_self'); }
but get the following error: Mouse events are permitted only for button instances even though they are buttons! I thought this would be really simple, but obviously not! Any ideas are gratefully received.
What I am trying to to do with this ad is have two separate URLs to click on. I would seperate the ads but this is what my client wants and I can't figure it out for the life of me!!
I'm having a little trouble with my flash banner. When I click on my button, it opens the link I specified in a new window or new tab, like target _blank in HTML. I want it to open in the same window, so you're still navigating through the site. Here's my button's code: link_btn5.addEventListener(MouseEvent.... goToURL5); function goToURL5(e:MouseEvent):void{ navigateToURL(new URLRequest ("/forums/index.php "));}
I want to incorporate a scrolling image banner into my website, and found a great tutorial on youtube which works well.I can't post a link unfortunately.It is a pretty basic image scroller that has a series of images scrolling across the screen in an infinite loop. Direction is controlled by mouse position (extreme left or right), and it will stop when the mouse is positioned over an image in the center area.Here's the code:
var myVar:Boolean; this.addEventListener(Event.ENTER_FRAME, onEnterFrame); function onEnterFrame(e:Event) :void[code]....
After trying to figure this out through forums such as this for days, it seems that my answer is to use XML (which I do not know, and which I think would require completely starting over).Is there any way to do this in AS3?
Again, I'm a novice user, but understand the basic animation tools of flash to feel comfortable using it as the platform to make this work. I'd like to be able to switch out images/links as necessary, and feel good about my ability to use flash to do that.
I am trying to have multiple links off site but have hit a brick wall. If I have the code listed below, it opens the second link as soon as you open the links page, If I have the"function onLinkClick (evt)", above btn6_btn I end up with the duplicate error message. Is there a way to have multiple link buttons on a page. I have played with this for hours.
I have a flash file with several layers, each composing of a single movie clip which slides in over the layer below it. The movie clips are nothing more than static images. I would like to make it so that each "slide" links to a different URL.I am new to AS3, and I am just getting back on the flash wagon with this little banner rotating project, so I'm a bit confused with why layers, and timeline positioning seem to be effecting the links.I found a few tutorials online, and can manage to make one link on the bottom layer work, but when I try to expand the code and the file to create links from different movie clips on different layers, I run into problems. when I add the action script for the other buttons, the movie will fail to play by it's self on load. I can get this to work with ode:this.gotoAndPlay(1)at the top of the ActionScript But none of the other links work.Here is what I am using for more than one link:
Code: backpacks.addEventListener(MouseEvent.CLICK, myButtonFunction); function myButtonFunction(event: MouseEvent) {
I have a banner that I'm creating, it has 5 images that rotate via motion tweening. I've created an invisibile button (and also attempted to create multiple buttons) so that when you click on a specific image it will bring you to that URL. So far I have only gotten it to work for the final URL. No matter which image I click on, it only brings up that last URL. Here is my code:
What I am trying to do, is to make a flash banner that links to more than one URL. I have looked around for a solution for this problem of mine, but haven't found a thing. I've made banners before, linking to only one URL and that hasn't been a problem. I tried to copy/paste the AS stuff from one layer to another, but that just gave me an error message: 1021: Duplicate function definition
Google pointed out this forum when I was looking for a solution to that problem, and I tried mixing numbers in the buttonClickHandler among other things. Sure enough the error went away, but I still can't get the .swf to to work as I want it to. Now it just exports and lets me know that there are buttons there, but they don't take me anywhere.
I'm trying to pull data from an XML file into a TextArea to take advantage of the scroll bar capabilities.I have two XMLLists, XListCopy & XListURLs. XListCopy is basically a list of words that need to be on their own line. While the XListURLs are the respective links for those words.Since at the moment, I'm using appendText obviously any links will be merged into one. Is there any way to separate each & make each clickable?
I have kind of a follow up question what would the procedure be if I had like a slide show and each slide when you clicked on it there would be multiple links this is the code I have so far: My slideshow instance names are pic_000_mc to pic_004_mc
[Code]....
I know there is a better and more efficient way to do this then to have all five different functions and listeners.
My goal is making a navigation section that is a scrollable box. I thought the easiest solution was to make a dynamic text box and put a scroll bar on it. Worked until it came time to make the links. It is only letting me make one link for all the text. Also I think I want more control for the mouseover look.
I made a flash banner + have photo creds on each photo. I want to make it a link to source to the photographer's portfolio.I've got 5 links for 5 buttons, button1, button2, button3, etc, each is named in the library with a matching name for the instance.I got the link working for the first image, but whenever I try and do it for others I keep getting a message of [code]
SWF functions beautifully on its own (i.e., animations play, rollovers work). However, when uploaded to the server and dropped into the HTML with the proper plug-ins, the links suddenly cease to function. Flash still plays beautifully - it's just the links that seem to disappear. The one browser where the links seem to work 'as is' is Firefox on PC.
I am using the basic but usually effective: on (release) { getURL("http://www.site.com"); }
Sorta-solution:Added "_blank" to the end of the script and this worked in all tested browsers... however, the client wants the URL to open in the same window (they have asked not to provide the actual link). Anyone have a concrete idea as to why and how to fix this?
I have a very simple flash project that I need to be completed tommorow or my head is in the block! I am new to Flash and Actionscript but work well with PHP so do have some idea of what I am doing but, this has left me stumped and in trouble if I don't get it done! Basically my movie is very simple. I have a background and after a short break my first scene flys on with one link then leaves - then the second with a different link, then the third.
I converted all links to buttons and gave them instance names 'button1_btn', button2_btn' and 'button3_btn' and then added my new layer for the action script. Below is the actionscript I used to make the buttons work:
we created thumbnail image gallery slideshow by using action script with auto and manual,. my requirement is , how to include multiple text link in each and every slideshow. below i mention the script code,
I am currently developing a banner that contains 4 buttons. Each of these link to different URLs within the website where the banner appears.
The problem:SWF functions beautifully on its own (i.e., animations play, rollovers work). However, when uploaded to the server and dropped into the HTML with the proper plug-ins, the links suddenly cease to function. Flash still plays beautifully - it's just the links that seem to disappear. The one browser where the links seem to work 'as is' is Firefox on PC.
I am using the basic but usually effective:on (release) { getURL("http:url...); }
Sorta-solution: Added "_blank" to the end of the script and this worked in all tested browsers... however, the client wants the URL to open in the same window (they have asked not to provide the actual link).
I am building a banner ad and I am using Flash CS4. I need it so when someone clicks the banner it takes them to the page in a new window. Its just a a simple URL and I keep getting syntax errors now and I dont know how to do this properly. I have tried these methods.
i created a flash slideshow with pictures of events and link each picture with its own event (ie. each pictures has its own links to the website). I created the fade in and fade out effect using the class motion tween. With the link, I created a layer with a button that has alpha= 0 (so the user don't see it) and then I used code snippet to make another layer with the action script "click to go to url."
When the slideshow goes to the last picture I made it fade out and the first picture of the slideshow would show up and then the slideshow would replay itself (by default?). My goal is to make a continuous slideshow.
When I tested the swf file, the first time it runs, everything is right. The urls and the pictures are in correct order. However when the slideshow replays itself automatically, I notice that the links are incorrect. In the first play, when I click the picture of the event it would open the url of that event.However when the sldieshow replays, clicking the pictures would only open the url of the first event picture. When I click on the 2nd, 3rd, 4th, etc.pictures the browser opens only the link of the first picture of the slideshow.