Flex :: Does Compiler Automatically Optimize Embedded PNG Assets?

Jun 29, 2010

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(){
}}}

View 2 Replies


Similar Posts:


Flash :: Flex - Access A Stage Instance Name From A SWF Embedded With The Flex Compiler?

Sep 10, 2009

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 Replies

Flex :: How To Get Embedded SWF To Interact With Project Assets

Jan 13, 2011

I have a Flex project in which I am embedding a Flash SWF containing an image viewer. The SWF file I'm embedding is supplemented by an XML file, which contains a list of images to show, and an images folder containing the images. The problem I'm running into is that the embedded SWF file is unable to load the pictures. I am able to see the forward/backward navigation buttons, but there are no loaded images. When I view the SWF file outside of the Flex project it works fine. Is this because Flex isn't allowing the SWF to reach outside and access other project assets?

Here's my code for embedding the SWF:
<mx:Script>
<![CDATA[
import mx.controls.Image;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
[Code] .....

View 2 Replies

ActionScript 3.0 :: Flex Compiler - Embedded Fonts Not Working

Jun 5, 2010

I cannot get embed fonts working Everywhere I look it says to do it like I am doing it below, but it doesn't work. I am using FlashDevlop with Flex compiler. There are no error messages. I have tried taking everything out of the Embed directive and adding it in one by one, but no affect.
When I use the system font, it works.
When I use the embedded fonts without setting embedFonts to true, I get TimesRoman.
When I use embedded font with embedFonts to true, I get nothing.

ActionScript Code:
package fontManager{
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
[Code] .....

View 5 Replies

Actionscript 3 :: Use Timeline Scripting On Embedded SWF Assets W/ The Flex SDK?

Sep 11, 2009

I've embedded a SWF into a class using this syntax above my class definition:

[Embed (source='/../assets/MyMovieClips.swf', symbol='SpecialMovieClip')]
public class SpecialMovieClip extends MovieClip

The MovieClip asset seems linked with my class okay, and instantiates along with it, and is visible, but:

I can't access instances placed on stage within that clip. The timeline scripting seems non-functional.

Is this the drawback of embedding SWF files at compile-time with the Flex SDK? So, maybe I should just go back to compiling with the Flash IDE if I want timeline scripting or instances positioned on-stage?

View 2 Replies

Flex :: Asdocs Seems Unable To Find Embedded Assets?

Jul 25, 2010

I'm running asdocs from a .bat file with flex sdk 3.2.0 (I have replaced my long project root folder with PROJECTROOT):"C:Program Files (x86)AdobeFlex Builder 3sdks3.2.0inasdoc" -source-path . "C:Program Files (x86)AdobeFlex Builder 3sdks3.2.0" "_PROJECTROOT_Componentssrc" "C:\_PROJECTROOT_assets" -doc-sources .PAUSE"Unforunately, I keep getting errors similar to this:"_PROJECTROOT_assetsstyles.css(344): Error: Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "close_button.png")'.downSkin: Embed(source="close_button.png");"I really don't understand this as "close_button.png" is in the same folder as styles.css. When I build the project from within flexbuilder, it compiles it fine and does not throw any errors.

View 2 Replies

ActionScript 3.0 :: Optimize Flash For Loading External Assets (videos/pictures)?

May 17, 2010

I'm loading a lot of external videos and pictures and I'm wondering what is the best way for handling the loaded videos and images. Should I unload them after they have finished playing and reload them whenever they are needed, or it's not required since they just use the clients memory and not the cpu cycles when inactive?

View 2 Replies

Actionscript 3 :: Optimize Random Seeking Of Embedded Video In Flash?

Apr 8, 2011

I have an Embedded (synchronized with timeline) clip in a flash movie.I am controlling the currentFrame of the clip by dragging a slider left to right (to simulate rotating an object).The problem is when I go forwards, motion is smooth, but if I drag to the left Flash cannot seem to efficiently play back in reverse and the motion is extremely jerky.Obviously I'm skipping frames depending upon the position of the mouse, but there is a very noticable lag when currentFrame is decreased vs. increased. Is there a way to optimize an embedded timeline clip for reverse random seeking like this?Possible solutions (untested) :Use video instead of embedded - I would expect this to make the situation worse though!Create a second reversed video for when scrolling to the left. This would probably double the file size.

View 2 Replies

ActionScript 3.0 :: SWC With Embedded Assets?

Jan 27, 2010

I used to be able to create distributable components in AS2 (swc files) containing class code and assets (movieclips). And it used to be really easy.Now I am struggling with Flash CS4 and AS3 and all my attempts were frustrating, as no matter what I try it simply doesn't work. I am starting to assume that maybe it is not possible anymore to do in AS3? Maybe this kind of thing is deprecated in Flash now???

Let's see what I have tried:

1) I started with a new FLA and named it 'MyComponent.FLA'. Then I drawed a green square, converted it to a mc and named it as 'MySquare'. Then I tagged 'Export for ActionScript' and 'Export in Frame 1'. Then I named the class as 'MySquare' and set the base class to 'flash.display.MovieClip'. This is my asset (a green square movieclip).

2) Created an empty movieclip and dragged the asset within it. Then I named it as 'MyComponent'. Then I tagged 'Export for ActionScript' and 'Export in Frame 1'. Then I named the class as 'MyComponent' and set the base class to 'flash.display.MovieClip'.

3) Right-clicked it in the library and chose 'Component Definition'. Then in class field I typed 'MyComponent' and tagged 'Display in Components Panel'.

4) Crated a new AS file, called it 'MyComponent.AS' and typed the following code:

Code:
package {
import flash.display.MovieClip;
public class MyComponent extends MovieClip

[code]....

5) Back to 'MyComponent.FLA', right-clicked the 'MyComponent' object in the library and chose 'Export SWC file'. That was ok, no warnings, no errors. Then I just copied this new SWC to my components folder.

6) Created a new FLA and named it 'test.FLA'.

7) Reloaded the components panel, and my new component showed up. Then I dragged it into library.

8) Then I type the following code:

Code:
var test:MyComponent = new MyComponent();
trace (test.visible)

9) I ran the new app and it was ok, no errors and no warnings. The trace statement spit out 'true' what means that the new class is really there, but... I cannot see the green square. But when I click onto the 'MyComponent' in the library, the preview shows up the green square, what means that it IS THERE in the component. So, why it doesn't show up in the stage after the class be intantiated?

View 4 Replies

ActionScript 3.0 :: Embedded Swf Not Loading Assets?

Oct 3, 2011

I have a site that contains a page with a fancybox pop up which contains a .swf.This swf loads a sound file and a thumbnail (mp3 and jpeg). When I view this by double clicking the swf it works fine, when I navigate directly to the swf in the browser it works fine, however when I try to view the embedded swf it does not load the jpeg or the sound file. I have another page which does the exact same thing except it loads a different swf which only loads a video file and this works perfectly.

AS3 code :

Code:
package www.elementalstudios.co.za {
import flash.display.Sprite;[code].....

Where the $theInner is a javascript variable that is used to set the innerHTML value of the div that I want to have containing the swf and $jUrlArray is an array of filepaths to various folders containing different sound files and thumbnails (each folder also contains the swf).The thinking is that the swf looks for the files as "sound.mp3" so the swf would assume that file is in the same folder it is in, therefore I'm only loading the swf from the different folders.

View 1 Replies

Actionscript 3 :: Clear Out Embedded Bitmap Assets In AIR?

Mar 15, 2012

I'm creating an AIR 3.0 app.

For a lot of my graphical assets I'm using the Flex embed metadata to embed bitmap objects as Classes and then instantiating them.

The problem is that it seems these never get garbage collected. I haven't found much info online but I've seen a couple of posts that seem to confirm this.

Anytime one of my classes gets instantiated that has these embedded assets, they always create new instances of the Bitmaps and BitmapDatas rather than reusing what's already in memory. This is a huge problem for memory. And I can't find any way of de-referenciong them or getting them to leave memory.

So the only solution I can think is to just load the graphics from disk rather than using the embed tag. But I'd rather not do this seeing as how when the app is packaged and installed, all of those graphcial assets will be on the end users computer rather than contained within the SWF.

View 2 Replies

ActionScript 3.0 :: Executing Code Before Loading Embedded Assets?

May 27, 2011

Is there a way to execute code (like a preloader) before loading the embedded assets? I'm using the [embed] tag with CS5, and I'd like to avoid using an external preloader.

View 9 Replies

Flex :: Compiler 4.0 25% More Rapid Than Compiler?

Aug 5, 2011

Its stated in adobe site that the Flash Builder 4 compiler is indeed 25% more performing than the previous Flex Builder 3 compiler.

How can I confirm that?

For example if I make a simple application on Fx3 and the same on Fx4, then how would I compare the compiler performance using my project?

View 1 Replies

Fonts Automatically Embedded Like A PDF?

Dec 28, 2007

When you use funky/weird fonts in a fla are they embedded automatically like a PDF file? So if the viewer doesn't have that font they can still see it?

View 3 Replies

ActionScript 3.0 :: Automatically Stop Embedded Video When Go To Another Scene?

Jan 14, 2009

I have a movie with two scenes, each scene has a video. When I go from one scene to the other, I want the video in the previous scene to stop playing. But when I go to the next scene, I can hear the video playing from the previous scene. How can I automatically stop the video from the previous scene, when I go to the next scene.

View 0 Replies

Optimize My Homebrew Flex Game?

Jan 5, 2011

I have a question about making flash games in Flex.Right now I am developing a 2D fighting game, here's the link[url]...

However, I am not sure how efficient I programmed the main loop.

Since I have never read a tutorial or seen any other Adobe Flex games out there, I didn't know how to implement them. I have a Timer instance that calls an update function every 24 frames, which updates all of the game objects and views. [code]...

View 1 Replies

Html :: Embedded Flash Media Player Is Not Starting Automatically Upon Webpage Load?

Feb 7, 2012

My flash media player is not playing automatically when my webpage loads. I have changed the settings from 0 to 1 (which should auto start the file), but still does not start the song automatically. This occurs in IE, FF, and Chrome.

<object type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" width="200" height="20">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />

[code]...

View 1 Replies

Flash :: Self Updating Air Application Assets Without Re-downloading Assets Already Downloaded

Feb 10, 2011

I want an air application to be able to update the assets it uses, but minimizing the download needed, so only downloading files added since it last updated.I'm thinking this would include a server portion which would zip the needed files based on a version number? Has anyone implemented anything similar / got any thoughts on the best approach to building this sort of system?

View 1 Replies

JQuery :: How To Optimize Flex Image Slideshow

Feb 17, 2012

I have a web page with an image slideshow. JQuery calls a Flex app with a list of jpg images to load and display. Can Flex load and display the first image and then continue loading the rest of the list or can Flex only do one thing at a time (i.e. load all the images and then start the slideshow)? There is a significant delay while all the images load and I need to sped up the slideshow.

View 1 Replies

Flex :: View State Transitions Optimize For Mobile?

Jul 26, 2011

I have decided to go the route of using ViewNavigator and having one view with 3 states. Each state is a "page". It runs just fine on the desktop but when compiled for mobile, the transitions between the pages is really laggy, even for the Samsung Galaxy S. The phone has the 2.7 runtime and I recompiled my application with ADT 2.7, still no performance increase.

I have also tried cacheAsBitmapMatrix on all 3 pages, which are all contained in a VBox and that hasn't shown any significant performance bumps. All I'm changing is the y component of the VBox for each transition.

EDIT: I have done some more research and I am now to the point where I have hardware acceleration turned on and cacheAsBitmap = true and cacheAsBitmapMatrix = new Matrix(). I am also using Stats.as to see the FPS. I notice on my state changes I go from 25 FPS to 2 and then it goes back up again.

View 1 Replies

Flex :: Setting Compiler.theme Option For Halo/Flex 4 In FlashDevelop?

Jul 12, 2010

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:

View 2 Replies

Flex :: Flash - Wrapping Or Embedding And MP3 In A SWF Using Flex's Mxmlc Compiler?

May 13, 2010

Our Flash web-based applications play lots of audio for narration and sound-effects. Some of our customers have firewall rules that block downloading of MP3 and other audio files. So, we need to wrap those MP3 files in SWFs. In the past, I've written JSFL scripts that automate the Flash IDE and walk through a complicated, fragile set of steps to embed MP3 files into FLAs and then publish those to SWFs. Now, Flex SDK provides the mxmlc compiler. I've mixed ANT into our workflow, and command-line and automated builds have been a joy. So, I want to make transcoding or wrapping of MP3s part of our build process. I've found Embedding Asset at Compile time in Pure AS3, but this will require that I write a script to generate a wrapper class AS file. Is there a cleaner way to wrap or transcode MP3 files into SWFs?

View 1 Replies

Flash :: Compiler To Use Both The 3.5 SDK And 4.0 SDK In Flex?

Feb 16, 2011

There are some classes that were taken out of the 4.0 flex sdk and I would like to know how to configure my compiler to use both sdk's, if it is even possible.

View 1 Replies

ActionScript 3.0 :: Embedded Fonts - Automatically Registers The Font Using The Font.registerFont Method

Nov 13, 2009

I have generated an swf file that contains my embedded font of specified Unicode range, then I am loading this swf into my application. The code in the generated file for the font, automatically registers the font using the Font.registerFont method. I then load this swf file into my application, I never add it to the display list, I just created an instance of the file so that the code is executed to register the font.

Then I use the font name when I create embedded text fields and there you go it works... well it used to, I am not having any luck at the moment though. Sometimes it displays fine, other times it all appears cut off and I see a few pixels of the text I am trying to display.... Anyone else had a similar issue? Know what it might be? I have created a class below that I am using for the embedded font text, any issues people see with this?

[Code]...

View 1 Replies

Get A Movie Clip To Automatically Load Up Another External Clip After Playing An Embedded Flv?

May 24, 2010

I'm trying to get a movie clip to automatically load up another external clip, after playing an embedded flv.

This is what I've tried so far:

var holdFrame = setInterval( holdFrame, 5000);
gotoAndPlay(
_root.mc_holder.loadMovie("swf/library.swf"));
clearInterval (holdFrame);

Although it throws no errors, the setInterval is ignored and it just loads direct into the next mc clip.

View 9 Replies

Flex :: Action - Reuse Flex Library Assets?

Dec 24, 2010

I want to reuse the TitleWindow's closeButton inside a simple Flex component I am writing, but I'm having trouble getting it to compile. I copied the code that deals with the closeButton, which looks somewhat like this:

[Code]...

View 1 Replies

AS3 :: FlashDevelop (Flex) And Localized Compiler Messages

Oct 20, 2009

I am completely new to the whole FlashDevelop/Flash/etc toolchain, but wanted to do some experimenting. I installed FlashDevelop and Flex SDK on my laptop, and thinks worked out just fine, except for one thing: the compiler messages are localized! Messages like "gebruik van een niet-gedefinieerde eigenschap" (Dutch.. sort of) are limiting my productivity. I don't recognize them because they look nothing like what I'm used to in any other programming environment, as a proper sentence they make even less sense than English error messages, and I certainly can't google them properly. Now I've already seen there are a couple of xml files and java/mxmlc/fcsh/etc configs I can tweak, but nothing so far helped.

[Code]...

View 3 Replies

Flex :: Locale Nl_NL In My Compiler Options?

Nov 15, 2009

I have to change the "Yes" and "No" buttons in an Alert.show(..), to another language (Dutch, for instance).
Is there a (easy) way to do that?

I forgot to mention - I have a -locale nl_NL in my compiler options, but it is still Yes/No

View 1 Replies

AS3 :: Flex - Variables Handling By AVM / Compiler / Scope

Apr 12, 2010

I have couple of questions about AS3 variables handling by AVM/compiler/scope .1. This code in Flash will throw an error:

[Code]...

but it won`t throw an error in Flex (only warning in Editor). Why?.2. How Flash sees variables in loops? Apparently this:

[Code]....

isn`t equal to just: var mc:MovieClip=new MovieClip(); var mc:MovieClip=new MovieClip(); because it will throw an error again as earlier in Flash, but in Flex in function not? Is Flash changing somehow my loop before compilation?

.3. Where in a class in equivalent to timeline in Flash - where in class I would put code which I put normally on timeline (I assume it is not constructor because of what I have written earlier, or maybe it`s a matter of Flash/Flex compiler)?

[Code]....

View 2 Replies

Java :: Get The Flex Compiler To Work With A 64bit JRE?

Jun 2, 2010

Are there any workarounds to get the Flex compiler to work with a 64bit JRE? If I use an MXMLC task in an Ant buildfile in Eclipse it works fine but if I try to use MXMLC from the command line (or try the Run... command from FDT in Eclipse) it fails, telling me ...

"Error loading: C:Program FilesJavajrrt-1.6.0jreinjrockitjvm.dll"

(this is with a 64bit JRockit runtime but that shouldn't matter).

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved