Flex :: Set The ScaleMode On AIR App?
Jul 2, 2009I am trying to set the scaleMode on my AIR app. which is set via stage.scaleMode. However when I try to reference stage it returns as null. I do not know why?
[Code]...
I am trying to set the scaleMode on my AIR app. which is set via stage.scaleMode. However when I try to reference stage it returns as null. I do not know why?
[Code]...
Is it possable To change the scale mode of a swf in the html embed code?
my problem: I have the popular free flash game 'metal slug' as a swf, Its too large and wont resize as it was exported by who ever made it to preserve aspect ratio....
Ive been trying all day to get it to resize but it wont:
<div id="Nested" style="position:absolute; left:22px; top:32px; width:400px; height:300px; z-index:1;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
[Code].....
My stage is currently set to noScale. My bottomleftcornerbtn movieclip loves this. My worksinshow_all movieclip hates this.My bottomleftcornerbtn is set to
ActionScript Code:
bottomleftcornerbtn.y=stage.stageHeight-minimizebtn.height;
bottomleftcornerbtn.x=0;
My worksinshow_all, is already positioned on the stage and already scaled down to 33.5%. With the current stage.scaleMode="noScale";, my bottomleftcornerbtn is always in the correct spot. However, worksinshow_all will not scale the way I need it to.
worksinshow_all is a movie clip that has several loaders in it. Each are different widths. So far, all the scale proportionally actionscript I've found has worked really well if the image is a square.get bottomleftcornerbtn to always sit in the bottom left-hand corner of the screen when the screen is set to SHOW_ALL?
ActionScript Code:
//pseudo code but rough idea of what I think I need to do
var stageratio=stage.stageHeight/stage.stageWidth;
var worksinshow_allratio=worksinshow_all.scaleY/worksinshow_all.scaleX;
if (stageratio>//and now I'm stumped.
ActionScript Code:
//kind of where I think I should go if I use SHOW_ALL
bottemleftcornerbtn.x=0;//that was easy
bottemleftcornerbtn.y=stage.stageHeight-bottomleftcornerbtn.height;//does not work.. just tried it.
I have this flash website where i use Stage.scaleMode to dynamically resize the swf depending on the browser size. (i use A.script 2.0). So the width takes the whole screen and the height is scaled in proportion. My design is in a landscape format. It works fine, except that i need the swf to also be vertically centered in the browser Window. (explanantion - on certain screens, example a 19 inch PC monitor which is quite "squared", my flash movie expands the whole way across the width, and the height in proportion, but as my design is in landscape, i have a big empty space in the browser below the swf.)
This is how it is: This is how it should be:
Here is the code:
stop();
Stage.scaleMode = "noScale"
Stage.align = "TL";
[Code].....
I am creating an AIR nativeWindow. I am adding two children, an HTMLLoader and a Sprite. The child Sprite has two children, a TextField and a Sprite that will be used to draw. I have set stage.scaleMode = "noScale" and stage.align = "TL", which the HTMLLoader seems to respect. However, the child Sprite scales its children whenever I set a height.
public function BaseWindow(){
var winInit:NativeWindowInitOptions = new NativeWindowInitOptions();
winInit.type = NativeWindowType.NORMAL;[code]..........
How do I prevent the distractor Sprite from scaling its children?
Imagine situation when child component is scaled and parent component is scaled as well. I want line to be drawn without scaling in child component and to be scaled in parent. Is it possible to achieve this?
View 1 RepliesWhat am I missing here? According to the docs:
Quote:
When the value of the scaleMode property is not set to StageScaleMode.NO_SCALE, the stageWidth property represents the width of the SWF file as set during authoring in the Document Properties dialog box. This means that the value of the stageWidth property stays constant as you resize the Flash Player window. This property cannot be set. So stick this in a new FLA
[Code]...
and the traces are of different values. According to the docs, this shouldn't be happening. What's going on? Did I miss something little?
where I can find info about compiling flex 4.0 sdk on flex 4.5/4.5.1 sdk.I am having troubles. compilation goes well on 4.0 but whe I compile on 4.5 or 4.5.1 I get blank swf.
Note: I have set flash player 10.2 for compilation and also as default.
If I create an object like so:
class Foo {
[Bindable] public var property: String;
}
The class Foo has an implicit event dispatcher to handle property change events. How can I access that without making Foo explicitly extend EventDispatcher?
I wish to develop a softare for 3D object compression (by polygon reduction) in flex using papervision 3D. Could you please suggest me an efficient algorithm for the same?
View 1 RepliesI have implemented application client-server with spring blazeDs message services using JMS message destination. The idea is a producer declared in Java send message using activeMQ and consumer declared in Flex receives them. I have configured the AMFChannel with a polling interval 0, but I have seen when the consumer subscribes to the destination in Flex, the time request can be of up to 3 seconds.
[Code]....
I want to send a html webpage with my application in installation package,is it possible?
View 1 RepliesI have an J2EE Enterprise Application Project in which I would like to add a few Flex screens. How do I go about adding Flex capabilities.
I have build Flex/J2EE applications from scratch but can't think of the best way to do this.
I am currently using Flex Builder Plugin for IBM Rational Application Developer 7.5.
I have a tree with nodes , and a delete button , first user select the node and click this delete button , I want this node to be removed from the tree , Its not XML , every node in tree is of type Object
{label:'folder',children:[{label:'file1'}]}
I tried delete myTree.selectedItem (but compiler wont let me do it) also tried myTree.selectedItem = null (just unselects the item)and also how can I access reference to parent object of myTree.selectedItem ?
im trying to output my database information in a text input field in flex by using remoteObject(cfc). The information is being provided by a database using a query and an array collection. I'm just unsure how i go about taking the queried array collection information and display it into TextInput Fields.
[Code]...
in my variable i am getting error private var friendsList:VBox; "conflict exists with definition friendlist in namespace internal" what it is?
View 1 RepliesI am trying to access html files protected by basic authentication. Below is the code to do that but I still get the authentication dialog. I checked the fiddler and found that for the first request authorization header is present but for the subsequent requests which is requested to load the .js, css & images the authorization header is not added. This is the reason I am getting the auth dialog.
Is there a way to add authorization header to the subsequent requests as well?
[Code]...
I have a TabNavigator, and each tab is a Module. One of the modules is labelled Units and the full code of the module is posted in this post. There are several problems:
1) Forms are not populated with data from the datagrid selection.
2) Selecting a row and clicking delete gives the very-common error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
A trace on the valueObject unit within the selectionChangeHandler function gives NULL. Why? Note: In other modules (other tabs of the TabNavigator), I have DropDownLists populated with units. This means that the valueObject Unit is defined in the other modules. However, valueObjects should be private to modules, and not shared.
[Code]....
ow do you display HTML formatted text in a Spark custom item renderer (Actionscript)?
Sample Code:
The html content in item.post_content displays as plain text in the IconItemRenderer messageFunction snippet below (which is just the default generated code for Icon Item renderer):
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer iconField="iconField"
iconWidth="64" iconHeight="64" labelField="post_title" messageFunction="getPost">
[code]...
I am working on a grid example in flex using advanced grid control. I know we can easily group data by specifying the field name. At the group node level, other than the gorup name I want to be able to show data in the rest of the cells ( calculated data ) and I am looking for some dataRowBound event or similar to be able to hook some data in it.
Example: Grid displaying list of towns grouped by state. At the group level ( for each state) I want to show the total number of towns in each state. Here how can i show the total number in the town column.
I've embedded a MovieClip symbol with the [Embed] syntax into my AS3 project, which I'm compiling with the Flex 3 SDK. That MovieClip has instances of other clips within it that are placed on stage with instance names. I can't just access them by instance name like I would if I were compiling with the Flash IDE. How can I reference them?
View 1 Repliesi'm using swfloader to load swf file in the middle of the screen using the following command:
<mx:SWFLoader id="game_swf" source="crazy_counting.swf" x="198" y="0" width="721" maxWidth="721" height="531" maxHeight="531" />
now stage of the flash file takes the exact size that i stated by the flash file itself is overlapping the stage with some graphics
I have a Flex AIR2 application which uses native process to run CMD.exe. Application running fine on WinXP, Win R 2008 server. But not running on VISTA 64 bit OS. Flex not able to run CMD.exe when application installed in C:Program Files (x86). When I run application as Administrator mode it is working fine. Below is my code, I want to start cmd.exe as Administrator.
[Code]...
Here's what works with ant build.xml:
[Code]...
I tried the following values in Project > Properties > Compiler Options > Additional Compiler Options but none of them worked:
I am creating an AIR application using Flex. In it I use a file in application directory to store some data in it.Its working very well to read and write data to this file with various OS except windows 7. In windows 7 it is not working. May be its a permission problem.
How can i write file in the application directory with Windows 7 ?
I am writing a Flex application for use on a private intranet with no external Internet access. I want to use Google's 3D Maps Flex API, but it must be connected to the internet to download map tiles on demand.
Is there a way to locally cache the 3D map tiles and data so that I can run this app without an internet connection? And if not, is there a 3D GIS that supports Flex integration and allows for a local map cache?
I am currently developing a dynamic LineChart in FLEX 4.I am implementing a Tree control next to my LineChart, which will filter the LineChart dataprovider and lineseries. The tree control has several branches and ultimately 5 children (leaf nodes) at the bottom of the last branch.I need the leaf node/children to be displayed as checkboxes inside the tree control.As I understand,this will require overrides in the TreeItemRenderer class.This is where I am a little confused on how to implement that.Currently I can distinguish between leaf and branches using this code, in my main MXML component.I added this because it may be helpful to some beginning FLEXdevelopers, such as myself, who cannot easily find this functionality documented well:
private function treeClick(e:ListEvent):void {
_selectedItem = Tree(e.currentTarget).selectedItem;
if(mainTree.dataDescriptor.isBranch(_selectedItem)) {[code].....
I am looking at the TreeItemRenderer override class from the following example here: In the example, they override the "createChildden" super function to add checkboxes to the tree control.My question is, can I override the createChildren function directly in my MXML component, and not have to use an entire class file to override this functionality? Must I re-invent the wheel to do this?Also, how can I distinguish that my treeItem is a leaf node and not a parent, in the override function? I only want to add checkboxes to the leaf nodes, how can I differentiate? The following example adds checkboxes to all branches and leaf nodes, but I want to add checkboxes only to leaf node/children. How would you approach that?
override protected function createChildren( ): void
{
super.createChildren( );[code]............
Here is my tree tag:
<mx:Tree id="mainTree" dataProvider="{treeData}" itemRenderer="TreeCheckBoxItemRenderer" labelField="@label" showRoot="false" width="100%" height="100%" itemClick="treeClick(event)" />
My company want to develop an online multitouch scrumboard for our scrumteams. We are still in doubt between flex and silverlight as platform for the application. (don't want to fire a hole new flex vs. silverlight discussion again) Installation rate & platform independence are not critical to us, because it's just for teammembers and only windows 7 enables multitouch events in flash or silverlight.We would like some pros/cons specifically for this project (multitouch, rich user interface, integration with backends).[code]
View 2 RepliesI am working on an Adobe AIR (2.0) application that contains a feature to allow users to print documents (such as salary slips). Those documents are originally in PDF format. Due to circumstances we cannot directly display those PDFs in the AIR application (for example using flash.html.HTMLLoader). Therefore we convert the PDFs to SWFs (using the pdf2swf tool, see The SWFs are loaded into the application using a mx.controls.SWFLoader, like so:
<mx:SWFLoader
id="salarySlipImage"
loaderContext="{someLoaderContext}"
[code].....
How can I programmatically click the browser's Back button from within my Flex application. I'm using deep linking to allow the user to navigate back/forth inside my application. I want this to work when BACKSPACE is clicked inside the application as well, but Flex captures BACKSPACE and the browser doesn't get the event. I don't want to implement browsing history myself within the application, naturally. Can I send BACKSPACE to the containing browser?
View 1 Replies