A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Embedding many resources

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    3

    Embedding many resources

    Hi,

    I am new to this forum, and just starting to understand as3, so i'm kind of a newbie. i hope i didnt double post or anything.
    I am searching for 2 days on forums and google, but i havent found a solution yet.

    I am creating a stand alone flash application (flash cs4) with a load of png images.
    Our customer wants the (external) images to be embedded in the application for protecting them from copying, otherwise i could load them in runtime.

    The principle of embedding with the "[Embed(source="../../file..png")]" works perfectly with 10 files.
    This way i wont have to name and define all my images in the library for later usage.

    But when i try to embed for example 100 files, my compiler will not give any errors, but it just wont load any of the images.
    Actually, the generated swf is not working. I guess the compiler has problems with loading in the rather large png files (130 kb).

    Has anyone found a similar problem, or maybe have a solution or workaround?

    Solving this would be a great help, so thanks in advance.

    Actionscript Code:
    package {
     
    import flash.display.*;
    import flash.display.Bitmap;
     
         public class GIFEmbed extends Sprite {
         [Embed(source = "149image.png")]
         private var theClass:Class;
         
         //many files here
             
             
             
              public function GIFEmbed () {
              var displayObj:DisplayObject = new theClass();
              addChild (displayObj);
              }
         }
    }

  2. #2
    Senior Member
    Join Date
    Jan 2009
    Posts
    208
    130kb * 100 = 13mb

    your are going to have a swf 13mb large?

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    3
    It will be a stand alone application published on cdr.
    I did not think this will be a problem, will it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center