Hello
I am trying to change the header color and the row color of the datagrid. Apparently, its not a spark component so can't apply skin on it. Anyone knows how to style it? Thanks.
In the root of my application I have 5 named "slots" (layers) that I want content to appear in. Should I be using Canvas, Group or something else for each of these slots? I don't need any kind of automatic layout inside these slots.
Hi,
I need some Regex help.
I need to find beacon_ followed by an alphanumeric code and then wrap it in quotation marks. For something static, like the example, below it's straight forward.
myReturn = myReturn.replace( 'id=beacon_80291ee9b3', 'id="beacon_80291ee9b3"');
But, my problem is that the part after beacon is a random alphanumeric code. (However, it is always the same length). For example, the beacon part could be:
beacon_c8ac873136
beacon_dc83b5953e
beacon_7a910d03d8
etc.
The haystack that I'll search will look like:
myReturn = "blah blah id=beacon_80291ee9b3 blah blah";
Thanks.
-Laxmidi
Hi guys,
I'm new to flex. Now I'm writing an flex application. I plan to split my application into some MXML files(Application as the root tag). How can I switch from one mxml to another?
BTW, what is the best practice for design large flex application? Just one MXML Application and many MXML component or many MXML Application?
Thanks!
hi,
How can I get the width of my LinkButton object ?
myLinkButton = new LinkButton();
myLinkButton.label = "blabla";
myLinkButton.setStyle("fontSize", 24);
myContainer.addChild(myLinkButton);
trace (myContainer.width); //this doesn't work because I haven't directly set the attribute
thanks
I found at this Adobe tutorial a nice "RemoteService" class that creates a RemoteObject and contains the functions for handling the result and fault events. If I wanted to use this approach, how could I pass the data from the result handler to interfaces that modules from the main application could use?
I could put the RemoteService/RemoteObject in the modules, but (in my opinion- and I could be wrong) the best design seems to be using the remote calls in the main app and passing the data along to the modules.
I am having an issue where I show an AlertBox message when the user hits ENTER and the focus is in a text area. The pop up works fine, but when the user hits enter the Alert closes as expected, but the TextArea listener receives the ENTER event from the Alert and pops the dialog up again. I have tried a number of ways to catch and eat the event but so far I have not been lucky. Is there way to accomplish this?
public function init():void
{
myTextInput.addEventListener(KeyboardEvent.KEY_UP, handleKeyStrokes);
}
public function handleKeyStrokes(evt:KeyboardEvent):void
{
if(evt.keyCode == Keyboard.ENTER)
{
myAlert = Alert.show("This is a test and only a test", "Title", 4, null, alertCallBack);
}
}
<mx:TextInput id="myTextInput"
left="600" top="10">
</mx:TextInput>
I was wrote the following code to set the background image in one vBox.
vBox.setStyle("backgroundImage", "PreviewBackground.png");
vBox.setStyle("backgroundAttachment", "fixed");
Where the height and width of vBox was 250 x 350 and the height and width of background image was 400 x 400. The problem is that the background image doesn't show the full image. The image has cropped. How can i show the full image as a background image?
Thanks in advance.
I've got a custom component that has children components dynamically added and removed to it depending on what button the user clicks. What I would like to do is trigger a transition effect that moves the child component onto the stage when it's added and then moves it off when it's removed.
Does anyone have a good example on how to accomplish this?
Edit: I figured it out and left my solution below. I hope it helps someone else!
The following code display a list of comments using List control. The item height set to a fixed value (150), so it seems working: if the content is too long, the scrollbar shows...
However, what I really want is not to set the height but let it to change according to the content size. Is there any way to accomplish this?
<mx:List id="commentList" width="100%" dataProvider="{commentSet.commentArrayColl}"
rowCount="{commentSet.commentArrayColl.length}" >
<mx:itemRenderer>
<mx:Component>
<mx:VBox width="100%" height="150" >
<mx:Text text="{data.commentContent}" />
<mx:Text text="{data.username} ({data.modified})"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:List>
Give an Image component, how can I tell the size of the bitmap image that the Image is containing (not the size of the Image component)
Also I want to know this as soon as possible, so I think this needs to be in the Event.COMPLETE event?
Thanks!!
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
so i have a function that runs in state1 and has a
while(myCanvas.rawChildren.numChildren > 0){
myCanvas.rawChildren.removeChildAt(0);
}
//this code is definitely the problem....
I can move to state2, but when I move back to state1 i get the error.
why? the function that has the while loop only runs when something is searched in state1, so why is it running when coming back from state2?
if I set an alpha value to my LinkButton component, is this applied to the skin images as well ?
If not, how can I change the alpha value of a skin image dynamically from actionscript ?
.brick {
upSkin: Embed(source="icons/bookmarkIcon.png");
}
thanks
I have a combobox which gets populated by a remote method. I need to set the dropdownwidth of the combobox to the maximum length of the item in the combobox. I am able to achieve it by the following code. But if the resolution of the screen changes, the result is not similar. Is there any way to find the display width of the text in the dropdown?
private function getGroupData(resultEvent:ResultEvent):void{
viewCbx.dataProvider = resultEvent.result as ArrayCollection;
var comboDp:ArrayCollection = viewCbx.dataProvider as ArrayCollection;
var dropWidth:int = 0;
for each(var obj:Object in comboDp){
if(obj.groupName.length > dropWidth){
dropWidth = obj.groupName.length;
}
}
viewCbx.dropdownWidth = dropWidth*6;
}
Hi all, I'm working on file transfer application where client sends files to cpp server. At client side I can give the server's domain name but not IP address cuz it may vary. So any one can tell me how can I get my server's IP address through it's domain name. I have to put this logic into air application. Thank you.
I am worried about performance issues. If I just render all n reports zoomed out, then that will cost me in performance. Even animating a zoomed out report to zoom in, will also cost me in performance because it has to recalculate all the UIComponent's of my report as it transitions from zoomed out to zoomed in-to view.
Any solutions/suggestions welcome. Let me know if you need clarification.
So here's what I mean.
Let's say I have a class ErrorMessages which holds all my error messages as static constants. So I could access them like ErrorMessages.PASSWORD_INVALID or ErrorMessage.PASSWORD_TOO_SHORT. I want to know if it is possible to have separate classes that hold subset of these constants and access them like ErrorMessages.PASSWORD.INVALID or ErrorMessages.PASSWORD.TOO_SHORT, etc.
This way I can more structured static structure and makes it much easier to use autocomplete.
I tried few different ways and couldn't figure out if this was possible..
Hi,
i load in ActionScript a swf file. So far no Problem, but I didn't found a way to access one of it's functions, the best thing would be if I could access the main function in the mxml part of the swf.
Here is the code of the main-mxml file that belongs to the swf that should load and access another swf:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="basket();">
<mx:Script>
<![CDATA[
import mx.controls.SWFLoader;
private function basket(): void
{
var swfLoader: SWFLoader = new SWFLoader();
swfLoader.addEventListener( Event.COMPLETE, handleSWFLoaded );
try {
swfLoader.load( "../../data/InternalSWF.swf" );
} catch (error: Error) {
trace( "Couldn't load file !" );
}
}
private function handleSWFLoaded( event: Event ): void
{
var swfApp:* = event.target.content;
// This both ways don't work...
//if (swfApp.hasOwnProperty("initApp")) {
// var initApp:Function = (swfApp["initApp"] as Function);
// initApp();
//}
// swfApp.initApp();
}
]]>
</mx:Script>
<mx:Text id="output" width="100%" textAlign="center" />
</mx:Application>
The if-Statement "if (swfApp.hasOwnProperty("initApp")) {" is never true and
the call "swfApp.initApp()" says that this function does not exist.
In the original version I added event listeners for HTTPStatusEvent.HTTP_STATUS, IOErrorEvent.IO_ERROR and SecurityErrorEvent.SECURITY_ERROR. But except for HTTP_STATUS = 0 none of them are called.
Is the whole idea of how i try to do this wrong ?
I need a way to set up an Image as repited (by X and by Y) BackGrownd. Image should be taken from users FileSistem. In Flash/Swf (Not AIR). How to do such thing?
printableInvoice.addEventListener(batchGenerated, printableInvoice_batchGeneratedHandler);
Results in this error:
1120: Access of undefined property batchGenerated. I have tried it as FlexEvent.batchGenerated and FlashEvent.batchGenerated.
The MetaData and function that dispatches the even in the component printableInvoice is all right. It I instantiate printableInvoice as an mxml component instead of via action-script it well let put a tag into the mxml line: batchGenerated="someFunction()"
Thanks.
hi,
I have a syntax problem using Actionscript. Can I create new objects from inside an ArrayColletion ?
var tagsList:TagsListModel = new TagsListModel(new ArrayCollection([
{new TagModel("News", 36, yearPopularity, false, true)},
{new TagModel("Information", 18, yearPopularity, false, true)}
]);
This is the error I get:
1084: Syntax error: expecting colon before rightbrace.
thanks