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


Similar Posts:


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

ActionScript 3.0 :: Loading External Assets - Screen Stops Until The Loading Is Finished?

Oct 11, 2009

I have a movieclip clip that plays when the movie starts, the movieclip is a visual assets that show's that the application is loading some information but it's not showing any loading progress, just playing while the assets are loaded.I created a for loop that will load the assets using a simple loader, and then when the object is loaded the application push the object to an array.Problem is that when the loading starts all the animation that i have on screen stops until the loading is finished.The whole point is that the animation will play while it's loading.

View 10 Replies

Actionscript 3 :: Loading Assets From External Swf?

Aug 18, 2010

I am trying to load assets from an external swf. As in:

I drew a square in flash Made it into a symbol made sure to check the "Extract for Action Script" to doubly check I created an instance of it from within the asset file. went to my loader file loaded the assets.swf tried to find the class variable using "getDefininition" FAILED.

from what I'v been seeing from around the web the following code should work. (I actually copied it word for word from one of the tutorials) but it doesn't work.

import flash.system.ApplicationDomain;
import flash.display.MovieClip;
var myLoader:Loader = new Loader();

[Code]....

there should definately be class definition for XIconG though because I tried it myself from within the Asset.swf file. also I'm not sure whether this helps you, but when I tried to debug, I looked at the event.target.applicationDomain variable from the debugger menu and under it it said domainMemory = null. I don't have a clue why that is though.

View 1 Replies

Professional :: Methods Used For Loading External Swfs And Assets?

Jun 29, 2010

My client wants to take all the Flash games on their website and put them on a portable device that's not connected to the internet. I need to make sure that the swfs are completely self contained, in that they do not require the internet to load any swfs or other assets. The client does not have any of the fla's, so my plan is to download the swf and decompile it with Sothink, and then search the AS for these methods:

URLRequest
loadMovie
loadMovieNum
 
If the search returns results then I'll assume the game is loading something and that game will not be used. The client doesn't want to put any development time into this, so it either goes on the portable as is or not at all.

View 6 Replies

ActionScript 3.0 :: Loading External Assets - Making Them Reusable

Aug 13, 2008

I've been using a fairly un-dynamic approach in AS3 as until now when it comes to loading assets, but now I'll be trying to adapting a current project to fit other clients with different needs which means I'll have to grab the bull by the horns. I have an XML with a list of images that will be used, which is reused multiple times in each project. So I'm wondering if there's a way to load an image using the loader-class, and making it reusable? Being able to attach said asset later to a placeholder inside a movieclip I have stored in the library would be ideal.

I managed to load it into a movieclip but duplicating it from there on was a bit of a headache, using an approach similar to this would be great(but I have personally no idea of how to implement it): [URL] Here's the current code I'm using, in case it helps understanding what I'm after(it's most likely really ugly compared to what you SHOULD be doing in as3):

[Code]...

View 3 Replies

ActionScript 3.0 :: Loading External Assets + Multiple ApplicationDomains?

Sep 17, 2010

This is a follow-up to another thread that is getting wordy and unfocused:

[URL]

I am trying to load an external library .swf to use its embedded fonts, much like this method:

[URL]

However, the swf that is loading the font swf is loaded within a wrapper swf, and is defined as a separate ApplicationDomain as the wrapper.

Wrapper swf (app domain 1) <--- Player swf (app domain 2) <--- font library swf

The font is loading fine, and I'm even able to retrieve the font name (so I'm able to reference the object), but it is *not* showing up in the textfield as it should be.

When I remove the ApplicationDomain issue between wrapper and player swf by testing the player swf locally in the IDE (*not* loaded through the wrapper), it works fine. But I'm not sure how or why this is, because like I said, I'm able to get the font name so I'm able to reference it, it seems.

The TextField is being set to embedFonts, the font is loading, everything else seems to be working 100%, but there's some issue between the application domains that I just *can't* figure out.

View 14 Replies

ActionScript 3.0 :: XML Photo Gallery Swf Pictures Not Loading In External Swf?

May 17, 2010

The photos in my xml photogallery swf work fine. However, when I load the xml photogallery swf into my index swf, the pictures stop loading after picture 1

Code:
import flash.events.MouseEvent;
function loadXML(loaded) {

[code].....

View 1 Replies

Flash :: Optimize Loading Of Hd .flv Video With Large Size

Apr 2, 2011

There is a simple html page with intro video (.mp4 file). Video frame size is 1280*1024 (I need video to be as large as page up to 1280 px).

With such quality settings video file size is:

.mp4 = 42 mb (HD 1690*1080)
.flv = 32 mb (1280*1024, 25 fps)

For video playing I used as3 sample script (because there must be only playpause, replay, mute buttons with custom styles), like that

var strSource:String = "video.flv";
// create a new net connection, add event listener and connect
// to null because we don't have a media server

[Code]....

The problem is that I can't find a way to play it smoothly. It's loading in very annoying way, video is interrupted after each few seconds of playing.

I understand that the main problem is large video file size and hd quality, but may be there is some way to largely decrease .flv size or handle playback in more friendly way?

View 2 Replies

ActionScript 2.0 :: Load External Assets Via Flash And XML?

Aug 27, 2006

I have a Flash file that will act as a slideshow, the images change when the sound that is to be played with each image is complete (using

soundX.onSoundComplete).

I have a folder for the sounds and one for the images. I have Flash load those assets via XML. I use XML to organize the order of playing the images /sounds.

[Code]...

My question:

Is there a way to not hard-code the image/sound names in XML and instead use it to organize and pull the assets from their respected folders? My goal is to be able to have Flash and XML working as an automated process and all I have to do is add images w/their respected sound files in their folders and never have to open Flash or XML. The Flash and XML would just automatically populate the slideshow per the number of image and sound files I add.

View 2 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

Flash :: Smoothly Play FLV Video While Loading Assets In The Background?

Dec 8, 2010

Working on a 'video heavy' Flash site that has an intro video. While the intro video is playing, assets(images,flv files) should be loaded in the background. The problem is that, while the assets are loading, the intro video play gets jittery. What can I do to make the video playing smoothly while still loading assets? It might be the single threaded nature of actionscript, not sure. After using @Demian Brecht suggested method, I noticed that the culprit might be Memory allocation. As the FLVs load the memory usage goes up by ~266MB and while the videos are written to memory, the framerate drops to 1FPS.

[Code]....

View 2 Replies

Android :: Flash Builder - Loading Assets For Mobile Devices

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

Flash :: Loading Pictures Into AS3?

Jun 27, 2009

Scenario: Upload 2 images to a server. Download those images via AS3 and place them into different containers(movieclip or sprite), not overlapping one another. Well I can do it no problem, but they overlap one another and for some reason use the same "loader".

Code:
for (var i=1; i<2; i++){
var image:URLRequest = new URLRequest("http://myurl.com/images/" +jpgarray[i]+".jpg");
var myLoader:Loader = new Loader();[code]....

There are several different ways you can write the above code, but the outcome is still the same. It uses the same Loader or Movieclip, or uses the same container, simply overlapping the images.

View 14 Replies

ActionScript 3.0 :: Optimize An Swf Loading Time?

Jan 31, 2010

i'm making a website and it has some parts with flash such as the background. You can see the site here: [URL] You will see that the preloading of the background is too long beacuse i have 4 images as background in the library. the images are 950 x 650 pixel jpegs that in the library use the Photo(compression). So when the swf is on loading it take a lot of time.

View 0 Replies

ActionScript 3.0 :: Flash 9 - XML Pictures Not Loading

Sep 15, 2008

I have a Flash 9 AS3 document where I have set up a random picture loader from an XML file.
Works fine on the desktop but when uploaded the random pictures will only load if the XML file and the jpg's are in the same folder as the swf. I have pointed the XML loader address to
the proper spot in the AS3 code as well as in the XML file. I also have code in another keyframe for loading and displaying an RSS feed which works fine. I wonder are the two URL Loaders conflicting somehow. Attached is the RSS and the AS3 code.

View 3 Replies

Flash :: Videos Not Loading Properly Within Browser?

Oct 6, 2008

Ive been having trouble with Flash Player for quite some time now. I can watch some videos, but it takes some struggling to get them to work.

For example, on NFL.com, I can't watch any videos by clicking "Play", the video will just grey out and remain that way forever. However if I can find the video on the list underneath the player, sometimes when I click on the thumbnail the video starts automatically and I can watch it.

On Patriots.com things are a little worse. The player controls underneath the video don't load at all and I cant watch

[Code]...

View 1 Replies

ActionScript 2.0 :: Flash 8 - Loading FLV Videos Dynamically

Dec 2, 2008

We're using a content management system and client wants to upload videos. These videos will be for advertisers or directory listings. The videos will be converted on the fly to flv. Using flash8 flv component. Depending on the URL, I need the swf to access the correct video from a dynamically created xml file. I'm able to get the swf to recognize the current URL, and I put the URL into a variable called pageURL. Based on this URL, I need the swf to send this to the xml, with php - it will determine what video to get from database - based on the URL sent. I then need the swf file to play the correct video from the xml file.

View 1 Replies

ActionScript 3.0 :: Loading FLV Videos Externally To Flash?

Mar 18, 2012

How can i import a .flv video externally to Flash using AS3?

View 3 Replies

ActionScript 2.0 :: Loading Videos In A Flash Based Blog?

Feb 2, 2009

I'm trying to set up a flash based blog that can be updated with php and mysql and will handle text, images and video. I understand the basics of setting it up using php to generate xml files for flash to read, but the one problem I am having is figuring out how to load videos into flash. The goal is to be able to load as many videos as needed in their own players, so it wouldn't be like a playlist of videos but rather like how on a regular blog you would post youtube videos in their own unique players.

So far all of the things I have found have been related to loading videos in a sort of media player with playlists but yet to find a good solution for this. Is there a relatively simple way to use actionscript 2 to load a flv?

View 1 Replies

ActionScript 3.0 :: Flash Loading Random Videos (MP4) From Folder

Feb 3, 2012

The client needs to be able to upload new videos to a folder, and the flash should load a video randomly. Is it possible to make the flash to read the folder and load a random video, without having to change the ActionScript? The number of videos on the folder may vary.

View 3 Replies

ActionScript 2.0 :: Flash 8 XML Gallery - It Loads All Pictures At Once - Pictures To Scroll In Its _y Coordinate?

Jun 3, 2008

I'm having two problems. First of all, the gallery loads all pictures at once. The more pictures in the XML file, the slower they all load. Secondly, I wanted the pictures to scroll in its _y coordinate, similar to Sugar Rhyme's website portfolio (see url]...).

View 1 Replies

Professional :: SWF Flash Won't Work With External Videos In A Browser?

Jun 5, 2010

I created a flash website component and everything works great in flash when I preview it, or if I view it from my hard drive via the flash player. All the flash components work except for the external videos. When I try to add it to my html file in dreamweaver and then publish it, none of the videos pop up, just the main layout.I've searched every forum and tried everything I saw and still no luck.I was able to get it to work if I link directly to html, but not if I'm linking to my hard drive which I upload to the server.Here is a link to both the html file and the swf file[URL]

View 1 Replies

ActionScript 3.0 :: Loading Assets From A SWC?

Apr 22, 2009

Wherever I look it says that loading external assets(.png, .jpg, gif) from a SWC is supported. However, I can't find a single example of doing this with anything else than Classes and Components.

I have 7 swf's that are loaded and unloaded by a main swf, a sort of menu system. These swf's all rely on loading in some .png's at runtime.

I made a new "Library Project" in Flex, filled the scr folder with my .png's, set the loading type to "external". Because I don't want the .png's compiled into my application .swf.

But how do I get a hold of my raw .png's from within my classes?

I can do:
var obj:AComponentFromSWC = new AComponentFromSWC() no problem.

But I want to do:
var pic:Bitmap = BitmapFromSWC();

Is this possible or did I completely misunderstand the use of SWC's?

This way I could let all the apps use the same SWC and it is easy to distribute all the graphics as one package and the loaded swf could share common graphics.

View 5 Replies

Loading Assets From Different Libraries

Sep 8, 2009

I currently have a "container SWF player" that loads SWFs externally and plays them.The sound file for the SWF is in the library of the container SWF player, because the player is using the duration of the sound file to determine how long the scrubber bar goes.The problem is, it sort of defeats the purpose of having a container SWF player if I have to create a different container SWF player file for each external SWF because there's a different sound for each external SWF.Is there a way to pull the sound file from the library of the externally loaded SWF into the container SWF player?So that depending on what external SWF is playing, it will pull the associated MP3 file from that SWF's library?

View 1 Replies

Collect All External Assets?

Mar 25, 2011

Is there any way to collect all external assets (images, videos, etc) and put them in one selected folder?

View 2 Replies

Protect External Assets, XML On CD?

Oct 1, 2009

I'm developing some elearning material to be distributed on CD. The main swf loads text, images, sounds via an XML file. protecting the assets/XML from being edited/stolen?

View 3 Replies

ActionScript 3.0 :: Assets Of External Swf?

Feb 12, 2009

i am loading an external swf and need to access the assets within it heres my basic code:i can access fine through the onComplete function of the loader but cannot access from anywhere else....

Code:
stop();
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;

[code]...

View 1 Replies

Loading Assets In Timeline Animation?

Jul 28, 2009

I have an animation that is timeline based. The file size is around 900kb for the entire project, as it has numerous images at different stages.

How does flash determine when to start playing the movie? Is it based on a percentage of loaded size or does it load assets as it moves along?

View 2 Replies

Ios :: StageWebViewBridge Loading Included Assets?

Sep 16, 2011

My priority is to have a fullscreen (standard size) 1024x768 H264 video played on an ipad app compiled with flash CS5.5 AIR for iOS using the StageWebView class. This works perfectly fine. Although with no official way to communicate with the StageWebView, I can't 'remove' the video once it's done playing. Enter StageWebViewBridge which enables AS <=> JS communication.

I'm trying to get around the overall poor performance of the Video class on the iPad (1 or 2). Playing the video inside a StageWebView loading a html5 object works amazingly great (read: GPU hardware decoded h264).I do need to shut the video off after it's done playing in the StageWebView. I am packaging a .mov file encoded in H264 that plays great in webkit browsers. If I just load a webpage in the StageWebView with a tag pointing to any video file it plays perfectly fine.

Once I introduce StageWebViewBridge it changes. They want files put in a /html folder. I'm sending paths of all kinds for the players src to play and no video ever loads. The video is named 'a.mov'. I tried player.src = 'a.mov', or player.src = 'html/a.mov', or player.src = './html/a.mov' or even using the File class to get the File.applicationDirectory and resolve the file to the .nativePath. No matter what I send from AS to the JS in the StageWebView page, I cannot get it to load the video.

how to reference embedded files? I'd like to send the file to load from AS to JS and have JS reset the .src property of a html5 element. Even the File.applicationDirectory reference I make states the file 'exists', but I can never set the .src property of the element on the page. It doesn't seem to understand.

View 2 Replies







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