ActionScript :: Custom Flex/ UIComponent Keeps Getting Painted Multiple Times During A Resize?

Nov 19, 2010

I've created a custom uicomponent and whenever the browser or its specific container is resized, a repaint occurs but the contents of the component get drawn again and again and again...So, if I move the container I'll end up with multiple circles drawn on top of each other but offset depending upon where the container is when the repaint occurs.My updateDisplayList code is below.Do I need to do some sort of clear so that it doesn't contiuously getting duplicated like this?

override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
trace("height: " + parent.height);
trace("width: " + parent.width);

[code].....

View 1 Replies


Similar Posts:


Flex :: Flash - Custom UIComponent Disappearing?

Aug 3, 2010

Extremely frustrated with this. I've created a simple class that extends the UIComponent. I create an instance of this class in a parent class and utilise the 'addChild' method to add it to the parent. I've overridden the 'updateDisplayList' method of the extended UIComponent to add my own drawing routine using the 'graphics' object.

My problem occurs when I start attempt to change any of the following properties (x , y , width, height) either directly or using 'move' or 'setActualSize' because the UIComponent will no longer display - prior to changing any of these properties the object displays fine. I know the object is still there, the 'updateDisplayList' method is still being called (as I'm calling 'invalidateDisplayList' after each change) and it correctly reports the changes.

View 1 Replies

Flex :: Make Custom UIComponent Accessible?

Apr 18, 2011

I added a MXML component in flex and selected the base as UIComponent. I want to make it accessible so that automated testing tools can Access it. I am using TestComplete for automated testing. As TestComplete uses Microsoft Accessibility classes. Now it treat my component as the Graphics.

View 3 Replies

Flex :: Get Width Of Dynamically Created Custom Uicomponent?

Jul 15, 2009

I have some custom components, that derived from UIComponent. I overloaded the updateDisplayList so they have custom look. I've created a layouter that lays out these custom components, but to place them correctly, I have to know the custom componets width, height. They are created dynamically. After all of them created (creationCompleted event fired for every), i try to laying out them, but width/height property is still 0. I am also tried to add them to a canvas, before the layout process.

how to create custom UIComponent that placed dynamically, and get to know the width and height of it.

With the use of the mx_internal namespace I can set width and height (using the internal $width and $height fields), and it looks like it is working. But not so clean/good solution.

View 2 Replies

Flex :: Handling Multiple UIComponent With Single Skin Class

Aug 4, 2011

I have created a simple mxml file with code as follows:
<s:application..........>
<s:BorderContainer>
<s:SkinnableContainer id="firstRow"/>
<s:SkinnableContainer id="secondRow"/>
<s:SkinnableContainer id="thirdRow"/>
</s:BorderContainer>
</s:application>

Now I want to apply different font size, font color and font type and background color on each row i.e each of the three skinnableContainers.Currently I have defined 3 different skin classes for each of row but I think this is a bad programing. I should create a single skin class for outermost container i.e BorderContainer and any how provide different fonts and background color to all the 3 child containers through that skin class. So, is it possible that I can create single skin class that can provide different decorations to each of the child container.

View 1 Replies

Flex :: Datagrid - Use An Image Multiple Times?

Dec 3, 2009

i want to reuse an image multiple times within an item renderer, is it possible to embed the image and then reuse multiple times without having to go back to the server for the image? Is this the most performant solution?

View 1 Replies

Flex :: Result Event Multiple Times?

May 1, 2010

This code is for my login component. I want to get a special string for encrypting my password. This string is given by my authservice. But when i login i get a multiple times a alert with Done(line 69 in the pastebin code or line 4 in the code on the bottom of this question). But i want that it shows one single time. Does someone know what is wrong with this code?

protected function tryLogin():void {
encryptStringResult.addEventListener('result', function(event:ResultEvent):void {
var encryptString:String = event.result.toString();

[code].....

View 1 Replies

Flex :: Alert Is Triggered Multiple Times?

Aug 10, 2011

The following code works in the following way:

When I enter incorrect values in the txtother.textbox and focuses out, an alert will be displayed as "Please enter a valid Format Mask." . After pressing the "ok" button in the Alertbox the txtOther.focusout even is triggered again. i.e. immediately after pressing the OK of alert, the same ALERT is displayed again.

I have added the code for ur reference:

//in mxml File:
<mx:Canvas label="General" >
<mx:VBox>

[Code].....

I don't want to the alert to come again and again .. I need it in such a way that when the ok button of alert is pressed. The txtother.text should be in focus, and the alert should not come again and again as before.

View 3 Replies

Flex :: Validator Gets Called Multiple Times With Beta 2

Feb 28, 2010

I created a custom validator as follows in Flex 4 beta 2[code]...

it works but if you notice I have an Alert window for testing and it gets displayed 4 times which means the validator is getting called 4 times.

View 1 Replies

ActionScript 3.0 :: Custom Component Not Derived From UIComponent

Dec 24, 2010

I created custom component that not derived from UIComponent. And I want to make live preview. It's works fine - I can change properties and live preview shows them immidiatally. But there's some problem - if I override 'width' and 'height' properties and run application - the width and height that I changed on properties panel in IDE are not kept. Properties that changed through component inspector saves. So, how can I save width and height of my component changed through properties panel?

View 4 Replies

ActionScript 3.0 :: Why UIComponent.drawNow Must Be Called In Custom CellRenderer

Feb 16, 2009

I recently used fl.controls.List to implement a list with custom CellRenderer.I did it by implementing ICellRenderer:[code]Inside MyRenderer I added a fl.controls.Button, then set its label. However, when the List is rendered (by dynamically adding item into its dataProvider), the button body is not rendered, only the label is rendered. When I move my mouse over it, the button is then properly rendered.I found this strange, then tried use myButton.drawNow() in constructor. The problem seem to be solved. Now the button is rendered, but the label is not at the very center of the button (it's a bit towards right). Then, when I move my mouse over it again, the label move to the center, and everything's ok.This may be a minor problem, but I just wonder why this is happening. Why must drawNow() to be called? Why the label is not properly placed even when drawNow() is called?

View 5 Replies

Flash :: Flex Custom Component Won't Resize?

Apr 5, 2011

I am trying to create an expanding object with the following event handler

public function pickerMove(e:MouseEvent):void {
trace("in mouse move");
var offsetX:int = e.stageX - touchX;

[Code]....

Is there something that I don't know about custom components resizing?

View 1 Replies

Flex :: Incrementing A Global Variable In A Function Which Is Called Multiple Times?

Oct 31, 2010

I am trying to make a simple mp3 player using flash. The songs are loaded using an XML file which contains the song list. The following code is inserted into a new keyframe.

import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.*;
import flash.events.MouseEvent;

[code]...

The problem over here is in the nextSong() function. I am unable to preserve the value of currentIndex. Although I am incrementing currentIndex every time the function is called, but the value remains unchanged.

View 1 Replies

ActionScript 3.0 :: Embedding An Image Works Only For A Few Times Then Resize

Mar 23, 2011

I am trying to use an image and I am having the following problem:

- the image is a png, 2000x2464 pixels

- I embed the image

- Everything works OK during the first few tries

- After some debugging session, without changing anything in the image embedding, the image isn't loaded anymore, or better, it seems loaded ( in the variables I see the istance of my class and it is not null) but the bitmapdata of the image is null, width and height are 0.

- Now, I resize the image to something smaller and i start again. Everything works fine again and the cycle begins again! Here's the code: In the declarations of the class containing the image:

[Code]...

It seems to me that I am embedding the image as described in zillions of sites and it is actually working... for some times ! Then , after say 5 or 6 debugging sessions, I get an error evaluating "someNumber" because width is zero, and checking the local variable I see that bitmapData is null. Resizing to a smaller image , saving said image and restarting solves the issue temporarily.

View 0 Replies

Flex :: UIComponent Extended Class Isn't Showing UIComponent Extended Class

Aug 18, 2009

I have 1 class (that is extending a UIcomponent) that is representing a component. In that component I create different instances of another class that is also a UIComponent but this class doesn't show up in de first class. I see that it is running and that it has the correct hights but I got the feeling that it doesn't show up with this hights. If I trace I see the width and height is 200 X 200 but there is still nothing visible in my component.

View 1 Replies

Flex :: Play Multiple Sounds With A Custom Delay?

Dec 9, 2009

I need to realize a multiple-track player. The user can upload multiple tracks and mix (play them together). My problem is to allow the user to define an exact start position of each track to allow a synchronization between them, something like this:

Track 1: start at [x] sec.
Track 2: start at [y] sec.
play/stop

where the user can set the x and y. I've tried to realize it with AS2 (using netstream and setInterval) and AS3 (using netstream or sound and timer). Only if I set the same x and y both tracks are playing simultaneously.

View 1 Replies

Flex :: Setting Multiple Styles To A Custom LabelItemRenderer?

Nov 19, 2011

I made a custom LabelItemRenderer, inside it I want to give some additional style to a StyleableTextField. How can I do it without losing inherited styles? I tried different things, but always got an error saying antiAliasType must be set.

s|List.customListStyle
{
fontFamily: Arial;

[Code].....

How should I set my text field style, and then set it in the createChildren method?

View 1 Replies

Flex :: 4 - Multiple Instances Of A Custom Component Listening The Same Event Of A Parent

Jan 28, 2011

In short: I need an event listener in a custom component so all its instances (without editing them) react at the same time, fired by a dispatched event in its parent container. In detail: I have a custom component with Tab navigator. (The tabs are intended to show different preferences for different Languages.) I have a button bar with buttons for all the languages. There are a lot of instances of the custom component.

I want to click in a button of the languages bar and get ALL the instances switched to the same tab (the custom component contains the logic to change the tab). I can do it by adding the event listener for EACH INSTANCE of the custom component, so it calls an internal function that changes the tab. But it seems to be very coupled, isn't it? I wonder if it can be done in the master CLASS of the component, so it listen for events in its parent container, whichever it is. In my mind this code shoud work, but it doesn't (obviously ill'use a custom event to pass the new language value): this.parent.addEventListener("lang_change", this.change_tab); This way I can just drop an instance of the component, and see it working for itself.

View 2 Replies

Flex :: Usage Of Custom Event With Properties... Multiple Events And Single Listener?

Jan 6, 2010

I have multiple items in my app that I would like the user to click on.Some items are completely different classes.The classes dispatch events and then when the events are captured, some modifications are done to the transform properties of a loosely coupled display object.I want two separate classes to dispatch the same type of event, since I already have an image class that draws images based on a given url... I want the classes to dispatch the events, but then I think I want the difference to be detected when the event comes along... i.e., I would like to recognize the 'origin' or 'sub-type' of the event. Some sort of if/then logic would suffice.

View 1 Replies

ActionScript 3.0 :: Dispatch A Custom Event Out Of At Different Times So The Main Timeline Can Pick It Up

Sep 20, 2011

I have a boxer class that I would like to be able to dispatch a custom event out of at different times so the main timeline can pick it up and do something. It is at the end of different things. ie. movieclip finished playing. So far when I try to dispatchEvent it says I can't with error 1061.

View 8 Replies

ActionScript 3.0 :: [Flex3] Custom Component Initializes 3 Times On Creation Complete?

Aug 4, 2009

I have a custom AS3 component in a very simple MXML file. The custom component just loads an external SWF using SWFLoader.If you look at the output (below) you'll see it's actually loading the SWF only once, but it instantiates it twice!! What the?Main.mxml is just the Application tag and then this:

Code:
<myComponent:SlideViewer title="SlideViewer" swfName="slides/productInfo" />
SlideViewer.as has this:

[code].....

View 3 Replies

Flash :: How To Use UIComponent In Flex?

Oct 9, 2009

I am new to Flash/Flex. I would like to use a Component I created in Flash extending fl.core.UIComponent. How do I use this in Flex? Do I just export it as a swc or do I have to use the Flash Flex 3 kit which will convert it to a UIMovieClip. That does not sound right.

View 2 Replies

Flex :: What Does UIComponent Add To DisplayObject

May 19, 2009

I am trying to understand the interaction between Flex UIComponents and (Flash?) DisplayObjects... But it's not clear to me what the UIComponent class "adds" to DisplayObject. So, what can a UIComponent do that a DisplayObject cannot?

View 2 Replies

Flex :: Update UIComponent Size?

Feb 23, 2010

I've created a AS3 class which extends UIComponent so that I can easily add it to my MXML layout. It works fine, but I'm trying to figure out how to update the UIComponent width and height dynamically. I want my super UIComponent to draw a border around the content, so I need get the specific 'content' dimensions in order to do this.

I understand the idea of UIComponent is that you are supposed to specifically set the width and height... but I am literally only extending it so that I am able to use my custom component with MXML easily.Is there a method in which I can get the width and height of a UIComponents 'content'?

View 2 Replies

Flex :: Difference Between UIComponent And Sprite ?

May 23, 2010

What is the difference between a UIComponent and a Sprite in Flex.

View 1 Replies

Flex :: UIComponent Click Handler?

May 27, 2010

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.

View 3 Replies

Flex :: Change The FusionWidgets UIComponent?

Aug 29, 2010

I'm using the ravis FusionWidgets component in flex to create guages.I have a problem to change a guage in my program.I build an mxml component with the guage like this:"ns1:FusionWidgets id="myGuage" width="{guageWidth}" height="{guageHeight}" FCChartType="{guageType}" FCDataXML="{guageXML}" y="0" x="0"/"when the guageType and the guageXML is the bindable data providers.when I place this component in first time, the providers don't contain nothing and i let the user to change them in my flex application.the problem is that when the user change them, the guage doesn't update itself.I know that when I change a bindable data provider, the component must be changed.

View 1 Replies

Flex :: Nothing Displays When Add UIcomponent To Canvas?

Oct 22, 2010

i am trying to add a uicomponent which contains an object of a custom class the extends UIcomponents and i want to display this uicomponent to canvas i have done no error compile or run time but it does not display the Uicomponent.

here is code;

var item:RecordRanderer = new RecordRanderer();
item.randerItem(child);
item.x=20;

[Code]....

View 2 Replies

Flex :: What Is The NonInheritingStyles Property On The UIComponent For

Nov 10, 2010

What is the nonInheritingStyles property for on the UIComponent?

Is this a list of styles that the component does not inherit from the container?

Or is this a list of styles that have been set inline or in code so the component is just telling me that they are NOT inheriting from the container?

If it's the first why are their values set for this properties?

View 1 Replies

Flex :: Add Uicomponent Inside A Sprite?

Apr 15, 2011

i want to add UIComponent inside a spite. here is the code:

private function make() : void {
var circle : Sprite = new Sprite();
circle.graphics.beginFill(0xFF0000, 0.2);[code]......

the problem is that button is added, but is not displayed. if i do reversed - add sprite to uicomponent - everything works fine, but this way it doesn't work. i tried to use invalidate functions for button etc... even tried making "circle" as UIMovieClip, but no luck - button is still invisible. also if i simply do "addChild( button );" - it is shown,how can i add a button inside a sprite?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved