Actionscript 3 :: Determine System Icon Size With Flex, AIR?
Oct 22, 2010
Each system - whether it is win, mac, or linux - displays (desktop) icons at a
user selected size (e.g., 16x16, 32x32, 48x48, etc.)How can I find which size is being used by the local system from within Flex or ActionScript3?
I'm building a small Flex UI component that displays a colored square next to a label of text. I want to be able to specify a size for the square and internally adjust the label's properties such that the line height matches the square and the text is vertically centered with respect to the square.
At the moment, I'm using mx.controls.Label for the text. Setting the fontSize style to the square's size does not work, the label then becomes too big. After tracing a couple of values in the debugger, I found that
the line height of the internal text field (sum of the ascent and descent properties of the TextFieldMetrics object obtained through getTextFieldMetircs()) seems to end up about 120% of what I specify a s font size.there's a default "leading" of 2 pixels that I can not change directly at the Label level, this adds to the overall height of the internal text field (getTextFieldMetrics().height)the height of the Label component then is an additional 5 pixels larger than that, I don't know where those come from.
Is there a way to take a compiled SWF file and figure out how much of it's size is used by code and how much is assets (images, etc)? I'd like to see if I can get my Flex SWF smaller but I'm unsure what's taking up the most space.
In general, I haven't yet found a definitive way to get Flex and Spark containers to size themselves relative to their children. I have searched for good documentation for this concept many times but have yet to find anything that sufficiently explains the concepts. A simple example of something I often want to do is to draw a border uniformly around a set of controls. The goal here would be to have all UI elements to size themselves automatically.
I would want the Labels to size themselves based on the text property, and the HGroup should be as big as needed to contain labels and BorderContainer should only just contain that HGroup. Now the more complicated example that I am working on now. I have a class that extends the BorderContainer. Within the class I create an HGroup with 5 Labels as children of the HGroup. Then the HGroup is added as a child of the ExtendedBorderContainer (using addElement() method).
Then the new class is used in the application as: <mx:ViewStack> <s:NavigatorContent> <my:ExtendedBorderContainer /> </s:NavigatorContent> <!-- more NavigatorContents here --> </mx:ViewStack>
I have tried various [max|min]height/width combinations and I can not get the desired layout, which is very tight borders around elements without extraneous space starting from the deepest Label children all the way up to the NavigatorContent.
I have a list of fonts obtained via Font.enumerateFonts() and I want to display them all as 12 pixels tall. The problem is that I cannot simply set the point size because this can vary in actual pixel size for each font. So basically I want to determine what the correct point size is for a font in order to make it exactly 12 pixels tall. Because I'm doing this with a potentially large list I'm looking for an efficient method to do this.
Does anyone know of a way to determine if a glyph is available for a system font, as returned by Font.enumerateFonts()? It turns out Font.hasGlyphs only works on embedded fonts set to export for ActionScript.
I'm writing a card game in ActionScript 3. Each card is represented by an instance of a class extending movieclip exported from Flash CS4 that contains the card graphics and a flip animation. When I want to flip a card I call gotoAndPlay on this movieclip.When the frame rate slows down all animations take longer to finish. It seems Flash will by default animate movieclips in a way that makes sure all frames in the clip will be drawn. Therefor, when the program frame rate goes below the frame rate of the clip, the animation will be played at a slower pace.I would like to have an animation always play at the same speed and as a consequence always be shown on the screen for the same amount of time. If the frame rate is too slow to show all frames, frames are dropped. Is is possible to tell Flash to animate in this way?
But I would like it play back at a particular size like 800 x 600 so the rest of the screen is just a border of the documents colour. Can this AS be adapted to do what I need?
How do you find out the size of the system chrome so that I can specify the window size to achieve the stage size I want?
If my main window is set at 800 x 600 (stage), and I create a second window as below, it will be smaller.
public function Main():void { var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions(); windowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
[Code].....
I assume you increase both newWindow.width = 800; and newWindow.height = 600;to account for the chrome, but how do you find this value?
I build a web site in flex that some time take input. Will this website works on Touch Screen environment(KIOSK).My question is we have to make any change to handle input such as prompt on screen keyboard when input fields are get focused or it will manage my device and OS of system(KIOSK, Touch screen system) itself.
I adopted the tsunami effect that i've got from this link [URL] but the problem is how can i plug the title on each icon, showing up on an icon when i point on it (on rollOver)
I am loading the data externally from xml and displaying in a datagrid. I have 2 buttons addRow and deleteRow. My datagrid headertext names are "name" "age" "rollno" "image", where image also will be loading externally thru an xml file. now when i am pressing the deleteRow button, whole row is getting deleted but an image icon is still appearing under "image" headertext. It was not an actual image but a blank image icon kind of thing is appearing, how to remove the icon. i want my whole row to be deleted. but its not happening.
Trying to set the up and down state icons of a Flex Combobox to images. I see the property for changing the color of the icon, but no property to skin it. How can I do this?
I am dragging item from a datagrid and while dragging I could see all of the columns in the selected record, being getting dragged. However I only want to show one column (maybe name or id of the record)? Is there a way to achieve this? Also, could I show an icon or image instead of the record while dragging.
I have a button which I use for sending a message. When the message text is empty, it should not be possible to click the button.
This is all fine and not an issue. The only thing that is bugging me is the fact that I can disable the send button but the image does not get disabled (like I would expect).
Is there a way to do this elegantly because I don't want to provide a sendicon_disabled.png and change it myself (I don't think this should be my job).
I've created an Air app for use in work. To make things slightly easier, I pin the icon to taskbar (Windows 7). The app uses the auto-update framework (default), which works fine.
After I update though, the pinned icon becomes a default blank page icon. If I click on this icon, Windows will tell me that it can't find the program. I need to unpin the icon and repin a new one (the icon in the start menu works fine).
I'm using AIR 2.7 (compiling with the Flex 4.1 SDK) and I'm on Windows 7 64 bit if that helps.
I am developing an Adobe Air app. I need to set an icon to the app so it is shown on the task bar. I added the icon tag to the descriptor file but it is not working and I really don't know why
We are creating a LinkButton programmatically and would like to set it's icon to an image retrieved from the remote server rather than something embedded within the SWF. The .icon property expects a Class but I can't figure out how to create one equivalent to an @Embed but from a dynamically generated URLRequest or URL String.[code]...
I am trying to add different icon on different buttons. I have my skin file ready but not sure if I have to create different skin class for different button. It sounds inefficient.
I want to add an indicator on a tree node icon , meaning , for example like in eclipse when there is an error the icon get a special small indicator on the regular icon. how can i do that?
I have a custom file type that I'm reading from and writing to within an AIR application. The file type is XML based but contains encoded data for an image. I've already defined the file type in my application manifest file using the tag which assigns a custom icon to the file.
What I'm trying to figure out is whether it's possible to set the icon for each individual file to be a preview of the image contained within.
I'm trying to make an application in adobe air where you can externally load icons into the application. Can I change the window application icon in actionscript?
I have a little concern. I started trying to make a MenuBar control with custom icons already made in FXG format. I have 3 FXG files in "assets.graphics.icons" inside my project folder:
I get the folder icon, never the label. I've tried numerous datasources, always the same thing. File, ajax call, text, it always fails.
In the code below I even set a custom handler and watch the XML come in, I set a static text label going out. Never anything shown. This happens without the label function and using labelField. Yes, I'm 100% sure the attribute matches. Again, tried with numerous different datasources.[code]...