I have a button labeled 'blueButton' and I'd like to use an anonymous function to handle the click, like so:
blueButton.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void { trace( "-----click detected-----" ); // now do other stuff });
Problem is, the click handler is called multiple times per click. The number of times called seems to be random (sometimes 2, sometimes 4, sometimes 3 etc). could I be missing something in my code, or maybe I set up the button wrong?
also I noticed that it seems to always get called once on the first click. After the first click is when it starts getting called additional times, maybe that has something to do with it?
I created a movieclip animation that only activates when i rollover the movieclip button. I further extended the frames and created another frame animation that i active only when user clicks the button. So i have a roll over/out animation and click animation in the same movieclip in the same layer. Now the problem is that when i click on the button, its supposed to take me to another page, and it does, unfortunately without the click animation. That means after i click on the button its supposed to first finish the click animation and then go to another page. But when i click, it takes me to another page without showing the click animation
SO I tried the If function, but i seem to make a mistake somewhere and i dont know what to do. Now there is no error in script, but onw there is a problem in link, the button finishes the click animation but it does not go to the tarrgeted"about" frame. here's the code
I'm doing a basic site with frame labels on the main timeline whose name corresponds to the btn names. A simple otoAndPlay(evt.target.name); I have a basic navigation setup of 7 mcs with mouse eventlisteners for CLICK, ROLL_OVER and ROLL_OUT.
Does anyone know a better way to do this so when my mcs are clicked they display the rollover content/art? In essence I'm trying to achieve that when the user clicks a btn it goes to that "page" and the corresponding btn stays highlighted. Pretty standard web navigation technique but I just don't know what the best way to do this in flash is and with how my site is setup.
I created what I though was a pretty simple function for a mouse event listener. The funtion goes to a frame in the current movie clip as well as the parent movie clip. For some reason however the first time you click the button, it only effects the parent movie clip. When you click on it the second time, both movie clips are effected. Here is the script,
I know how to make the mouse event work. I know how to make the keypress event work. Now what I can't figure out is how to make one button respond to both keypress and/or mousevent. In other words, a button that you can click or press "enter" for it to work.
This seems really basic but on googling all I can find is basic "how to do a keypress" stuff.
I'm trying to figure out a way to have a wheel that by clicking and dragging in a rotate motion cause's a "highlighted" box above to select over different objects in a horizontal and vertical row. Then from there you press the enter button with your mouse to select the object that is highlighted.
I am still new to swish and flash and the script confuses me at times. I am doing it more for a hobby and to create interactive programs for my daughter to help her learn. I have made a parking ticket machine to help her tell the time and to count money. The problem I am having at the moment is that I am trying to make one button add 30seconds to a text box total every time it is clicked (for example click1 = 00:30, then click2 = 01:00, then click3 = 01:30 and so on). The problem I am having is that I have made an else/if statement to do just this but every time I click the button it just jumps to the last else/if and shows that total. I am trying to think logically but I may be making things more complicated or maybe the scripting is wrong and I need to try something else. Here is the script I have made for you to see and hopefully someone can tell me what I have done wrong.
I have a button to increase the scale of few items. It's suppose to increase the size with every single click. When I click the button continuously having the mouse unmoved and over, it wont increase the size. But if I rool out of the button between every click, then I works. I need to make button function with every click.
CURRENT CODE: on (press) { if(this._root.gmb_mc.rotate_mc3a._width <= 50){ this._root.gmb_mc.rotate_mc3a._xscale += 7; this._root.gmb_mc.rotate_mc3a._yscale += 7; }}
I 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 have a datagrid which contained several items,when i click one row, a panel will show,however, if i have already selected one row and then click some blank place, this panel will also show because there is already a selecteditem,which will be a problem. Then i change this click event to change event, however, there will be another problem, which is if i click the same row, nothing will happend. so is there any better idea when i click a row, a panel shows and when i click the blank place, nothing happened.
make it so when the user clicks on the track the copy scrolls to the accurate place? At the moment you must grab and hold the thumb (handle) to scroll the text.
ActionScript Code: var format:TextFormat = new TextFormat(); format.letterSpacing=50;
I'm trying to start a function from within a click handler that is being triggered when I load some XML, just like this:
Code: function LoadSomeXML(e:Event):void { thumbContainer_mc.addEventListener(MouseEvent.CLICK, thumbClick); } function thumbClick(event:MouseEvent):void { startImgSlider(); } function startImgSlider():void { trace("ok, now you reached 'startImgSlider()' function !!!"); }
The problem is that I cannot reach the startImgSlider() function with the code above. How to do it right. Has something to do with the scopes?
I have read through the help file in Flash but I can't make heads or tails of what they are saying on the matter. Is it possible to call a function on double click?
After parsing some XML to create a vertical project list I'd like to be able to click on the image/icon representing each project and be taken to the URL that's been parsed in as well. Here's the error I get when clicking the dynamically generated Movieclips:TypeError: Error #1009: Cannot access a property or method of a null object reference.at NMD_work_fla::MainTimeline/itemClick()Below is the extracted code pieces related to the onClick function:
When using the class listed below, I am unable to add a CLICK function that will not break the piece. I want to add another tween on CLICK that clears all mcs off of the stage except the e.target, which will have a zoom applied to it... I get my trace fine, but then I am unable to CLICK again on that particular mc, and the proximity begins to break.
I have a weird issue with actionscript 3.0 and I wanted to see if anyone knows what might be going on.I create a UILoader in the root layer. Then on a button click, I set it's properties and once it's loaded, I set the size and all that. It works fine.Then I try to instantiate the UILoader in the button click method and the picture loads up enormous. It never happens when I instantiate the root layer. It always happens when I instantiate it in the button click method.The code is below. Does anyone know why it would do this? I traced all the properties I could think of (xscale, yscale, height, width for both the containing movieclip and the UILoader and they are the same regardless of where it's instantiated
var myStage:MovieClip = new MovieClip(); var stageItem:UILoader = new UILoader(); //Button click function
I have had a look at this link:And this is exactly what I need to be able to click on an image wrapped in an <a> tag which comes from my XML content.I have added my image, added the <a> tag to the image and when I fire it up in AS2 and mouse over the image, the mouse cursor changes to the hand as is meant to.I've added my function, which when clicked on, should call a trace to check that it's working and it's not happening and no doubt it has something to do with the path of where my function sits. I have moved this around now to several places without any joy.If I test this on the root, in a simple scenario, it works. My page however sits on the 6th frame of the root timeline and this is where I believe things are going wrong.
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: 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?
I'm not proud of my subject line, but it was the best I could do.I'm using this while loop to activate the function buttonpressed from one of five buttons named thumb0, thumb1, etc.:i = -1; while (i++ < 4){this["thumb"+(i)].addEventListener(MouseEvent.MOUSE_UP,buttonpresse d);}I want the main timeline to jump to the labeled frame corresponding with the targeted button's numberfunction buttonpressed(evt:MouseEvent):void{MovieClip(root) .gotoAndStop("clip"+[i]);}
I have a slider that is working perfectly, only thing I am trying to now call a javascript function when I click on the thumbnail. I cant seem to get the array to work with the xml file...
i want to know who can teach me or point me to a tutorial or even better a source file when double clicking in a certain movieclip the execute a function.
Basically I have a movieclip with a load of buttons in it which will all eventually lead to different movieclips. When a button is pressed I want a movieclip to appear and play. The movieclip is on the stage.The problem i have is that when i click the link, this error message appears in the Output tab:
Quote:
TypeError: Error #1006: value is not a function. at plumonicconsonants_fla:ulmonicconsonants_1/buttonClick()
So far my code is
Code: import flash.events.MouseEvent; pbtn.addEventListener(MouseEvent.CLICK,buttonClick); function buttonClick(e:Event):void