I'm trying to put a label and an image on a UIComponent, side-by-side. I want to use UIComponent for efficiency reasons, and the entire component is more complicated than just a button with an icon.
I'm trying to get a click handler on ther entire UIComponent so that when a click happens on either the label or the image, the same [click] event handler is called. If I add a click handler on the root component, it works, but when I introduce space between the label and the image, the space between them becomes un-clickable. I produce the space by using the move(x,y) method for the label and the image with a small gap between the x/y coordinates.
I am new to Flex. What I am looking for here is adding a click handler on all the items created by a SkinnableDataContainer. I tried several things that didn't work, and I have no idea what is the right way to do it.
<s:SkinnableDataContainer id="teamList" itemRenderer="TeamSummaryRenderer"> <s:dataProvider><s:ArrayList> <fx:Object teamName="A super team 1"/> <fx:Object teamName="A super team 2"/> <fx:Object teamName="A super team 3"/> </s:ArrayList></s:dataProvider> </s:SkinnableDataContainer>
Furthermore, I don't want to declare the handler in my custom TeamSummaryRenderer component. I would prefer that the handler code stays at application level.
I have some images I would like to display in TileList in Flex. My TileList dimensions are 2 columns by n rows. What I want to do is to display the first item (row 1, column 1) empty and not clickable, and to start displaying my items from row 1, column 2.I also wonder when I create click event for the same TileList, is there a way get an index of clicked element?
add a click event handler to the vertical axis (or any axis) of a barchart in flex? If I add the handler to the BarChart itself, it looks as though the event doesn't fire unless you click on the actual chart, not the axes.
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?
How would I make an image I load using AS3's loader class into a button with an event handler on it? Below is what I have started. And below that is my error I get when I click the message.
AS:
//call function that starts loading my image callButtons(); function callButtons():void {
[code]....
the error I am getting when I click the spanish.png on the stage is: ArgumentError: Error #1063: Argument count mismatch on MyVideoPlayer_CS4_fla::MainTimeline/playSpanish(). Expected 0, got 1.I NEEDED TO ADDED evt:MouseEvent
I've got a bar chart with some elements.values as this:
[Code]...
This doesn't work, although the openflashchart doc says Each dot can have its own on click event. and Don't forget that all charts can have on click events
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?
Is there an event that is dispatched when a text input gets clicked (i.e. to add text), but not after text has been added, simply when it is clicked? It won't have changed, and text won't have been entered.
I need a few pointers on how to create multiple buttons programmatically with different event handlers, or rather: differently parametrized event handlers. My real use is a bit more complex, but it comes down to this: I need a button that can delete itself upon getting clicked.
var Buttons:Vector.<Button> = new Vector.<Button>; var newButton = new Button; var int = Buttons.push(newButton);
I have a couple of Sprites on my screen and I want to write a single event handler to handle the double click on any of those Sprites. The following approach works for every event type except DOUBLE_CLICK:
[Code]...
To make it work, because in my application I will have lots of Sprites. In my opinion, a single event and the target property are more efficient than hundreds of event listeners. Am I right or should add event listeners to every Sprite?
I am learning Flex and have an image I would like to changed on mouseover, and switch to another state on click.I do not want to use any of the buttons available in Flex.Does anyone know th code to achiev what I want?
I have loaded a jpeg image in flash. Now I need the handler after the loading complete. I have used ActionScript Code: var imageLoader:Loader = new Loader(); var req:URLRequest=new URLRequest(arr[0]); imageLoader.load(req); mc.addChild(imageLoader); imageLoader.addEventListener(Event.COMPLETE, image_func); function image_func(e:Event):void { trace("image laoded complete"); } The above code is not working for loading complete.
I would like to know how to make it so when you click a button, it goes to a different frame within a MOVIE CLIP. Kind of like gotoAndPlay but not a frame in the timeline. I would like it to move to a different frame in a movie clip.
I'm trying to find out how to make a simple image gallery which changes image upon a mouse click on a button, when a button is pressed I want the image to slide in from the left into the viewable area and then when another image is selected I want the previous image that was viewed to remain in the screen and then the new image slide across over the top to replace the image.
I can get the images to slide across from the left upon a mouse click however I can't change the layer order so if image 6 is viewed and then I click to see image 1, the image will slide into place however it will be below image 6 so therefore not viewable.
I don't have an example of what I'm after but I hope my explanation was good enough, I've seen this been done in javascript but I have to use flash and am unable to replicate the effect I'm after
I attempting to make a slideshow like the one on this page: [URL] But i was wondering if it is possible to change the code so that if you click on the main image, another image could come up next to it? (I'm making a portfolio site, and i want people to click on one of the main images to then see a detail image next to it).
I want to extend my function to a better design to where I can pass a canvas object into so I don't have to write N functions.. I'm not sure as how to do this properly I've come up with a naive design with a switch but even then if I add another canvas I still need to write new code for the new canvas.
function fadeCanvasOut(event:TimerEvent):void { canvas1.alpha -= 0.1;
my flex application sends a few concurent requests on startup. Sometimes it takes a lot of time to fetch them all so I've set them requestTimeout param to 5 secs. Additionally, I've defined a method that handles fault events. I'd like to resend a request when timeout occurs.It doesn't work though. Could you take a look at the code?
protected function fatalErrorOccuredInfo(event:FaultEvent):void { // get the operation
I'm loading some images from a database using a PHP script through CodeIgniter, but when I try to add an event handler to do some stuff with these images, Flex compiler is showing me an error:1180: Call to a possibly undefined method cloneCar.Why I can not add an event handler in this context?
I have a dynamic image gallery that pulls the pics into a movie clip and adds them to the container (slider) The issue i am having is that when i click on this i am essentially clicking on all the items collectively and i would like to be able to click on each image seperately...
I'm trying to makedress up game using flash cs5 (i'm new to all this so bare with me), and i have the body but i want to change the skin colour with a click of a button, i have 4 skin colours that i have ready but i'm not entirely sure how i can do this,
this is the code i got from a tutorial....here the images are loader and when the mouse is over each image the CAPTION is shown under the image in a text box. but what i need is...i want the CAPTION to appear when i click on the image(not on mouse over), but i cant find any mouseover event here as well.