Flex :: Difference Between UIComponent And Sprite ?
May 23, 2010What is the difference between a UIComponent and a Sprite in Flex.
View 1 RepliesWhat is the difference between a UIComponent and a Sprite in Flex.
View 1 Repliesi 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?
If i try:
myCanvas.addChild(new Sprite());
i get the error that its not a mx.core.IUIComponent.
Is there some kind of a container for Flex UIComponents which can handle normal DisplayObjects as Sprite and MovieClips?
Given this code:
[Code]...
Why does changing the width and height of uiComp not affect the Sprite? Wouldn't UIComponent provide Sprite with a Graphics object, which limits that area where Sprite can draw?
Both of sprite.width and sprite.scaleX can be used for scale a sprite. Is possible sprite.scaleX depends on screen size?
View 2 RepliesI have a task: I need to place about 100 sprites on one canvas (with prepared grid on it). I need to place them as invisible (circles) stones, on the board, and make visible only on mouseover. The problem I come across is following, I can't place those objects accurately into the nodes on the grid.
[Code]...
I need to move 100+ sprites from right to left, for example, a hundred musical notes will be scrolling horizontally should be as smooth as possible, having tried move s:Group component found it to be inefficient with high CPU load even after apply updateafterevent(). Is it possible to scroll a large numbers of sprite smoothly?
View 1 RepliesI am stuck in a strange problem, can anyone suggest what I amdoing wrong here: the TextArea component didn't show in thedisplay:
var text:TextArea = new TextArea();
text.height = 500;
text.width = 200;
[code].....
what is the difference between MovieClip and Sprite?
View 1 RepliesI'm kinda new to AS3, I would like to know the difference between Sprite and Bitmap classes??
View 6 RepliesWhat is the difference between a movieclip and a sprite. Why some programmers using sprite instead of a movieclip? What is the advantage of using sprite? Can we use sprite in the stage? Will the sprite reduce the space occupation than a mc?
View 3 RepliesI 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 RepliesI 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 RepliesI 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 RepliesI'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'?
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'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 Repliesi 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]....
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?
For developing simple games with the Flex SDK, what are the consequences of using a Canvas object, versus a UIComponent object, as a drawing surface? Are there performance issues with either one? Are the methods generally the same? Searching around, it seems that most sample code I've found uses UIComponent. Is this just customary, or are there reasons?
I already know one odd difference - I had developed a simple Pong game using:
public class MyGameCanvas extends UIComponent
and then decided to replace UIComponent with Canvas. This caused the line to fail:
[Code]...
However, I have to confirm something, being new to Flex and the various terminology. I'm presuming that people mean I should not be using MXML for games, when they said Flex SDK. Since I thought the Flex SDK was what provided the compiler that generates .swf files. Otherwise, where/how would I even compile AS3?
Assuming that's the case, then my question would be about the suitability of using both MXML and AS3 for (simple) games. Based on what I've read about both, it seemed like the intended use of them was MXML for the interface elements, and AS3 for everything else. Is the overhead that bad for MXML?
I have a BaseComponentClass that I am using as the class that all my custom components extend.For some reason, none of my custom components show up at runtime. I am not getting any compile or runtime errors either.I am implementing all the protected UIComponent methods.[code]The Button never shows up at runtime.
View 3 RepliesI have a NumericStepper declared as a UIComponent:
<![CDATA[
private var component:UIComponent;
component = new NumericStepper();
]]>
I need to change the .maximum value of the NumericStepper but due to the UIComponent not having a .maximum property the following code fails with the error: 1119: Access of possibly undefined property maximum through a reference with static type mx.core:UIComponent.
component.maximum = 11;
how would I define a property in this scenario?
I currently am trying to add a custom class which subclasses UIComponent to both a tree and a canvas, but when I try to re-order the tree by dragging I get this error:[code]When I do not add the UIComponent to the canvas, this error does not occur, anyone have any knowledge as to why this happens?
View 2 RepliesExtremely 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.
I'm trying to drag an item from a datagrid and drop it onto a UIComponet. Basically I just want the UIComponent to know that something has been dropped onto it and allow it to access the data of the dropped item.
I thought just listening for the drop event would do it but it seems not.
I found lots of documentation on dragging from one IList to another but nothing for this.
<mx:UIComponent xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init(event)" dragDrop="itemDropped(event)">
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 RepliesI'm removing an UIComponent but parts of it last being visible. It redraws only when I move mouse around or something. I tried to do validateNow() on its parent, tried to do setTimeout(validateNow, 100) but it doesn't help. When I call it by setTimeout it seems these artifacts shown more rarely but it doesn't solve a problem in all cases. Please guide me someone to read about validateNow(), how it works and how to make these things correctly.
The code is below:
protected var bubble: SpeechBubble;
// creation
bubble = new SpeechBubble();
[Code]....
I've been trying to draw a series of points using a UIComponent using:
var line : UIComponent = new UIComponent();
...
line.graphics.lineTo(renderPoint.x, renderPoint.y);
[Code]....
The problem is that although I have all renderPoint segments etc. The line never gets drawn or it never gets displayed. I think this might be because of some Flex thing that is not so obvious.
I want to create a custom button in ActionScript. [code]...
View 2 RepliesI'm trying to understand the difference between the owner and parent properties of the UIComponent.
<s:Panel id="panOne" title="Success">
<s:Label id="labOne" text="Hello World!!"/>
</s:Panel>
In the above code, labOne.owner.id returns panOne and labOne.parent.id returns contentGroup.
I understand the owner property refers to the parent container of a component (Label in this case). But what does parent property actually mean? I think it relates to some skin concept which has a with id value of contentGroup.
exact difference between these two?
There is another link in the link provided by you. It explained these two terms very clearly. That link is: Gumbo DOM Tree API - Functional and Design Specification
I have pasted below the best lines from that page.
The parent of a visual element is the container directly in charge of laying it out. The owner of a visual element is the component that logically owns it. If a Button is in a SkinnableContainer, its parent is the contentGroup while its owner is the SkinnableContainer.