Flash performance inside mx:HTML in a Flex AIR app
Hi. I'm new to AIR development and after doing some basic tutorials I thought I'd make a little stream player app.
The amount of tutorials on the web made me choose Flex / Flash Builder over HTML & JavaScript. When I built the player in Flex I saw performance was terrible when out of focus, I would say it drops to 3 fps if not less. Surprisingly when I downloaded someone else's similar app, his didn't have that problem. On closer inspection - he made it in HTML & JavaScript and HTML AIR apps dont suffer from the same problem.
Is there a fix for this Flex performance problem?
I've made a video demonstrating the difference between Flex & HTML for your convenience: http://www.youtube.com/watch?v=OU2mfELhSC4.
Sure.
1.
Windows 7 Ultimate, 64bit, build 7600.
Adobe AIR 2.0.3.13070.
Unfortunately I only have machines with the exact same OS install at my disposal right now but I'll ask some people to test it on their boxes.
2. http://pastebin.com/AsdmD3Yb
When I point the mx:HTML to a youtube url instead of ustream.html the fps drops around to around 5 to 10. That's a lot more fps than when using ustream. Might be a clue to whats happening.
Similar Messages
-
Example working Flex AIR app for Android?
I'm having trouble getting even the most basic AIR app working on Android. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*"
width="600" height="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Label text="Hello World"/>
</s:WindowedApplication>
It works fine running on Windows in Flash Builder, obviously it's pretty simple. Here are the commands I use to put it on a Samsung Galaxy Tab with Android 2.2.
C:\Users\Ryan\Adobe Flash Builder 4\Test2\bin-release>adt -package -storetype pkcs12 -keystore C:\Users\Ryan\STG-Android.pfx Test2.air Test2-app.xml Test2.swf
password:
C:\Users\Ryan\Adobe Flash Builder 4\Test2\bin-release>adt -package -target apk -storetype pkcs12 -keystore C:\Users\Ryan\STG-Android.pfx Test2.apk Test2-app.xml Test2.swf
password:
test
C:\Users\Ryan\Adobe Flash Builder 4\Test2\bin-release>adb install -r Test2.apk
2286 KB/s (419172 bytes in 0.179s)
pkg: /data/local/tmp/Test2.apk
Success
A Test2 app icon shows up on my Galaxy Tab under Applications but when I run the app I just see a plain white screen, I don't see the words "Hello World". Any ideas? Does anyone have an example Flex AIR app that works on Android and can post the code so I can try it on my Galaxy Tab? I know AIR is installed correctly on my Galaxy because I installed an AIR app called South Park Avatar Creator that I got from the market and it works fine.
Thanks,
Ryan
P.S. Here is the Test2-app.xml from my non-working project above in case it helps. This is the default generated with a new Flex app in Flash Builder 4 using the Flex 4.1.0 AIR 2.5 SDK but I uncommented the andoid tags and set the visible tag to true.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/2.5">
<!-- Adobe AIR Application Descriptor File Template.
Specifies parameters for identifying, installing, and launching AIR applications.
xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.5
The last segment of the namespace specifies the version
of the AIR runtime required for this application to run.
minimumPatchLevel - The minimum patch level of the AIR runtime required to run
the application. Optional.
-->
<!-- A universally unique application identifier. Must be unique across all AIR applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>Test2</id>
<!-- Used as the filename for the application. Required. -->
<filename>Test2</filename>
<!-- The name that is displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>Test2</name>
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
<versionNumber>1.0.0</versionNumber>
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->
<!-- Description, displayed in the AIR application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<!-- <description></description> -->
<!-- Copyright information. Optional -->
<!-- <copyright></copyright> -->
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
<!-- <publisherID></publisherID> -->
<!-- Settings for the application's initial window. Required. -->
<initialWindow>
<!-- The main SWF or HTML file of the application. Required. -->
<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
<!-- The title of the main window. Optional. -->
<!-- <title></title> -->
<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
<!-- <systemChrome></systemChrome> -->
<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
<!-- <transparent></transparent> -->
<!-- Whether the window is initially visible. Optional. Default false. -->
<visible>true</visible>
<!-- Whether the user can minimize the window. Optional. Default true. -->
<!-- <minimizable></minimizable> -->
<!-- Whether the user can maximize the window. Optional. Default true. -->
<!-- <maximizable></maximizable> -->
<!-- Whether the user can resize the window. Optional. Default true. -->
<!-- <resizable></resizable> -->
<!-- The window's initial width in pixels. Optional. -->
<!-- <width></width> -->
<!-- The window's initial height in pixels. Optional. -->
<!-- <height></height> -->
<!-- The window's initial x position. Optional. -->
<!-- <x></x> -->
<!-- The window's initial y position. Optional. -->
<!-- <y></y> -->
<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
<!-- <minSize></minSize> -->
<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
<!-- <maxSize></maxSize> -->
</initialWindow>
<!-- We recommend omitting the supportedProfiles element, -->
<!-- which in turn permits your application to be deployed to all -->
<!-- devices supported by AIR. If you wish to restrict deployment -->
<!-- (i.e., to only mobile devices) then add this element and list -->
<!-- only the profiles which your application does support. -->
<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
<!-- The subpath of the standard default installation location to use. Optional. -->
<!-- <installFolder></installFolder> -->
<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
<!-- <programMenuFolder></programMenuFolder> -->
<!-- The icon the system uses for the application. For at least one resolution,
specify the path to a PNG file included in the AIR package. Optional. -->
<!-- <icon>
<image16x16></image16x16>
<image32x32></image32x32>
<image36x36></image36x36>
<image48x48></image48x48>
<image72x72></image72x72>
<image128x128></image128x128>
</icon> -->
<!-- Whether the application handles the update when a user double-clicks an update version
of the AIR file (true), or the default AIR application installer handles the update (false).
Optional. Default false. -->
<!-- <customUpdateUI></customUpdateUI> -->
<!-- Whether the application can be launched when the user clicks a link in a web browser.
Optional. Default false. -->
<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
<!-- Listing of file types for which the application can register. Optional. -->
<!-- <fileTypes> -->
<!-- Defines one file type. Optional. -->
<!-- <fileType> -->
<!-- The name that the system displays for the registered file type. Required. -->
<!-- <name></name> -->
<!-- The extension to register. Required. -->
<!-- <extension></extension> -->
<!-- The description of the file type. Optional. -->
<!-- <description></description> -->
<!-- The MIME content type. -->
<!-- <contentType></contentType> -->
<!-- The icon to display for the file type. Optional. -->
<!-- <icon>
<image16x16></image16x16>
<image32x32></image32x32>
<image48x48></image48x48>
<image128x128></image128x128>
</icon> -->
<!-- </fileType> -->
<!-- </fileTypes> -->
<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-configuration android:reqFiveWayNav="true"/>
<supports-screens android:normalScreens="true"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
<application android:enabled="true">
<activity android:excludeFromRecents="false">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
]]>
</manifestAdditions>
</android>
<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
</application><?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*"
width="600" height="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Label text="Hello World"/>
</s:Application> -
I've had a Flex Air app on Playbook since it Adobe first supported Blackberry. But, I haven't had a client requirement for deploying to Blackberry in a long time. What is the status on Adobe's support for Blackberry? On the Air Dev Center, I see no references to Blackberry anymore???
Can I still build a cross-platform app for latest Blackberry devices (Blackberry 10, Playbook, etc.) using the standard Flex mobile components and Flash Builder 4.6?
After a brief search on Blackberry's Air page, it looks like they moved to requiring the QNX components, ANEs and a new pure AS3 SDK only. If I have to re-write code specific for Blackberry now, then it makes no sense for me to offer that to my clients. (unless they only want BB).
So, where does Adobe stand now with Flex Mobile in Flash Builder deploying to Blackberry 10 and the Playbook?
I'd appreciate if you could help bring me back up to speed.
Thanks,
DonAbsolutely, Flex works very well indeed and is fully supported on BlackBerry PlayBook and BB10 devices. The free packaging module for Flash Builder is part of the BB SDK for AIR and is supplied by RIM, not by Adobe.
With Flex you'll of course be using Adobe UI components, which look less native than the BB-supplied "pure AS3" UI components unless you skin them. But they work just fine. -
A way to expire an FLEX/AIR app?
Using Flex 3 I would like my AIR app to expire in 30 days after install. Anyone have any advice or example of this?
You need a wireless flash drive.
Google "SanDisk wireless flash drive" . -
Create checkums / md5's in flex / air app
can you create md5 checksums using flex / air ???
have been searching but nothing found yet!!
in php you can use a nice function md5_file && md5 to generate md5's - can this be done in an air / flex app????
regards
OliverTry this link. http://gsolofp.blogspot.com/2006/01/actionscript-3-md5-and-sha1.html
-
Browser inside a Flash/FLex/Air-App with WebGL-Support?
Hello,
I´m using Adobe Air/Flex to build a Desktop App. Inside the App the user should be able to access an Internet Browser. This part is actually working so far.
BUT: THE ADOBE AIR BROWSER IS NOT SUPPORTING WEBGL.
Is there any method to activate the WebGL Support so I could open WebGL-Dependent URLs from Inside my Desktop App?
Sure, I could tell the User he should Alt+Tab to switch to an WebGL-Compatible Browser, but it would so much better if this all would work from inside my Application.
Thanks for answering!
StefanThe syntax for the update is incorrect, you can use the update statement as
sqls.text = "UPDATE videos SET thumb = 'ram' + '''s' where id = 2";
Let me know if this worked. -
Why won't the flash player work in the html loader in my air app
Air is very new to me. I am working on a desktop app that has an html loader in which can only go to
certain web pages. If the url contains any flash content on the page, the html loader will not show it. Why is this?
Any help on this subject would be greatly appreciated..Have you try with <mx:HTML>
Sincerely,
Michael
El 12/05/2009, a las 17:06, dbn2d <[email protected]> escribió:
>
Air is very new to me. I am working on a desktop app that has an
html loader in which can only go to
certain web pages. If the url contains any flash content on the
page, the html loader will not show it. Why is this?
Any help on this subject would be greatly appreciated..
> -
Google Trends in flex/AIR apps
Hello
I want to build app that uses the google trends data , can any one help me were to start, any API, or examples
thanks.Absolutely, Flex works very well indeed and is fully supported on BlackBerry PlayBook and BB10 devices. The free packaging module for Flash Builder is part of the BB SDK for AIR and is supplied by RIM, not by Adobe.
With Flex you'll of course be using Adobe UI components, which look less native than the BB-supplied "pure AS3" UI components unless you skin them. But they work just fine. -
SQLite error in Flex/Air App:
I am trying to do a simple SQLite query from inside and Air application:
Statement.text = 'SELECT Ingredient' +
'FROM Ingredients'+
'WHERE FoodCatagory_FK = 6'
It works just fine in when I exicute the query in SQLite Manger, however in Air I get the follwoing error:
SQLError: 'Error #3115: SQL Error.', details:'near 'FoodCatagory_FK': syntax error', operation:'execute', detailID:'2003'
Not sure why it does not work, it seems pretty strait forward.
Thanks,Hi,
You have to leave a space either after
Ingredients
or before
WHERE FoodCatagory_FK
Thanks,
Tamil -
SQLite error #3115 in Flex/Air App: with (')
Hi,
I am trying to do a simple SQLite query from inside and Air application:
var sqls:SQLStatement = new SQLStatement();
sqls.sqlConnection = sqlc;
sqls.text = "UPDATE videos SET thumb = 'ram's' where id = 2";
sqls.execute();
I need to add ' same as ram's
Error:
SQLError: 'Error #3115: SQL Error.', details:'near 's': syntax error', operation:'execute', detailID:'2003'
I'm using "addslashes()" but not working
Not sure why it does not work. Please help me.
Thanks,
DhavalThe syntax for the update is incorrect, you can use the update statement as
sqls.text = "UPDATE videos SET thumb = 'ram' + '''s' where id = 2";
Let me know if this worked. -
Flex Air App... and SQLite
I was hoping someone can point me in the direction to learn the SQLite on Adobe Air... I need something simple to start out... Most of what i found is rather complicated, and get's kind of confusing...
Do you have to create the database at run-time?http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/
http://work.rowanhick.com/2007/06/12/working-air-sqlite-datagrid-example/ -
Hi,i use html,css,js write air app,when adt command support apk?
my app can run in windows xp,and i want it run in android too;
now is:error 304,initial window content is invalidits the same
SW01#show sdm prefer
The current template is "desktop default" template.
The selected template optimizes the resources in
the switch to support this level of features for
8 routed interfaces and 1024 VLANs.
number of unicast mac addresses: 6K
number of IPv4 IGMP groups + multicast routes: 1K
number of IPv4 unicast routes: 8K
number of directly-connected IPv4 hosts: 6K
number of indirect IPv4 routes: 2K
number of IPv4 policy based routing aces: 0
number of IPv4/MAC qos aces: 0.5K
number of IPv4/MAC security aces: 1K
thxs -
Convert HTML/javascript AIR app to flex-based AIR app?
Hi all,
I've already built an AIR app using HTML/javascript that I
would like to monetize.
I would like to use O2app's E-Commerce framework, which right
now only supports Flex-created AIR apps.
My question: Is there a simple way to "convert" an
HTML/javascript AIR app to Flex 3 format? I'd rather not have to
rebuild the app from scratch in Flex 3 if I don't have to. :)
Thanks,
AlHi,
There's no simple way to convert an HTML AIR app to flex.
But it is possible to create HTML Root windows from a Flex
AIR App. By root window, I mean the same kind of window that is
launched when you launch an HTML AIR App.
For more info, look at the HTMLLoader.createRootWindow()
call. (This will be available from a Flex AIR app as well) -
HTML window in AIR app can't open new window
Hi, By allowing HTML content to be displayed inside our AIR app it's possible for our partner organization to write their own custom features hosted on HTML pages at their site, but for their content to appear integrated seamlessly within our AIR app's container so that it looks like it belongs there...
We've successfully got an HTML window within our AIR app that navigates to content in a sub-folder on a web-hosted domain. Content displays correctly and hyperlinks function within the HTML window as we'd expect apart from three scenarios that appear to be manifestations of the same problem:
A hyperlink on a page shown in-app with a link to a PDF stored on the web server has no action
A hyperlink on a page shown in-app with a link to a video file stored on the web server has no action
A hyperlink on a page shown in-app with a link to another site (target="_blank" parameter) has no action
All three hyperlink scenarios work as we'd wish if we navigate to the page in a standard browser.
How can we code the HTML so that we can display selected content in an HTML window inside the AIR app; but have selected hyperlinks invoke the user's standard web browser, or launch Adobe Reader, or play a video file etc?
Note, we understand how to do those things within AIR itself, but can't figure out how to achieve this from inside the HTML window in the app.Hello,
As to "_blank" links:
this is long-standing lacking feature - as there is no introspection of event of such type - so it goes and could not be prevented. One could either handle all navigation with system browser (all links open in system external browser) or handle them in embedded browser - similar issue is bugging people using phoneGab with jQueryMobile - application eats all external links or none at all). There are solution for that including runtime introspection of DOM object to retrieve all anchor (a) tags in rendered document and attach custom click handler via host object like on complete:
var document:Object = html.htmlLoader.window.document;
if(!document && !document.hasOwnProperty("getElementsByTagName")) return;
var linksArray:Object = document.getElementsByTagName("a");
if(!linksArray) return;
var a:Object = null;
for(var i:Number = 0; i < linksArray.length; i++)
a = linksArray[i];
if(a)
a.onclick = function(event:Object):Boolean
if(event.target.hasOwnProperty("href") && event.target.hasOwnProperty("target"))
if(event.target.target != "_blank") return true;
flash.net.navigateToURL(new URLRequest(event.target.href));
return false;
but if you have control on what content is provided you could take care of handling links depending on runtime feature detection that way in javascript:
<script type="text/javascript">
function handleClick(a)
if(!window.runtime) return true;
if(a.hasAttribute("target") && a.getAttribute("target") == "_blank")
var href = a.getAttribute("href");
var req = new window.runtime.flash.net.URLRequest(href);
if(req) window.runtime.flash.net.navigateToURL(req);
return false;
</script>
<a href="http://www.bbc.co.uk/" target="_blank" onclick="handleClick(this);">BBC</a>
<br />
<a href="http://www.google.com/" onclick="handleClick(this);">Google</a>
(above could be scripted globally with help of jQuery for example for all links without much coding).
In 2.7 there is new event introduced to help with introspection so one could prevent event if link is internal and do whatever is expected in application:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml
If you post some details on how PDF and video content is expected to be shown in html I'm sure someone would share some hints as well,
regards,
Peter Blazejewicz -
URGENT!!! Google Earth with Flex/AIR
We are trying to create a demo flex/air app and would like to know if anyone has any idea to implement Google Earth with flex/air. I know it is possible to do this on a web browser with google earth plugin.
If anyone has any idea, link or samle code, please let me know.
Any help is highly appreciated. Thanks.
KushanAt the risk of sounding Glib:
http://www.google.com/search?q=Google+Earth+and+Flex&ie=utf-8&oe=utf-8&aq=t&rls=org.mozill a:en-US:official&client=firefox-a
http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs= o6e&q=Google+Earth+and+Adobe+AIR&aq=f&oq=&aqi=
Maybe you are looking for
-
404 error when publishing to FTP server.
I'm getting the 404 error when publishing my iWeb site to my FTP server. Please help. It says I have a good connection and publishes but then I get the error when I "Click to go to the site." I've read where I have to upload the file to my server b
-
Value of the start in the Select with in a Hierarchical Query
Exist any way for put in the select the value of the start with in a Hierarchical Query? An example: I'll need sth like CTH@> select n code, level, np code_parent, 1 code_first_parent 2 from demo 3 start with n=1 4 connect by np = prior n 5 ; CODE LE
-
How to use Spell-check functionality for textbox (like Orkut, gtalk)
How to use Spell-check functionality for tex Hello Friends, I am working on a JSP application. I wanted to add Spell check for text box like we have here, when we post a message. It automatically shows red line under the word, when ever spelling is w
-
When I wanted to turn off my macbook pro, the menu bar disappeard. There's nothing visible on my screen except my background picture and the cursor. I can't even turn off the macbook with the on/off button.
-
Classic Scenario: follow on document from BID
Dear All, We are trying to create a PO from an accepted BID . We can create the PO, and if we check it in the backend system, everything is OK. Our problem is that we are trying to find in SRM, somewhere that shows us the follow on document of the Bi