Using swf files compiled as swc in a ios project

Hi,
I might have a quite stupid question, but here I go anyway since its not easy on iOS.
I have 10 swf files (each file is 1 game with all assets + as3 inside it)
I'd like to make now an iOS app (air 2.7) which can play those 10 games on selection.
Normally on iOS its not allowed to load in swf files with AS3 in it because you may not use interpreter by Apple.
Now, on http://www.flashrealtime.com/compiling-big-air-swf-to-ios/ I read some info about a trick to use SWC.
Here is my question now.
If each of my 10 swf files actually contains 1 movieclip on stage which by itself contains all game logic (as3) and assets inside it, then can I compile these 10 swf files each one to a swc and somehow include them in a big iOS app ?
For example
in game1.swf the main movieclip would be on stage and would be exported for actionscript under the name "game1_mc"
in game2.swf the main movieclip would be on stage and would be exported for actionscript under the name "game2_mc"
in game3.swf the main movieclip would be on stage and would be exported for actionscript under the name "game3_mc"
in game4.swf the main movieclip would be on stage and would be exported for actionscript under the name "game4_mc"
Can I then somehow include all those swc files inside my 1 big application ?
And can I then somehow instantiate one of these movieclips and add them to the displaylist to start a game ?
This could solve a big problem for me, but I'm very unsure if thats possible.
Kind regards,
Bart

Thank you for this very fast reply. Just a little thought, but if I understand right you say that the swc method works but would be the same as copying the mc inside my .fla.
In that case, wouldn't it be better for project management to use the swc anyway, since flash doesn't have to recompile the stuff anymore each time you build?
Or is that advantage also not correct?
Also (and pardon me if this sounds extremely dumb) suppose I include 100 of those games and each game uses around 5MB, then I have 500MB of data in there. Will flash then by default use 500MB of ram on the mobile device (deadli and most probably not available) or will it only use the amount of ram neede by that 1 movieclip which we instantiate from the 100 available ones?
That would make a huge memory difference.

Similar Messages

  • How to use swf file for Spark Skin

    Hi all
    I have little confuse about how to use swf file with Spark Skin,
    in Flex3 , i use Flex Skin Design Extension for Flash to deal with skin ,
    so basically , I just create a swf file and import to the project , then everything is ok
    but , seem that not working in flex4 , spark skin.
    1` I can't find the Flex Skin Design for the FlashCs4
    2` I try to use FlashCs3 version to import the skin art to the project , but seemed not working.
    3` I Google and check the Flex4 Help , seemed Spak skin need the Skin-Class , which I don't know how to use that with swf file
        what I have searched is how to use FXG , or some jpg file in that skin class, none of them are use swf file.
    so , is there any way that let user use the swf file to deal with the skin?
           is the Flex Skin Design can use in Flex4?
    Thanks

    Hello,
    I'm new to Flex, but have come to it from Flash Pro.  I'd like to know the same thing.  I think I found the answer here:
    http://www.flashallys.com/blog/spark-button-skinning-with-flash-symbols/
    However my question is now: Is this a good approach to use?
    99% of the googling I've done tells me to skin components with fxg files.  I've tried that by creating graphics and exporting from flash, but using swfs containing lots of graphics is much faster so I'd rather use that.
    The other thing I've done is to create custom components using these helpful tutorials:
    Creating component in flash:
    http://www.webkitchen.be/2008/12/12/video-tutorial-make-flex-components-with-flash-cs4/
    Dealing with Resizing with method overrides for your flash component:
    http://www.psyked.co.uk/flex/creating-flex-components-the-easy-way-for-flash-ide-converts. htm
    This allows me the flexibility of Flash Pro design with the layout, transistions, data binding etc from Flex.
    So my question is: Is this approach (skinning spark components with swfs, and using custom swc components made in flash) a bad idea for any reason?  E.g. does it create slow mobile apps?
    Cheers
    Chris

  • Flash:  Video--  Flvplayback--using SWF file in dreamweaver.

    I have placed a video into flash cs3 and made the swf file
    using the flvplayback, and i have put the swf or published it
    ...putting it in dreamweaver, I can see the video and hear the
    sounds when I preview in firefox or iexplore however once I put in
    my server I cannot see anything or hear anything. It does not show
    up,. Can anyone help me with this problem. I just took the SWF file
    and uploaded it through dreamweaver using the insert, media,, flash
    and placed in my template.

    AC_FL_RunContent( 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','1000','height','400','src','descarga
    total1','quality','high','pluginspage','
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','descarga
    total1' ); //end AC code
    </script><noscript><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
    width="1000" height="400">
    <param name="movie" value="descarga total1.swf" />
    <param name="quality" value="high" />
    <embed src="descarga total1.swf" quality="high"
    pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash" width="1000"
    height="400"></embed>
    </object>

  • Using SWF file globally

    I have an xcelsius model where I want export the model as  swf . As I am using xcelsius locally when I export to  SWF it generates  a link on my desktop where I can only use it , how can I make it global so that when I send the swf file by email every one can access it.
    Thanks

    Hi Sany,
    You can use your swf file globally without any issue and modification if the swf is based on static data.
    By static data I mean based on standalone excel sheet and which does not have any live data connection.
    Incase you have live data connection, you will need to publish it to some server where others users have rights to view it.
    Please let me  know if you have further queries.
    Thanks,
    Amit.

  • Captivate 5 – using swf files as buttons.

    hi there
    I am currently using adobe 'captivate 5'
    I would really like to include navigational left to right buttons that are animated not static.
    I have created animated button (swf files) that I have put into the 1st slide in captivate but there appears to be no way of turning the swf file into a proper button that makes you click from the 1st slide to the 2nd??.
    Is there any action script that could solve this problem?
    any help would be much appreciated!
    thanks
    matt

    Captivate's default answer to this problem is that you have to add a clickbox over the top of the animation to listen for the click and then go to next slide.
    But there is a better way, try out the Button.swf widget that comes with Captivate 5.  It's a Static Widget, which means that unlike an Interactive widget you can set its timing to be Rest of Project, meaning that it will appear on each and every slide.  You can change the button text inside the widget.
    So just by placing this button on your first slide, and then another Back button on the second slide, and setting both to time for Rest of Project you'll have forward and back buttons on all slides that work.
    You can use the preset graphics provided with the button, or set it to use your own image by adding the image into the published file and citing its name in the field provided.
    All in all this is a very handy little widget.

  • Sandbox violation using swf files in applicationStorageDirectory

    I want to use an swf file as the source to an mx:Image which I then want to drag around.
    The swf file is in the applicationStorageDirectory.
    The swf file loads and appears on the screen. I click on the image and get:
    *** Security Sandbox Violation ***
    SecurityDomain 'app-storage:/project1/images/bg.swf' tried to access incompatible context 'app:/RAE.swf'
    How do I solve this?

    It seems that even if an swf file has no scripts in it, if any of the assets have been turned into movieClips (we're talking Flash here), then as soon as you click on them they try to reference the parent swf. The Air app interprets this as an external swf trying to script it and the Sandbox violation occurs.
    The solution to this specific problem is to put the mx:Image inside an mx:Canvas and set the mouseChildren property of the Canvas to false.

  • Using swf file for very large static image

    i have a large photo that i need to use as a banner image in a website.  i have tried optimizing it for the web in fireworks -- to reduce the file size obviously -- but the client isn't happy with the resolution.  i haven't had this issue come up before but i see his point (to a degree), as the detail and sharpness of the original is far superior.
    i have almost no familiarity with creating with flash, but i remember reading somewhere that swf files do not have the same sizes as jpeg images.
    would it be feasible to include the single static image as a swf file to preserve its original resolution?  i mean, would that image as a swf file be smaller than the image as a jpeg?
    mille grazie.

    There are two things at play here... image quality (often harmed by compression) and image resolution (# of pixels width by height). What is the real problem?
    Whether you render your image as a GIF, JPG, PNG or SWF file, they will all have the same resolution.
    Packing an image in SWF should be a last resort as not everyone has Flash installed. For example, iPhone users cannot see SWF.

  • Using .swf files in FCP

    I need to access an swf file so that I can edit it in FCP. Is it possible to convert it to a Quicktime movie as I can't open it in its current format?
    Trish

    Ian:
    You need to access to a computer (PC or Mac) with Flash app installed and export it as QT movie. It only works if the Flash animation is build frame by frame in Flash timeline; if the Flash animation uses action cripts the QT movie will not see those parts of the animation. You could need a thrid party software to do the conversion in that case.
    Hope that helps !
      Alberto

  • Using Flash Components in multiple SWCs inside AS-only project

    Ok, this is a somewhat complicated issue dealing with SWCs and compilers. I've outlined steps to reproduce the problem below. I'm using the method outlined here to bring in Flash content to my project. I have 15-20 SWCs already, and it's working fine for those assets, the problem is specifically related to Flash's components (ComboBox, RadioButton etc.) If anyone has *any* advice on this, please let me know as we are completely stumped at this point!
    The issue we're having involves using multiple external SWC files which contain AS3 components from Flash CS4. When two SWCs are linked to an ActionScript project (using Flash Builder 4 Beta (build 4.0.0)) there are collisions in the referenced classes which cause the most recently published SWC to knock out any duplicate classes in the other SWCs. A simple way to replicate this is as follows:
    1. Create one FLA, called 'compA', drag one ComboBox, RadioButton and TextInput component onto the stage. Select all and convert to symbol, marking the symbol for export with a class name of Test1.
    2. Create a second FLA, called 'compB', drag one ComboBox, Label and UIScrollbar onto the stage. Convert these to a symbol with a classname of 'Test2'.
    3. Create a new ActionScript-only project in Flash Builder, called 'ComponentTest'.
    4. Create a 'libs' folder in this new project. Select 'Project -> Properties -> ActionScript Build Path' and add the libs folder as a new SWC folder in the Library Path window.
    5. Go back to compA.fla and right click the Test1 symbol in the library. Select 'Export SWC file...' and save it as compA.swc in the libs folder.
    6. Do the same thing for compB.fla.
    7. Edit ComponentTest.as and in the constructor, create an instance of Test1 and Test2, placing each on the stage.
    8. Run the app, and the ComboBox will only be functional in one instance (whichever was published last.) The other ComboBox will behave like a MovieClip, cycling over the two frames in the stage asset (avatar and skin.) It will have no association to anything in the fl.* package.
    Looking at the 'Referenced Libraries' in Flash Builder, compA may show it contains classes for the RadioButton and TextInput, but no ComboBox classes are referenced (sometimes it will show no classes at all, but this appears to be an unrelated bug with refreshing external libraries in Flash Builder.)
    Unzipping the SWC files and examining their catalog.xml manifests shows all the necessary classes are listed (i.e. ComboBox is in both.)
    Removing either SWC will cause the remaining one to work properly, so the problem appears to be in compiling the ComponentTest project which includes both.
    Attempted Workarounds:
    1. Create a new FLA, drag all components used in both files onto the stage and export a SWC called 'components.swc'. Add this SWC to the project's libs folder. In both compA and compB FLA files, add this SWC as an external library in the ActionScript 3.0 Publish settings. Re-export both SWCs. The theory is that the compiler will look for the required classes in the components.swc first, and thus not include them in the export, however this is not the case.
    2. Same as above, deleting ComponentShim from both FLAs before exporting. The result is that no component classes are included, so all components act like MovieClips.
    3. Add the Components source folder to the external library path of both FLAs, assuming the compiler will favor classpath references over compiled class references (ComponentShim). Same result.
    Summary: We have been unable to find a way to use Flash Components in a project if they are referenced in more than one asset library. If we were able to import them once, and have all SWCs which need those classes use a single source, this might not be an issue, but the compiler does not appear to handle this (and we are admittedly not advanced enough to even know if this is possible.)

    Hi!
    I'm having the same problem. Any news on the matter?
    Also, this looks like a very similar problem.
    Best regards,
    X_AmonPL.

  • CanI use swf files made w/ Flash 8 that include  FLVPlayBack comp

    I am porting an application from Flash 8 to Flex that
    includes a number of videos (FLV).
    In Flash 8 I am using the FLVPlayBack component to be able to
    include the available skins. In particular the
    MojaveExternalAll.swf.
    I tried to load the swf that inlcudes the FLVPlayBack
    component and the skin, but I only get the video (stopped at the
    first frame and no skin).
    Is there a method to use those skins, or are they equivalent
    video skins in Flex?
    Gilbert

    I am porting an application from Flash 8 to Flex that
    includes a number of videos (FLV).
    In Flash 8 I am using the FLVPlayBack component to be able to
    include the available skins. In particular the
    MojaveExternalAll.swf.
    I tried to load the swf that inlcudes the FLVPlayBack
    component and the skin, but I only get the video (stopped at the
    first frame and no skin).
    Is there a method to use those skins, or are they equivalent
    video skins in Flex?
    Gilbert

  • Strange Problem - All of my preloaded .swf files play at once

    Hey guys,
      I've been getting a strange problem that I haven't been able to debug.  I recently developed an interactive audio and video treatment program that users click through in which a master swf file (DTM-Start.swf) uses ActionScript upon first being loaded to load the rest of the program in the background.  Here's how the code looks: 
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.Event;
    // create movieclip objects to hold the loaded movies
    var intr1:MovieClip;
    var maladaptIntr1:MovieClip;
    var maladaptIntr1Loader:Loader = new Loader();
    var maladaptIntr1Request:URLRequest = new URLRequest("DTM-Maladapt1.swf");
    maladaptIntr1Loader.load(maladaptIntr1Request);
    maladaptIntr1Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, maladaptIntr1Loaded);
    var intr1Loader:Loader = new Loader(); 
    var intr1Request:URLRequest = new URLRequest("DTM-Intr1.swf");
    intr1Loader.load(intr1Request);
    intr1Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, intr1Loaded);
    function maladaptIntr1Loaded(event:Event):void
        maladaptIntr1 = event.currentTarget.content as MovieClip;
        maladaptIntr1.stop();
        addChild(maladaptIntr1);
        maladaptIntr1.y = -1000
        trace("maladaptIntr1");
    function intr1Loaded(event:Event):void
        intr1 = event.currentTarget.content as MovieClip;
        intr1.stop();
        addChild(intr1);
        intr1.y = -1000
        trace("intr1");
    function playIntr1() {
       intr1.y = 0;
       intr1.play();
    function playMaladapt1() {
        maladaptIntr1.y = 0;
        maladaptIntr1.play();
    So that's the idea.  What's strange is that when I load a .swf file compiled with AIR 2.6 (because the user interacts with the movie and a text file is output) it's fine too, but as soon as I add any actionscript, even if it's just a stop() command, to a .swf file compiled with AIR, the DTM-Start.swf loads and then plays all of the movies simultaneously so they're all going off at once.  Essentially, flash seems to be ignoring the maladaptIntr.stop() command in the Loaded function, for instance.  I just don't understand why adding any Actionscript whatsoever to a .swf compiled with AIR would make my DTM-Start do this.  I am very confident this is the issue too, because loading .swf files compiled with the FlashPlayer with action script are fine...AIR .swf files without Actionscript are fine too, it's only AIR .swf files with ANY actionscript that cause this problem....
    Any ideas?
    Much appreciated!
    Thanks,
    Ricky

    One solution is simply to have a stop() in the constructor of the document Class of each swf you're loading. Another solution is something like:
    package {
         class MainDocument extends MovieClip {
         protected var swfs:Array = ['DTM-Maladapt1.swf', 'DTM-Intr1.swf'];
         protected var positions:Array = [{x:0, y:0}, {x:0, y:0}];
         protected var movies:Array /*of  MovieClips*/ = [];
         protected var loadIndex:int;
         protected var playIndex:int;
         protected var curremtMovie:MovieClip;
              public function MainDocument() {
                   super();
                   loadMovie(loadIndex);
              protected function loadMovie(loadIndex:int):void {
                   var loader:Loader = new Loader;
                   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
                   loader.load(new URLRequest(swfs[loadIndex]));
              protected function onLoadComplete(e:Event):void {
                   var mc:MovieClip = LoaderInfo(e.currentTarget).content as MovieClip;
                   mc.stop();
                   var position:Object = positions[loadIndex];
                   mc.x = positions.x;
                   mc.y = positions.y;
                   addChild(mc);
                   movies[movies.length] = mc;
                   loadIndex++;
                   if (loadIndex<swfs.length) {
                        loadMovie(loadInxed);
                   } else {
                        playMovie(playIndex);
              protected function playMovie(playIndex):void{
                   if (currentMovie) {
                        currentMovie.stop();
                   currentMovie = movies[playIndex];
                   currentMovie.play();
    Note that with this approach you don't need to create a whole new set of logic each time you want to add a new swf to load.

  • Comparision between Modules and SWF files

    I've used modules and SWF files in my flex apps but don't
    seem to see or figure out what the basic difference between the two
    is.
    I'm interested in comparisions *excluding* file size. For
    instance:
    When would one use SWF files instead of Modules?
    Are there things possible/not possible when using one or the
    other?
    Any other pros/cons?

    Obviously you can use Application SWFs to break a large
    application into dynamically loaded parts. Modules were created to
    address the ease-of-use issue. Module SWFs provide an easier
    mechanism for communication between the Modules and main (shell)
    application SWF. Modules also give us a way to enhance that
    mechanism in the future which would be limiting if working solely
    with Applications.
    Further, Modules can be reduced in SWF-size compiling them
    against the symbols loaded in the shell application. This makes
    them much smaller and faster to download. That was possible with
    Application SWFs by using Runtime Shared Libraries. However, using
    RSLs is tedious compared to using Modules.
    I have an example of using Modules on my blog. The example
    covers the size optimization of Modules as well as communication
    with Modules.

  • Closing a swf file with a button

    I have a flash website that opens another flash website. I
    want my quit button on this new site to close the swf file and
    return back to the first flash site. I know that the quit fs
    command completely closes a document only if it's a projector, but
    I am only using swf files. So far the only way I know how to do
    this is the unload movie script on my quit button for each level
    that there is a movie. This script only unloads each movie in the
    scene and turns the screen the same color as the background. I
    don't know how to completely close the swf player for this movie.
    Its probably very simple but I am stuck on this problem right now.
    Any Suggestions???

    if you are navigating to another html page - then simply use
    the getURL call and load the new page into the current browser
    window - effectively 'closing' the previous swf.
    however - another method would be to use a system wherein the
    'main' html page contains a swf that is solely made for loading
    'other' swf files using the MovieClipLoader class - in this way you
    could simply load a new swf file into the same clip and depth as
    the previous one - this will 'replace' anything that was currently
    loaded at that depth.

  • Swf file with external video not playing properly in Captivate 5

    So I'm trying to create a captivate project using swf file that has code that loads external flv inside of it.
    It all works great when I test it in flash but once I export it and insert it in Captivate the screens don't synchronize.
    The content of the video starts playing as soon as the project starts even though it's not on that video slide and when
    I try to scroll through the project the audio of that video screen doesn't stop.
    Anyone has an idea why this is happening, could it be my code in flash that's affecting it?

    Unfortunately, no. I gave up on the idea of inserting question slides in the middle of videos. That means I no longer have videos distributed across multiple slides, which I assume was causing the problem. Now, I only insert quiz slides AFTER the video slide. Not preferred but that's what I ended up with.
    I have recently upgraded to 7.  I haven't had a chance to see if the issue is fixed in 7.  To be honest I am having many issues getting my courses to play properly on the iPad. I am using all the default functions and quiz slides, but I continue to run into problems.

  • BitmapData prblm for loading swf file

    hi
    i making the photo gallery, here i am using the bitmap data
    for making some effects between each image when it's start to load.
    but in between the images we are using swf files but after
    applying the effect the swf is not playing..
    can any one suggest what i need to make to clear this issue
    ~~
    SK

    yes the timeline is not working when i start to applied in
    the movieclip. how to overcome this issue. bcoz i need check the
    current frame and totalframe. to check whether the swf has played
    fully or not. after that only it 'll start to laod the images
    but here i can't able to get the current frame and the total
    frame . it means i lost the timeline( swf consists of more than 40
    frames) ..here how to check the 40 frames played or not
    ~~
    Sk

Maybe you are looking for