mxmlc/fcsh ignoring [SWF(width="550", height="400", ...)] - apache-flex

I'm compiling an .as file using fcsh, which uses it mxmlc.
I use the following shell:
mxmlc /Users/johannesjensen/Desktop/Doodler.as -static-link-runtime-shared-libraries=true
But when I get the .swf on my desktop it's dimensions are 500x375 and framerate is 24 when I told it that it needs to be 550x400 and framerate needs to be 120 using
[SWF(width="550", height="400", frameRate="120", backgroundColor="#FFFFFF")]
High framerate because it's a drawing app
Any ideas why it ignores the [SWF()] thing?
I'm using Flash Player 10.1 on a Mac OS X 10.6.4 Snow Leopard

A quick Google search reveals that the SWF Metadata tag need to be before the class definition, but after the imports. It sounds like you're putting it before the imports.
Source:
http://blog.madebyderek.com/archives/2007/01/12/as3-projects-and-the-swf-metadata-tag/
Keep in mind this is an undocumented metadata tag. I had never heard of it before now. So I can't guarantee that this information is accurate.

Related

Qt: Taking screenshot of EGLFS window - pixel-perfect identical result?

We're using EGLFS to run a QML app on an embedded linux device without a X server. So I can't use the usual techniques for getting a screenshot (e.g. using a screenshot utility app). In this question I found the technique of using QQuickView::grabWindow().
My question: Is the result of this function guaranteed to be pixel-perfect identical to what the user sees on the screen? I'm worried that to grab the window contents, Qt might have to rerender the window using a different code path (e.g. render-to-texture), which may cause results to differ.
I'd like a reliable reference included in your answers, too.
As far as I can tell, the screenshot is not going to be identical. Follow the code from QQuickWindow::grabWindow: it ends up calling qt_gl_read_framebuffer, which is always going to read the image out as RGB(A)8. Your actual framebuffer might be different (for instance, it could be RGB565).
(I also seem to remember that one cannot use RGBA reading via glReadPixels out of a RGB565 framebuffer, but I am not 100% sure that's true in all OpenGL versions/variants...)
Depending on your drivers, a workaround could be reading /dev/fb0 contents. Anyhow, please file a bug report if you need this functionality.

qtwebkit qt5 beta webgl

I was trying to run WebGL application on QtWebKit (Qt 5.0 beta Version). I am using eglfs plugin on a mips based platform. I used QtTestBrowser as the test browser.
I ran an webgl site-
./QtTestBrowser -webgl -graphicsbased http://jsbin.com/ulazel
It reported no-webgl support.
I did a bit of debugging and found that in file
qtwebkit/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
it returns as it cannot find glViewport:
QGLWidget* glViewport = qobject_cast<QGLWidget*>(scrollArea->viewport());
if (!glViewport) {
//Returns from here....
return;
}
By enabling “-gl-viewport” I was able to get the glContext in HTML page. But it was not properly displayed. Also since every widget (launcherWindow etc) it was trying to create a “Window” intern calling eglCreateWindow() and resulting in memory issues (Around 12 window was created all full size of 1920×1080. Finally the displayed image is also not proper.
Any one have suggestion? where i am going wrong?
WebGL is functional with additional patches on top of Qt5. You might want to take a look at the patchset for WebGL for eglfs, at the below link.
https://bugreports.qt-project.org/browse/QTBUG-30405
(Note - I have validated this only on ARMv7, but I cannot see a dependency on arch for this patchset)

Flex unzip/uncompress huge files

I am having an AIR applicaiton which is supposed to uncompress the file of huge size (>1GB)
I tried commonly discussed utilities i.e. FZip nochump and few more
I face the same problem with all of them,
They tyr to unzip the entire file in the memory (using ByteArray.defalte method)
This works well with the files of small size howevre they just hang the applicaiton if the size of the file is big (>1GB)
Any suggestions?
Is there not a way you could use file spanning similar to the RAR formats. I think 7-Zip's 7Z supports it also. Depending on how to the decompression library is implemented, file spanning could reduce the memory usage theoretically.
Try looking into using the LZMA SDK a la 7-Zip:
http://www.7-zip.org/sdk.html
Maybe there's Flex bindings.
I agree with sammy, Air it's not the best solution for a task like that, IMHO it's better to include in your distribution a native utility to expand your files (remember that you need an utility for each platform that you want to support) then use the new Air2 API to invoke them. Doing this way the expansion of the archive is done in a separate process without freezing your app.
Maybe you can boundle just one utility if you are sure that every platform has a common runtime (ex. java).

Ada: plotting 2d graphs

it would be interesting to be able to plot a 2D graph within an Ada code rather than having to save values say to file and use an external drawing software afterwards. A search on the web has taken me to two packages: Win_IO and JEWL. I have been able to use WIN_IO though but the documentation is quite poor and having just started using it, it seems that it is not possible to resize the size of the canvas. I use the GPS editor and I get complaint when running Win_IO that some fonts are not available on my system and that the output will be ugly. Finally the plot doesn't itself pop up on the screen; One has to click on the exe file of the file being compiled and linked so as to get the graph.
I have taken a look also at JEWL but it doesn't seem to be able to plot graphs.
Are there more Ada packages available out there for plotting 2D graphs.
Thanks a lot...
My experience with GNAVI:
The installation instructions are at
http://www.gnavi.org/index.php?Command=Class&ClassID=Start&CID=381
Basically the installation consists of:
To use:
Place this directory on your path
cd to gnatcom and run: make install
cd to gwindows and run: make UNICODE=1 all
run: gnavi_ide and enjoy :-)
But the installation is plagued with errors:
C:\gnavi\gnatcom>install
Installing GNATCOM.....
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 2: Command syntax error
* 1 errors during make *
Install Completed
C:\gnavi\gwindows>make UNICODE=1 all
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 2: Command syntax error
* 1 errors during make *
And though C:GNAVI is on my path, the IDE still complains that icg.exe which is found in C:GNAVI is not on the path.`This is trouble with software which has not been fully tested!!! I was very disappointed that people can write irresponsible and incomplete installation instructions. Have the developers even found out that whether a normal user can install their software?
I have also try to look at AdaDesigner at https://gna.org/projects/adadesigner
Here, FireFox complains: This Connection is Untrusted
gna.org uses an invalid security certificate.
The certificate is not trusted because the issuer certificate is unknown.
I decided not to visit such a website.
PLplot is a cross-platform package for creating scientific plots. It has a well-documented Ada binding. For reference, this gallery illustrates a variety of plots. Click a thumbnail to view a full-size image. Click either Ada tab (standard or traditional) to see the corresponding source code.
I'd give a try to GTKAda. I'm not completely sure this subsystem would allow you to do 2D graphs as I've never used it for that purpose, but it can be done with GTK+ (C/C++).
There is also a guide on GTKAda and a reference manual, some documentation on the GTK toolkit itself may also come handy.
It depends on exactly what you want to do. For graphing node-based diagrams, the first thing I'd look into using is Graphviz. It has its own special graphing language it uses, but I'm all about using Domain Specific Languages when appropriate. Ada has great interoperability, so using DSLs with it can really make it powerful.
An example I found is AdaDesigner, which generates Graphviz DOT files to help visualze the structure of Ada code.
The one time in the past I had to do simple plotting, it was for a web app. I ended up dynamically generating SVG pages on the server side (even though it was poorly supported then). Support is better now, so I'd definitely use it again today.
If working directly on a Windows PC display appeals more to you, there are several options for GUI bindings, all of which should support drawing lines and points on a canvas. In addtion to GTK (which is both powerful and portable), there are a few Win32 API's floating around. I think one comes with Gnat. Another you might not be aware of is GWindows. It is part of GNAVI, which aims to be sort of an OpenSource alternative to Delphi. It isn't the most active of projects, but is (reportedly) quite useable, and is still being worked on and used. Here are some screenshots of it being used for plotting.
(source: gnavi.org)
MathGL is cross-platform GPL plotting library. It have C interface, so you can use it from yours code too. Also it can create a window with graphics -- i.e. you don't need to study/use other widget libraries in simplest case.

Flex: Does the flex compiler automatically optimize embedded PNG assets?

I was trying to further reduce the filesize of a SWF file by optimizing the embedded PNG graphics (using ImageOptim tool). To my surprise, this didn't yield any effect, so I created two test Images:
Original (433883 bytes)
Optimized (273723 bytes)
When embedding either of these assets in a simple ActionScript project, the compiled SWF is ~274kb in size. Which raises the question: Does Flex optimize embedded PNG assets during compile-time? If yes, is there some documentation about the optimization going on?
It can't be because of the SWF compression alone, because zipping the images doesn't reduce filesize at all.
Here's the Code for completeness:
package
{
import flash.display.Sprite;
public class SizeTest extends Sprite
{
[Embed("/assets/original.png")]
private var ImageAsset:Class;
public function SizeTest(){
}
}
}
The answer is yes, the flex compiler does automatically compress data using one of the inbult algorithms (probably ZLIB) and transparently decompresses it on the other side (flash player) just before it gives you access to the uncompressed data.
I was embedding a ByteArray into an SWF, and although the bytes are huge outside (200 KB), when embedded into a SWF it turns into 30 KB, producing almost exactly the same results as manually compressing this using ByteArray.compress("zlib").
I then tried manually compressing PNG/JPEG bitmaps, and it turned out larger than embedding it plainly using the [Embed] tag (172 KB as a compressed ByteArray vs. 168 KB as an embedded image). Letting the Flex compiler handle embedded data compression is actually better than trying to do your own tricks on the ByteArray side.
Edit: To answer your question on PNG embedding, its hard to tell what's going on inside the flex compiler/flash player. Although known for proper documentation, Adobe is also known for many "undocumented features". Your specific question is best sent to a flash player architect (eg Tinic Uro) or an adobe evangelist (eg Lee Brimelow), some of whom you can easily reach on facebook (see this list).
The swf format has internally a special format for 32 bit PNGs (those with an alpha channel) where they get split up into a 24bit png and a greyscale alpha mask, whereby the alpha mask gets JPEG compressed. No totally sure if Flex Builder does that kind of optimization since I remember that at least in an older version embedded PNG where not at all optimized.
Nevertheless, if you are looking for a tool that can optimize embedded images in swfs you should check out Joa Ebert's "Reducer": http://blog.joa-ebert.com/2009/08/08/reducer/

Resources