Actionscript 3 :: Why Does Stage.stageWidth In Flash Builder 4.6 Using Flex On Android Not Work
Jan 11, 2012
I am creating a android app using adobe air (flex sdk 4.6.0) and i am trying to find out what the width of the phone screen is in pixels. So I am fallowing the tutorial here but when ever i copy the code into my project and click run it always gives me this error "TypeError: Error #1009: Cannot access a property or method of a null object reference." and goes to the line that has stage.stageWidth I have also tried stage.width but it does the same thing. So does stage.stageWidth no longer work or how do you tell the screen size of the tablet or phone? Was it replaced with something else for phones? I am trying to get the information so i can center images in the center of the screen using action script.[code]
View 1 Replies
Similar Posts:
Mar 13, 2011
I have created a simple "Hello World" Application using Flash Builder Burrito SDK. I have tested the result in the emulator it is working great. After that I deployed the application using "Export Release Build Option" and entered valid certificate details and created the .apk file. I copied the .apk file into the device and i run the application. I am unable to run the app. I have tried these in 3 android supported devices and in each of these I am getting different error messages.
I have mentioned the device in which I have tested and the error message I got while I tried to install the app (.apk file).
HTC Desire - "Error while parsing the package of the application"
Samsung Galaxy Tab - "Error while parsing the package of the application"
LG Optimus one (LG P500) - "Application not installed"
I have created a New Mobile Project in the flash SDK and added simple label "HELLO WORLD" in the view section. Before deploying I have installed Adobe AIR 2.5 in the device. I need to know whether any restrictions are there for applications developed using Flash Burrito Preview Release. (whether by default all android mobile version more than 2.1 will support it?) Also when I try to install "Tour De Mobile Flex" apk in LG Optimus, it is saying "Device not supported" message. How do I overcome these problems to run the apk file without any problems.
View 1 Replies
Sep 8, 2011
Mobile application runs perfectly in the debug mode - I can test it on the device etc... The problem is with the release build - it simply does not run. When I manually install .apk I don't get any errors messages, simply a green check mark and "Application not installed" message. Any thoughts? Running the latest version of air and Flash Builder 4.5.1
View 1 Replies
Nov 9, 2011
I made the simple application using flash builder 4.5.1 for both iOS and android. I test the application on my iphone and ipad, it working fine. But when I try to install on my android device(Samsung GT-5570). It get the following error message.Error occurred while installing the application:1603 KB/s (6108444 bytes in 3.719s)pkg: /data/local/tmp/Runtime.apkFailure [INSTALL_FAILED_INVALID_APK]I google about the error.I found that It is cause of my device have ARMv6 architecture.Now I have 2 question.Question 1. Is there any other reason of failing installation.Question 2. If the reason is same than any other way available to make build for ARMv6 and ARMv7 architecture phone.
View 1 Replies
Dec 13, 2009
I am using SWFOBJECT to embed my flash content. I have been worried about stage.stageWidth and stage.stageHeight returning 0 in Firefox/Internet Explorer; this problem is referred to in question #21 on the SWFOBJECT FAQ [URL]..I have been told that this problem is particularly prevelant on Macs. The SWFOBJECT FAQ (question 21) indirectly suggests that this problem does not occur with static publishing. Is this correct? Is it still advisable to implement a solution to this stageWidth/stageHeight problem, even if you are using static publishing?
View 1 Replies
Jul 1, 2010
can you tell me a simple and clean way to pass the dimension of the stage to another class, imported in my documentclass?
View 2 Replies
Oct 5, 2011
In as3 What is the difference between calling stage.width and stage.stageWidth I read somewhere that if we have nothing on stage then the value of stage.width is 0,but what happen when I have nothing on stage but loading contents dynamically on stage?I have tried this and when i have loaded content dynamically on stage then i have got
stage.width=value; // where value is dynamic number
View 4 Replies
Nov 8, 2010
when tried to build a AIR application for android using flex builder I did the following steps to do that .plz tell me where the error happened
1.Created Air application using flex builder that produced two type of files .swf and .xml files and cetification file
2.Created apk file from the above files using "Package assisstant pro"
3.then i installed AIR 2.5 run time in my emulator
4.after that i tried to install the apk file that Created from the 'package assisstant pro' then i tried to install the apk file by using command prompt then it show this error "INSTATTION FAILED INVALLID APK" .And also i cann't install other apk file (Sample air for android application apk file that downloaded from the site) that shows the same error,I succeed to install other application's(Say for printing hello world) apk file.[code]
View 1 Replies
May 17, 2011
I'm trying to use the Profiler for the first time so I don't know much about it. But it doesn't seem to work.I run my project under profiler, it says it is running, but no window shows up. Nothing. I can see the project's icon down there but I see no window at all.Can this be cause by the fact that I'm using Flex 4.5? You can the app in the dock and it shows its live objects, but I don't see the apps' window and cannot interact with it. The app is just a simple 400x400 window with some black shapes in it.
View 2 Replies
May 31, 2010
I'm having issue regarding the display when using Firefox 3.5 on MAC, I can see my menu and the display is correct. The menu just position above what it supposed to be positioned. It works fine with Safari on MACOSX.My flash size is: 1440x750It looks like Firefox can't recognize stage.StageWidth and stage.StageHeight. It returns 0.Some suggest implementing was to pass in the actual width and height of movie via FlashVars. The movie uses these instead of stage.stageWidth and stage.stageHeightDoes anyone have an example of code of how to fix that issue??
public function Main()
{
addEventListener(Event.ADDED_TO_STAGE, handleOnStage, false, 0, true);
[code]....
View 1 Replies
Jun 3, 2010
Working on personal full flash site and I can't really figure out how to make MC's position on Stage aligned on Firefox browser. Everything goes fine using Safari.
I have tried a method of set a timer every time it goes off (every 200 ms or so) it checks to see if stage.stageWidth > 0. If that is the case, do stop the timer and start resize on stage. However it's still not working on Firefox of MAC. :(
In my HTML code:
<link href="css/site.css" rel="stylesheet" type="text/css" />
Test Site
<script type="text/javascript">
var swf = new SWFObject("main.swf", "mymovie", "100%", "100%", "10", "#000000");
swf.addParam("allowScriptAccess", "always");
[Code]....
View 1 Replies
Jun 18, 2010
I've been working on a project that requires lots of scaling around a center point.
I always thought that stage.stageWidth and stage.stageHeight give you the dimensions of the stage you set in the properties panel no matter what. But when I went into fullscreen mode (with scaling), both the width and the height changed to the dimensions of the screen rather than staying the dimensions I specified.
View 1 Replies
May 17, 2011
In my AS3 code all the elements on the page are dynamically positioned depending on the current width and height of the SWF - providing it's not under a certain value, then the items are back in their original position.
When debugging in the Flash player the size all reports correctly however when run from a web browser it does not - initially.
This is my HTML & PHP code for the entire page:
HTML Code:
<?php
function hashId($fn) {
$hash=md5_file($fn);
[Code].....
But I cannot get the size to report correctly without, say, clicking a button.
It seems to me like I need to force flash to re-draw the screen, but I had no luck trying to do that.
View 8 Replies
May 7, 2011
I am using progressive streaming with VideoDisplay, the HTTP URL provided gets buffered completely even if I have configured it to start playing the video when the buffering reaches 20%, the trace message shows that the playing started(using mozilla /Flashbug+Firebug), but it doesnot show the video till the buffercounter reaches 100% How can I get the video stream to play at the 20% of stream.Code Segment where the check takes place
var loadedPct:uint = Math.round(100 * (event.bytesLoaded / event.bytesTotal));
trace('waiting...');
mainVideoCanvas.addChild(LoadingImage);
VidLoadingLabel2.text = loadedPct.toString();
[code].....
View 1 Replies
Apr 20, 2011
are there any alternatives for the Flash Builder Burrito IDE for mobile development based on the flash technology?
View 1 Replies
May 12, 2011
I'm developping a mobile application in Flash builder. So in Flash Builder Burrito , I was using the Flex Hero SDK 4.5.0 but they currently realesed the Flex4.5.0.20967.
I downloaded the zip file [URL]
I extracted it into a map on my C: drive. Then I opened my flash builder burrito. Added him by (Window>Flash Builder>Installed Flex SDK's. I his add and added my location.
This went very well. I changed my code with the new commands.
Next I wanted to test on my android phone but now my problem: I can't make any apk files anymore.
View 2 Replies
Sep 14, 2011
In actionscript 3 (as3) What is the difference between calling stage.width and stage.stageWidth. This was something I remember I got confused about in the past (Adobe's api docs are an artform in obfuscation
View 2 Replies
Jul 11, 2011
I installed the new version of FB 4.5.1 on a Win 7 x64 machine and tried the HelloWorld application, but I can't see any output on the Google Droid Pro emulator.
View 2 Replies
Apr 19, 2011
Is there any way to "round trip" Android projects between Flash Catalyst and Flash Builder? I'm using the latest beta versions (Burrito and Panini). If not, will this be available with CS5.5 when it's released next month?
View 1 Replies
Aug 27, 2011
I am currently developing a mobile application using the latest version of Flash Builder and I need to create a Global ArrayCollection to store information in that is pulled from a local DB. I can pull back the data from the DB fine however I cannot seem to access the Global variable when I try. I have the follng .as file called "Model.as" which is located in a folder called valueObjects and that file contains the following code:
package valueObjects
{
import flash.data.SQLConnection;
[Code]....
Then in a private function I try to access the ids ArrayCollection and populate it however I get the following error:
-1120: Access of undefined property ids.
-Access of undefined property ids
View 2 Replies
Oct 18, 2011
I am using flash builder to make an app for android/ios. How would you recommend I use assets such as images and sounds. Should I embed them or use loader? Any benefits to each one. I have a fair amount of assets.
View 2 Replies
Feb 23, 2012
I have this application that is basically the ubiqutous page turning component you can find online, but modified for mobile. It's for kid's storybooks. It's a mobile flex application in FlashBuilder 4.6. When I export release build for my mobile project, I see an option for desktop .air packaging rather than mobile. Works and looks great....but you can't sell a .air file on Mac App Store. I want to bundle the air runtime to create a .app, which hopefully I can get on the app store. However, this option is not available in a mobile project. I've tried figuring it out via commandline...
[Code]...
View 1 Replies
Jan 2, 2008
What 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?
View 5 Replies
Dec 14, 2011
The window for Flash Builder's mobile device emulator (in AIR) seems to be a bit too tall for a resolution running 1280x800. Is there a way to make it run smaller? 1280x800 is the highest resolution set-able on the laptop being used to develop for it.
View 2 Replies
Dec 15, 2010
I'm a little unclear as to how "states" work in Flex and Flash Bilder 4. Are states like "frames" in Flash Pro, or am I getting them wrong?
How would I show difference "screens" to a user? (login, admin panel - settings, main menu)I take it that I need to use states, but I haven't figured out how to do so. Should I be using Actionscript somewhere, something else?
View 3 Replies
Aug 12, 2011
I am trying to make my flex app work on Android, and that involves making an AIR app to run on Android. Seeing as the flex app needs the mic, an AIR app is required. I am using flash builder 4.5 on win7 with air 2.6. The trouble seems to be that most of it is now not available. For example mx.containers is there, but not mx.containers.viewStack. I notice that there are obvious equivalents in spark for some components but not others. VBox, HBox, Canvas VDividedBox, AdvancedDataGrid and associated custom renderers are the components my application uses the most. What is the fastest way to make this work on Android, I am under time pressure. Is there a site somewhere that recommends the best way to do this, and what components can be replaced with which?
[URL]
View 1 Replies
Sep 2, 2009
So I'm trying to do a simple graph with rollover definitions. I have the graph on one layer in the root along with the definitions. On a hit testing MC I have the following:
var defbox:info = new info();
var mcName = this.name;
var xPos = (MovieClip(parent).stage.stageWidth)/2;
[code]....
View 5 Replies
Oct 8, 2010
Experimenting with Flash as usual.Preloader's are always something that have caused me trouble.Here's what I typically use for a timeline based preloader in AS3:
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void {
var total:Number = this.stage.loaderInfo.bytesTotal;[code].......
I'm really interested in a preloader that loads right across the stage however - regardless of if the stage is resized.I should imagine it'll involve implementing = Math.round(stage.stageWidth); at some point?
View 9 Replies
Feb 18, 2012
I am trying to set masks and other component positions in relation to Stage size.AS3 CS5I trace stage.stageWidth on a 800x600 pixel stage and I get - 100My stage will scale within a Director piece.Is this a bug? Modal condition? Releated to scaling??
View 7 Replies
Jan 7, 2009
I created a custom class in a .as file. I then linked this custom class with a symbol from the library in my .fla file. However, I can't reference stage.stageWidth in my custom class file. I get a null object error.
I think this happens because the custom class file is associated with a symbol on the stage and not the stage itself. For example, if I set the fla file's Document Class to the name of my custom class I can reference stage.stageWidth in the custom class. But I don't do this because I am creating multiple instances of the symbol on the stage. In order to do that properly i found I have to set the class in the properties panel of the symbol to the underlying class which then defines how each symbol behaves.
Under this type of linkage, is there a way to reference the stage width from the class? I've tried root.stage.stageWidth and parent.stage.stageWidth to no avail. I also made sure to import flash.display.* in my custom class. Below is the code for my .fla file and my .as file. In the .as file you'll see the line "x = Math.random() * stage.stageWidth;". This is the line giving me problems. I could hard code it, as I do for the y variable on the next line, but I'd prefer not to in order to keep the code flexible.
[Code]....
View 3 Replies