Flex :: Use A Base For A Custom MXML Component?

Aug 26, 2011

I'm using several custom MXML components in my Flex 4.5 application.They all use absolute coordinates to place Image, Label, Line, etc. components and are currently based on a spark.components.BorderContainer:

<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer
xmlns:fx="http://ns.adobe.com/mxml/2009" [code]....

Then I've realized, that I probably don't have to use BorderContainer, because I don't draw/need any borders around my custom components.But I don't know, what to take instead of it.I've tried taking <mx:UIComponent> (and removing <s:Layout> tag above), but then I get the error:

'Image' declaration must be contained within the <Declarations> tag since it does not implement 'mx.core.IUIComponent'.

'Label' declaration must be contained within the <Declarations> tag since it does not implement 'mx.core.IUIComponent'.

Is there some simplest possible spark "container"? And do I need a "container" at all if I use (and want to use) absolute coordinates?

View 1 Replies


Similar Posts:


Flex :: Mxml - Converting A Custom Component To A Module?

Sep 25, 2009

How to take an existing custom component in Flex and convert it into a module? EDIT: What should be done in the mxml where this custom component is used? Should it be replaced with a to load the module? If yes, how to deal with code that uses instances of the components?

View 2 Replies

Flex :: Put MXML Child Nodes Within A Custom 4 Component?

Nov 27, 2010

Here is an example of a custom component. It is just a box with a title label and a close image (X):

[Code]...

When using the component in an MXML document, I would like to have the "(HEADING TEXT)" replaced with a parameter (should be easy) as well as the "(INSTANCE MXML)" with several labels, text inputs, check boxes, etc. (maybe harder). I have found this script-based method, but I would like a cleaner compile-time solution if one exists.

View 2 Replies

Flex :: Setting Up Content Children For Custom Mxml Component

Dec 9, 2009

I am trying to develop a custom component to act as a divider.

[Code]....

I would like to use this component to assign objects like this:

[Code]...

Unfortunately, this does not work. I get a compiler error saying: In initializer for 'left': multiple initializer values for target type mx.containers.Canvas.

View 1 Replies

Flex :: Create Simple Custom Component With Two Labels With This MXML?

Oct 7, 2010

I'm trying to create simple custom component with two labels with this MXML:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="250" height="30">
<mx:String id="result" />
<mx:Label x="5" y="7" id="titleLabel" text="{label}" width="120"/>
<mx:Label x="125" y="7" id="resultLabel" text="{result}" width="120" textAlign="right" color="#A41D00"/>
</mx:Canvas>

It is working well at runtime, bud I have troubles making it working at design-time. How can I make databinding work at the design time? If it is impossible, how should I code the label text assignments?

View 2 Replies

Actionscript 3 :: Flex: Refreshing Custom Mxml Component On Button Click

Mar 3, 2010

I have defined small MXML component which calls web service which returns random number on request, then my component displays the number.

How do I refresh the MXML from main application control, so it will recall server again?

View 1 Replies

Flex :: Adding MouseOver/mouseDown/mouseUp/etc. To Custom MXML Component?

Aug 21, 2011

I'm new to Flex and am porting a pure Flash/AS3 app to Flex 4.5. I've created a custom MXML component based on BorderContainer

<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer
xmlns:fx="http://ns.adobe.com/mxml/2009" [code]...........

and it would work well, but here in Flex 4.5 I don't know how to do this.Also I've noticed that there is a dropShadowVisible="true" attribute, but not sure if/how it can be used for my purposes.And I'm not sure if scaling up/down a custom component is allowed in flex or I probably should use "Flex Effects" (but how?) and also set disableLayout="true"?

View 1 Replies

Actionscript 3 :: Three Way Binding In MXML Custom Component (using Only Mxml)

Jun 22, 2011

I'm trying to do this using only mxml, no <script> tags, although I don't necessarily need a solution that's only mxml. It was more of an educational exercise to see if I could do it all in mxml. I have a custom component that has a slider and textinput and their value/text properties are bound together. I'm surfacing a few properties of the slider in my component so that it can sort of be treated like a slider.

[Code]...

View 1 Replies

Actionscript 3 :: Prevent MXML Custom Component In Flex Library Project Always In Default Package??

Mar 31, 2010

I'm creating some custom components and backing code. I've created a Flex library project in Flash Builder which compiles to a SWC. The problem is now that all my MXML files get compiled into classes in the default package, making the whole thing a big mess.Is there a way to set a package declaration for MXML files? After all it just gets translated into AS3 classes. This seems to work in regular Flex projects using a namespace declaration so I'm at a loss how that is supposed to work. The other option is building out all the components in AS3 which I'd like to avoid.

View 1 Replies

Flex :: Extending Mxml Component With From Another Mxml Component With Visual Child Supported?

May 18, 2011

I've been trying to create a custom mxml component that extends another custom mxml component (i.e.MyMXMLComponent -> BaseMXMLComponent -> Group). I've been reading that trying to add visual children to MyMXMLComponent caused error with Flex 3 but that's no longer the case with Flex 4.

What I want to know is whether this is a supported/fixed/documented feature of Flex 4? or just some undefined behavior in Flex 4 that may get changed with future updates?

if this is supported and documented feature, does anyone have link pointing to adobe document stating it as such?

View 1 Replies

Css :: Add Custom Style Property To MXML Custom Component?

Jun 22, 2011

I have a Custom Component that has a couple of Canvas with some background colors assigned to them. Now i have hard coded the colors, i want to move them to an external css file. So i would like to have the css declaration like this :

[Code]...

My question is if i can define custom style names like dividerRightColor and if so, how can i use that value inside my MXML Component? I have seen examples of using them inside Pure AS components.

View 2 Replies

Flex - Define A MXML Component And Update MXML Component In Flex Application

Aug 12, 2009

A Flex components values are initlized by init methord. In an application flow, How to refresh a mxml component data value ; as init is callled at the start up it self only.

eg. of mxml componet may be as simple as button label or text as complex as repeater whose data provider is a web service ( means a fresh quesy should be made to pull the data and refresh the dataprovider of repeater )

View 3 Replies

Flex :: MXML Syntax To Assign Properties Of Subcomponents In Custom MXML Components?

Jun 4, 2011

I am working on a custom Flex 4 component which is an aggregation of two existing flex components. I would like to be able to specify my own custom properties for the component as well as access the existing public subcomponent properties via MXML. For instance I might want to adjust the font color or style for the label and text input. toy component which aggregates both a label and a text input:

<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[code]....

View 1 Replies

Flex :: Extending MXML Custom Components Via MXML?

Feb 3, 2011

What I'd like to do: create an MXML component with some children, then extend it via MXML to create a new component with more children, without losing the original set.In other words

create a component bc.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"

[code].....

View 1 Replies

Actionscript 3 :: Flex When Mxml Described Component Initialise It's Mxml Described Properties

May 28, 2011

I am trying to override a Button class, i have a few properties which i wish directly initialise with the mxml description of the component, like :[code]which function is triggered ( in order to override it ) when all properties with mxml description is fully initialised with their values ?

View 1 Replies

Actionscript 3 :: Flex - Access Component Inside Another Component In MXML?

Sep 3, 2009

I have two components. One is called "InsideComp" and one is called "OutsideComp". OutsideComp has InsideComp as one piece of its component, and in my main MXML file, I have embedded an instance of OutsideComp. How do I access a public variable of InsideComp within my main MXML file?In Actionscript, I could just do something like:OutsideComp.InsideComp.valToChange = 5; But I dont know how to do it in MXML. I know this is probably an easy question.

View 4 Replies

Flex :: Base Class For Custom Components

Dec 9, 2009

In my flex app I have various custom components done with mxml or actionscript.I want all of them to extend a base-class where I can define properties/event listeners etc.Can someone give me an example how to create that base class and how I can extend it in mxml and actionscript components?

View 3 Replies

Actionscript 3 :: Flex 4 Disptaching Custom Event From Custom Component (why Flex Converting Custom Event To Mouseevent)?

Mar 2, 2012

This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component

TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent.
dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));

Note: The error in my earlier post is giving below error message

Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent

The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.

This is my custome event

package events
{
import flash.events.Event;
import ui.map.MapElement;

[code]...

View 1 Replies

Flex :: Creating Custom MXML Components?

Jun 21, 2010

When I define custom propertie in my MXML component, I also want to define a set of possible values of that property to make Flex Builder show then (possible values of the custom property) when I invoke code completion function.

View 2 Replies

ActionScript 3 :: Custom MXML Container In Flex 4

Jul 22, 2010

I want to make a custom container, usable in MXML like:
<local:MyContainer>
<s:Label/>
<s:Button/>
...
</local:MyContainer>

But I'd like to be able to catch when the children are added so that I can control stuff like when & where they're added. I tried overriding addChild(), addChildAt(), addElement(), addElementAt(), (extending the Group class) but they only fire when you add elements specifically with those functions - the application launches and the label, button, etc, end up in MyContainer without calling these functions. How do I control the addition of sub-components via MXML?

View 2 Replies

Flex :: Access Component Id Of One Mxml From Another?

Sep 21, 2009

I have two mxml files. one is main that is application tag mxml file and another is my mxml component file. I have a viewstack in my main mxml whose id is, say, "mainViewStack". Now I want to set selectedChild property of "mainViewStack" from my mxml component file. [code]...

View 4 Replies

Flex :: Use Mxml Component In Another Actionscipt

May 11, 2011

how to use mxml component in another mxml component actionscipt code [code]but i am getting error saying "Type was not found or was not compile time constant:warning")

View 3 Replies

Flex :: Connect .mxml Component To Another?

Feb 7, 2012

How can i click a button on an .mxml component to open a specific selectedItem on a spark List from another .mxml component!?

View 1 Replies

Flex :: Put Custom Code In A Custom Component In Flash Builder?

Dec 11, 2010

In the main file, I would write[code]...

But if I want the component to have that behaviour innately, where do I write it in the mybutton mxml file to have it reference itself?[code]...

View 2 Replies

Flex :: Access The Datagrid In One Mxml In Another Component?

Oct 9, 2009

I have a datagrid in my mxml file, say, samp.mxml.

<mx:DataGrid id="taskDataGrid" dataProvider="{initDG}" variableRowHeight="true"
editable="true" width="100%" paddingBottom="1" paddingTop="1" height="55" >
<mx:columns>

[code].....

View 3 Replies

Flex :: Say An MXML Component Is Inside Some Package?

Dec 21, 2009

How do I say an MXML component is inside some package? Well, it's in a different folder... I know how to do it ActionScript... But when I do in MXML I don't declare the package explicitly because I don't know how, and when I call it to my application, it states that The prefix "package" for element "package:Component" is not bound.

View 2 Replies

Flex :: MXML Component Life Cycle?

Apr 6, 2010

I am confused with how component life cycle goes when component build in MXML. and if MXML calls methods automatically then how to call any method in life cycle explicitly.

View 1 Replies

Flex :: Using PopUpManager To Instantiate An Mxml Component?

Oct 22, 2010

Basically I am poping up the following component:

PopUpManager.centerPopUp(PopUpManager.createPopUp(this,RegionExperienceDetailPopUp,false));

I need to call RegionExperienceDetailPopUp.generateData(passIntArray);

What is the syntax to do this?

View 1 Replies

Flex :: Modules Over MXML Component Architecture?

Dec 2, 2010

I am actually in the process of Architectural of our project. We have choosen Mate framework. The project is not so quite complex, but what advantages i would get over MXML when i choose Modules.

Main App - > Views - > Events - > Maps - > Services [PHP or Java]

When i come up with Modules based Architecture, it seems to be good but i doubt it should not end up with tight coupling and unwanted issues which may break the head later to solve.

Main APP - > Modules - > Module Interface -> Events - > Maps - > Services
[PHP or Java]

What advantages i do get if i choose Modules over MXML Component? What is the prefered and the best way to Architect an FlexApplication? Since the Application is going to communicate with Backend, do we need to make the frontend more complex?

View 3 Replies

Flex :: Opening A New Tab And Adding An Mxml Component To It?

Feb 12, 2011

In our flex application we have tabs at the main level and under it we have subview.e.g

Home / Tasks / Admin etc...

In one condition we have to click on a button and open a new tab, on this tab we have to add an existing mxml component and show it in the tab.We are using parsley as the framework. Inside the mxml component test.mxml(that is shown in the tab) i am configuring it with parsley using the tag.Now when i add the instance of this test.mxml i am getting an exception. I am deriving this test.mxml instance using teh parsley context

as

context.getObject(id of component) as DisplayObject and adding it to the tabNavigator...

But i am getting exception when i try to grab an instance of a view using parsley context. How do i get an instance of a view or component that is configure through parsley using the parslye context.Also the problem is occuring becuase of the view injection..because i get a parsley excepiton on startup of the application stating that there is some problem in the context.

View 1 Replies







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