ActionScript 3.0 :: Goto URL On Button Click, With Parameters
Aug 10, 2009
I am trying to make a series of images act like buttons, where each button opens a new browser window with a url of my decision. I have put in the images, converted them to symbols (buttons) and given them an instance name.
Now, the AS3. The following works for me:
Code:
btn_bent.addEventListener(MouseEvent.CLICK, buttonClickHandler_beton);
function buttonClickHandler_beton(Event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.hattingks.dk/Default.aspx?ID=6587&ProductID=9866200&VariantID=&GroupID=vogne"));
}
But I wouldn't want to make a new function for each button. I have tried to extend the function to take two parameters like:
Code:
buttonClickHandler_beton(Event:MouseEvent, www:String):void
View 9 Replies
Similar Posts:
Jan 29, 2006
I need help with the 'If' statement I want it so when i click a button till the socre gets to 5 I want it to go to another frame.
View 8 Replies
Feb 10, 2011
i am doing a simple project in which i have 2 frames in the main time line and a movieclip in the first frame and a button.i have something else in the second frame.when i click the button the movieclip should start after it ends the timeline should move to second frame and stop.
View 7 Replies
Aug 19, 2004
How do you make it so that when you click on a button named "hyperlink" it goes to a certain url?
View 5 Replies
Apr 8, 2011
I have four scenes, it loads on the first scene. I click the button which sould go to scene four but it goes to scene 2.
View 2 Replies
Oct 21, 2011
I have created a flash with five movie clips. I want when I press each of them to go and play specific frames on the main timeline? How can I do that?
View 1 Replies
Oct 28, 2004
I've got 10 keyframes with a image on each one. When the user clicks the button i'd like it to go to a random keyframe.
View 2 Replies
Mar 25, 2010
I've seen various games where by when you start the game it gives you a scenario and 2 boxes to click, if you click a you go to frame say 57 and if you click b you goto frame 58
[code]...
View 1 Replies
Mar 3, 2011
I'm learning AS3 and I can't get this to work for me. In AS2 I would add a unique var to my buttons. If you clicked any of them they would just play() the main time line. Then when they got to the next keyframe it would look for the var and then go to the corresponding keyframe. How do I do this in AS3?
View 2 Replies
Jun 17, 2011
Dyamic text box timer problem?
var score:int=0;score += 10;
addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void{ mytextbox.text = String(score);}
on first click it adds number 10 then it doesnt goto 20 on the next clicks?
View 3 Replies
Aug 3, 2009
I'm new to actionscript and I've got this problem.Hypothetically, I have Button 1 and Button 2.When I click Button 1 the file goes to frame 10.What I need is that when someone clicks Button 2, Button 1 instead of go to frame 10, go to frame 20.
View 2 Replies
May 22, 2010
How can we generate a Mouse click using X and Y parameters?
We obtain the variables for position x and y for screen/stage position from a C Sharp program, and we need to generate the click within flash.
We have already several objects in the FLA file that have MouseEvent.CLICK listeners on them. But we are unsure how we can generate a Mouse Click using parameters (variables) Position X and Y.
We have this problem because two different programs comunicate to each other and we need to simulate the mouse click from the information that C-Sharp gives.
This is the function that we have build so far for that section.
function bubblepop(posx:int, posy:int, PlayerNumber:int):void
View 8 Replies
May 12, 2010
Lets say i have a button on frame 1. And if you press it normal, you ll get to frame 2. But then if you click it on another way, you ll get to frame 3. How do i do that easy?! With another way i mean like shift click or ctrl click or is it an easier way?
View 3 Replies
Apr 7, 2009
I have this custom right-click menu. I need to call the reactOnClick() function with a specific parameter when clicking a specific right-menu item. I want to avoid multiplying the function for each right-click item.
Code: Select all//set up the custom right-click menu
rcnMenu = new ContextMenu();
//the value below is here just for testing purposes,
//the actual value could be anywhere between 3 and 13
var numberOfItemsTakenFromXml:Number = 5;
[Code].....
View 1 Replies
May 7, 2009
This will work:
Code:
addVolvo.addEventListener(MouseEvent.CLICK, addCar);
function addCar(evt:MouseEvent)
{
[code]...
... but I want to pass the a value when calling the function:
Code:
addVolvo.addEventListener(MouseEvent.CLICK, addCar(classVolvo));
function addCar(evt:MouseEvent, newClass:Class)
{
var car1:Car = new Car( 1, 1, classVolvo)
[code]...
This won't work. Because it then just passes the Class and not the MouseEvent. What should I write in the addCar(...) call function? Ie how to I manually pass an MouseEvent?
View 5 Replies
Jul 22, 2009
I have "inherited" some projects. One question I have is about a project that directs a user to a particular HTML page when a button is clicked. I have searched through the Actions and Behaviors and I can find no reference to the page it currently calls so I don't know how to change the page activated.
View 4 Replies
Aug 18, 2011
i created a two layer in time line in one layer there is a movieclip called mc1. In the same layer in 15th frame i have another movie clip mc2. Inside the movieclip mc2 i created another movie clip at frame10 now if i clik the the mc1 on first frame The movie clip should goto and stop at tenth frame
View 4 Replies
Jan 3, 2010
im creating a website, and i have scene 1, which is an enter page to the website, with a button set to 'goto and play scene 2' but it doesnt, it plays scene 3, and then i cant get a button to goto and play scene 2 either.
View 6 Replies
Aug 4, 2009
I am trying to add the following action to a rollover button: on (release) { gotoAndPlay(", );}
The buttons are in the button layer.
For some reason the file wouldn't attach, but can be found at this address: [URL]
View 1 Replies
Mar 12, 2011
At the end of a Movie clip sequence I have a button to go back to the main timeline, I want this button (accueil_btn) to go to the label: start Have try to put the label name between " " or ' ' But I always get this error : TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul. at jeu_22f_fla::MainTimeline/frame1()
[Cdoe]...
View 5 Replies
Feb 23, 2011
I have invisible buttons on a movie clip that is loading swfs onto a parent movie clip. I hope I am current in the terminology. Are a parent and root the same? Is saying root absolute and parent relative? I'm digressing. So, this this._parent.gotoAndPlay("contact form"); is going to the keyframe named "contact form" and it will stop there. What I want to happen, is, I want the other invisible button named aboutmeMC2 to go back to the keyframe named "skip" so my contact form will no longer show up and it will load the external swf.
[Code]...
View 5 Replies
Sep 15, 2011
I'm pretty new to AS3 but I want to get my buttons to play the same movie then go to their button function. i.e., Picture button > play movie (same as all buttons) > picture frame.
This is the code on my buttons
ActionScript Code:
stop();
import flash.display.MovieClip;
import flash.events.MouseEvent;
var currentButton:String;
[Code] .....
Then at the end of the movie I tried using a variable to link the button to its frame
ActionScript Code:
stop();
if (currentButton == name) {
content.gotoAndStop("music");
} else if (currentButton == name) {
content.gotoAndStop("book");
} else if (currentButton == name) {
content.gotoAndStop("stereo");
}
I know the scripts messed up but not sure I really get the variable thing as yet.
View 2 Replies
Jun 23, 2008
I have a parent MC with all my content called GUI_MC, and on my timeline I have a Frame labelled "PAGE"
Within the GUI_MC I have a another MC for my navigation (NAV_MC)
In NAV_MC I have a button which I would like to gotoAndPlay the frame "Page" on the GUI_MC
Heres my button code:
on (release){
gotoAndPlay("PAGE");}
What do I need to add to make it goto the parent MC?.
View 1 Replies
May 31, 2002
How do i use actionscript to make my button goto another page on my website?
View 4 Replies
Dec 17, 2009
I'm having a memory lasp. I trying to write for each button to goto and play at a label. what the correct code for that is please.ActionScript 3.
View 4 Replies
Jul 22, 2010
I have a splash page with a logo. When the logo (splash_btn) is clicked I want it goto the site (frame label: home). All my code seems to be right but the button doesnt work.
[Code]...
View 3 Replies
Jul 12, 2009
I need the event button to go to one more tellTarget ("/popup_ I Have 5 popups Now I need one more [URL]
View 1 Replies
Jan 23, 2005
I'm trying to have a button go back to the main timeline and then goto another mc nested in another mc. For some reason it the output section when i test this says the following...Target not found: Target="_root.printmc" Base="_level0.instance8.instance29" Here is the script I have on the button.
on (rollOver) {
gotoAndPlay("move");
}
on (press) {[code]....
View 4 Replies
Jul 27, 2009
I have a movieclip playing and when I click a certain button I want the movieclip to first play an "outro" animation (which is also inside the movieclip) then go to the real target of the button. For example, I am at the Homepage of my website then I click on the Contact button. The homepage will first go to Homepage's outro animation then go to the Contact page. I need the button to recognize the page/clip being played and the page it will go to.
View 6 Replies
Aug 27, 2005
What im trying to do is play a movie clip between frames. So say we have two menus, when you are on menu 1 and you click the button for menu 2, a short movie clip plays and then you stop on menu 2. I realise I can do this by putting the movie clip on the main scene timeline, but is there anyway i can put it on the button? I think the action script would be something along the lines of "On release play MovieClip and goto frame X" As i said i want the movie to play as an almost filmic transition between menus, with a fade up and then out (Have got that bit sussed using the alpha controls)
View 3 Replies