Saving MovieClips to SharedObject

I have a MovieClip subclass called Panel. My swf allows users
to manipulate Panel instances. It saves their progress to a
SharedObject so they can pick up where they left off.
Right now, I use registerClassAlias("Panel", Panel) to allow
these objects to be serialized to a SharedObject. When they are
loaded back into Flash, I get a series of runtime errors about
converting generic Objects to various types of Transform. As long
as I don't access the built-in transform property, this causes no
real issues.
I'd like to use ColorTransform on the Panels.
registerClassAlias("Transform", Class(Transform)) is giving me a
security sandbox violation:
SecurityDomain 'file:///C|/Users/.../mySwf.swf' tried to access
Player UI context
There is very little talk of this error on the web. I don't
understand what it is contesting or why it is a problem. How can I
save the Transform class to a SharedObject?

Not sure, but check the help docs for the
registerClassAlias() function here:
http://livedocs.adobe.com/flex/3/langref/index.html?flash/net/package.html&flash/net/class -list.html

Similar Messages

  • Class Losing its super()

    I've got class AbstractBox extends MovieClip.
    I've got class Border extends AbstractBox.
    Border is a MovieClip in the Library with the proper linkages
    set.
    About half the time I publish and the border works fine. The
    other half the time it doesn't work at all.
    I started by tracing out the constructor and onLoad calls for
    both the Border and AbstractBox. For some odd reason the
    AbstractBox constructor isn't getting called. I thought perhaps the
    implicit super() call wasn't working, so I made sure to actually
    type it out. But that didn't help.
    I also thought perhaps for some reason the AbstractBox class
    wasn't getting compliled in, but it is used by some other classes
    that are working and calling the constructor.
    It is really odd. It seems to be every other publish.
    I think this started when I moved the Border clip into a
    external shared library. And sure enough putting it back directly
    into the library seemed to fix the problem. But I really would
    rather have it in the shared library.
    Anybody have any ideas?

    That is exactly what I was thinking!
    Actually I wasn't quite accurate. It isn't exported for
    runtime sharing, but perhaps it should be? I didn't set this up.
    We have an external fla called SharedObjects (I know bad
    name, but that is what it is!) and it has all these little
    interface elements and other bits and bobs. They are all placed on
    the stage in a MovieClip called SharedObjects.
    Then we open our production FLA, open the SharedObject FLA as
    an external library, drag over the SharedObject movie into our
    production library. We then go into the properties and check Source
    "Always update before publishing."
    We have two different sets of this. One that has all the
    interface bits and one that has a bunch of bits that our
    development environment uses. For some odd reason if the Border is
    in the first FLA it only works every other publish. If I put it
    into the SharedObjectDev FLA it works fine.
    And you are correct there is nothing moving between
    publishes. Nothing being saved, saved and compacted, or anything.
    Just publish, close test environment, publish. (I have tried
    combinations of saving, compacting, etc. and it makes no
    difference.)
    I don't know how to use the export for runtime sharing. Is
    that more reliable? Should I look into it?

  • Please help how to save a movieclip in flash to svg...and how to retrive the saved svg to movieclip in flash?

    hi all
    please help how to save a movieclip in flash to svg...and how
    to retrive the saved svg to movieclip in flash?
    thanks

    Do you mean from flash in a web page or do you mean
    converting the swf file format (maybe with a decompiler or
    whatever).
    If you're meaning to do it from flash in a web page:
    You can't save a movieclip from flash to svg. You could
    perhaps record drawingAPI commands and create the appropriate svg
    output in an internal xml object which you then send to the server.
    But I don't know of any pre-built classes to do that (disclaimer:
    because I don't know of any doesn't mean they don't exist).
    Going from svg to flash is doing it the other way around.
    Converting the svg paths back to actionscript drawing commands. I
    think I've seen some examples of this online somewhere.

  • Saving a movieclip

    Hello All,
    I 've saved a movieclip which was preloaded with an image, it
    works perfect. But when i tried to save another movieclip( i 've
    added backcolor, forecolor as well as another movieclip to this
    clip) the whole file is getting saved not that particular
    movieclip.
    I also want to save the movieclip to a jpeg file and i need
    to specify path for it.
    Is it possible to save the file to a server.
    Hope somebody can help me with it.
    regards,
    jeevm
    The code for saving the clip is:--
    MMSave(mat,"myfile.swf");

    found this thread and a guy answers it at the bottom. tested it and it works exactly how i wanted.
    http://www.actionscripts.org/forums/showthread.php3?t=90159

  • Saving and Loading specific properties of an Image

    Hey everyone. I'm currently in the process of developing a game which allows you to customize the color (hue) of your character via a slider. What I would like to happen is: Upon clicking either Accept or Play, it will save the current hue of the image, navigating back to that page will load what was previously saved (hue), as well as when starting the game, it will replace the standard graphic with the previously saved image.
    Below is the code I have right now that pertains to the image with a basic non-functioning properly saving and loading code:
    import flash.events.KeyboardEvent;
    // open a local shared object called "myStuff", if there is no such object - create a new one
    var savedstuff:SharedObject = SharedObject.getLocal("myStuff");
    Accept.addEventListener(MouseEvent.CLICK, SaveData);
    PlayBTN.addEventListener(MouseEvent.CLICK, LoadData);
    function SaveData(MouseEvent){
               savedstuff.data.username = Sliders.Dino.MovieClip // changes var username in sharedobject
               savedstuff.flush(); // saves data on hard drive
    function LoadData(event: MouseEvent)
               if(savedstuff.size>0){ // checks if there is something saved
               Sliders.Dino.MovieClip = savedstuff.data.username} // change field text to username variable
    // if something was saved before, show it on start
    if(savedstuff.size>0){
    Sliders.Dino.MovieClip = savedstuff.data.username}
    What I have above is only saving the actual image, which is inside a movie clip names Sliders.
    Below is the Class I am using that associates with the slider that changes the hue of "Dino".
    package
              import flash.display.Sprite;
              import fl.motion.AdjustColor;
              import flash.filters.ColorMatrixFilter;
              import fl.events.SliderEvent;
              public class Main extends Sprite
                        private var color:AdjustColor = new AdjustColor();
                        private var filter:ColorMatrixFilter;
                        public function Main():void
                                  /* Required to create initial Matrix */
                                  color.brightness = 0;
                                  color.contrast = 0;
                                  color.hue = 0;
                                  color.saturation = 0;
                                  /* Add Listeners function */
                                  addListeners();
                        private final function addListeners():void
                                  colorPanel.hueSL.addEventListener(SliderEvent.CHANGE, adjustHue);
                        private final function adjustHue(e:SliderEvent):void
                                  color.hue = e.target.value;
                                  update();
                        private final function update():void
                                  filter = new ColorMatrixFilter(color.CalculateFinalFlatArray());
                                  Dino.filters = [filter];
    Overall what I'm asking for is: How do I get it to save the current hue of an image by clicking a button, and then having that previously saved image be loaded upon reloading or clicking a button? To me, it doesn't seem like it should be too hard, but for some reason I can not grasp it.
    Thanks in advance for reading this and for any assistance you have to offer!

    This is the Class that you told me to use:
    package
              import flash.display.Sprite;
              import fl.motion.AdjustColor;
              import flash.filters.ColorMatrixFilter;
              import fl.events.SliderEvent;
              import flash.net.SharedObject;
              public class Main extends Sprite
                        private var color:AdjustColor = new AdjustColor();
                        private var filter:ColorMatrixFilter;
                        private var so:SharedObject;
                        public function Main():void
                                  color.brightness = 0;
                                  color.contrast = 0;
                                  color.saturation = 0;
                                  so = SharedObject.getLocal("myStuff");
                                  if (so.data.hue)
                                            color.hue = so.data.hue;
                                  else
                                            color.hue = 0;
                                  update();
                                  addListeners();
                        private final function addListeners():void
                                  colorPanel.hueSL.addEventListener(SliderEvent.CHANGE, adjustHue);
                        private final function adjustHue(e:SliderEvent):void
                                  color.hue = e.target.value;
                                  so.data.hue = color.hue;
                                  so.flush();
                                  update();
                        private final function update():void
                                  filter = new ColorMatrixFilter(color.CalculateFinalFlatArray());
                                  Dino.filters = [filter];
    And this is the FLA Code:
    import flash.events.KeyboardEvent;
    // open a local shared object called "myStuff", if there is no such object - create a new one
    var savedstuff:SharedObject = SharedObject.getLocal("myStuff");
    Accept.addEventListener(MouseEvent.CLICK, SaveData);
    PlayBTN.addEventListener(MouseEvent.CLICK, LoadData);
    function SaveData(MouseEvent)
              savedstuff.data.username = Sliders.Dino.MovieClip;// changes var username in sharedobject
              savedstuff.flush();
              // saves data on hard drive;
    function LoadData(event: MouseEvent)
              if (savedstuff.size > 0)
              {// checks if there is something saved
                        Sliders.Dino.MovieClip = savedstuff.data.username;
              }// change field text to username variable
    // if something was saved before, show it on start
    if (savedstuff.size > 0)
              Sliders.Dino.MovieClip = savedstuff.data.username;

  • Splice array, reposition MCs & save to sharedObject

    I drag & drop MovieClips onto a 'map', they leave a
    duplicate MC which is stored in a sharedObject (name, coords),
    users can then reposition the Mcs and/or delete some, info re the
    new coords & MCs deleted is saved again to sharedObj. Prob is
    that when I delete some MCs, THEN reposition those remaining, THEN
    refresh the browser (simulating a save - as if user returns after
    having closed browser) - the icons are in original position - not
    where I moved them to. This doesn't happen if I press refresh after
    deleting, THEN reposition MCs.
    Any ideas where I'm going wrong.
    Attached this section of code in case anyone can spot
    something - my first try at sharedObjects & splice
    array!

    I won't pretend to have read all your code, but my guess is
    that you should iterate backward through your array. If you go
    through forward when removing things from an array your index will
    get "lost" because array.length will be changing. So I'm thinking:
    for (r=aSavedMapIcons.length-1; r>=0; r--)
    Maybe?

  • Is there any way to save an image from a nested movieclip as a .png using PNGEncoder

    Hello all,
    I am new to AIR and AS3 and I am developing a small AIR desktop application in Flash CS5 that saves a user generated image locally to their computer. 
    The image is generated from a series of user choices based on .png files that are loaded dynamically into a series of nested movieclips via XML.  The final image is constructed by a series of these "user choices".
    Sourcing alot of code examples from here and there, I have managed to build a "working" example of the application.  I am able to "draw" the parent movieclip to which all the other dynamic movieclips reside and can then encode it using PNGEncoder.  The problem is that the images loaded dynamically into the nested movieclips show as blank in the final .png generated by the user.
    Is there a way to "draw" and encode these nested movieclips or do I need to find another way?  I can provide my clumsy code if required but would like to know if this concept is viable before moving any further.....
    Thanks in advance....

    Thanks for the files.......
    Yeah I'm doing it in Flash but importing the images via an xml document.  The problem isn't in being able to view the eyes (based on the selection of the user) its when I go to save the resulting image as a .png.  When I open up the saved .png the eyes are blank even though they are visible in the swf
    Even when the user clicks on the option to copy the image to the clipboard, it works as intended.
    My only guess is there is an issue with the way my xml is loading (but this appears to work fine) or when the file is converted and saved.....
    As I said I'm still learning but surely there must be a simple answer to this....
    I have included the xml code I am using and also the save code to see if anyone spots an issue..... (I hope I copied it all)
    // XML
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    var xmlRequest:URLRequest = new URLRequest("imageData.xml");
    var xmlLoader:URLLoader = new URLLoader(xmlRequest);
    var imgData:XML;
    var imageLoader:Loader;
    var imgNum:Number = 0;
    var numberOfChildren:Number;
    function packaged():void
    rawImage = imgData.image[imgNum].imgURL;
    numberOfChildren = imgData.*.length();
    imageLoader = new Loader  ;
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedImage);
    imageLoader.load(new URLRequest(rawImage));
    faceBG_mc.Eyes.addChild(imageLoader);
    function loadedImage(event:Event):void
    imageLoader.x = -186;
    imageLoader.y = -94;
    imageLoader.width = 373;
    imageLoader.height = 186;
    //  Clipboard
    btn_Copy.addEventListener(MouseEvent.CLICK, onCopyClick);
    function onCopyClick(event:MouseEvent):void
    var bd:BitmapData = renderBitmapData();
    Clipboard.generalClipboard.setData(ClipboardFormats.BITMAP_FORMAT, bd);
    function renderBitmapData():BitmapData
    var bd:BitmapData = new BitmapData(faceBG_mc.width,faceBG_mc.height);
    bd.draw(faceBG_mc);
    return bd;
    // Save faceBG_mc as .png 
    var fileRef:FileReference = new FileReference();
    var myBitmapData:BitmapData = new BitmapData (faceBG_mc.width,faceBG_mc.height, true, 0);
    myBitmapData.draw(faceBG_mc);
    var myPNG:ByteArray = PNGEncoder.encode(myBitmapData);
    function onSaveClickPNG(e:Event)
    fileRef.save(myPNG, "myPNG.png");
    So my problem is....
    The final image is copied to the clipboard with the eyes visible - yes
    The eyes appear in the image in the swf as intended - yes
    When the image is saved as a .png and is meant to include the eyes, they are blank (see picture above)
    I hope this helps.....
    Thanks in advance

  • New MovieClips added to existing SWC library not available in Flash Builder

    To be as brief as possible with this...
    I have 2 swc libraries in my Flash Builder Project. One is in a "Common" project and the other one is in a MobilePlayer project. Obviously the "common" project contains UI assets that apply across the board, while the MobilePlayer version contains assets specific to that version of the application.
    Both swc files are in the respective libraries for each project we are referencing. Up until yesterday I could add new MovieClips to the "common.swc" and they would be available across the board instantly.
    Sometime yesterday I could not get new MCs added to my "common.swc" to show up in the intellisense, or become avaialble whatsoever.
    For troubleshooting I am creating a Square, turning it into a MC symbol, exported for AS with a classname of "Fubar"
    whenever I try and create a new instance of :Fubar() to anything anywhere in my applicatioin I get the Call to possibly undefined method Fubar error message. It does not show up in intellisense menus and it is NON EXISTENT.
    HOWEVER — Named movieclips within my .swc library I have already been using such as "CompanyLogo()" etc etc are STILL fully available and can be referenced from anywhere in my application. I can add a new CompanyLogo()  anywhere I want with no problem.
    As ANOTHER test, I REMOVED the movieclips CompanyLogo (and others) from my Library and re-saved the SWC.
    All of a sudden Flash Buider generates a compiler error (undefined method) for each missing referenced MC in the swc file (obviously, because they are no longer there).
    However, those named MCs still show up in intellisense menus etc etc.
    Basically what I can determine is that Flash Builder is not updating and picking up any changes to this SWC library whenever anything is added or removed from it. At some point it became "locked" in memory (for lack of a better term) and it refuses to recognize that the file has been changed.
    When I extract the catalog.xml from the SWC and read through it, I can find nodes for every single NEW mc I've created yet I cannot get them to show up in Flash Builder. I refresh, close and restart Flash Builder and have done everything I can possibly think of to get my updates to register and they refuse.
    On the other hand my "mobile.swc" updates just fine as I make changes to it. If I add a new MC to it, it is instantly available. If I take away a MC it FB instantly recognizes that it is gone.
    Am I doing something wrong here or am I correct in my assumption that for some reason FB refuses to update the contents of my "common.swc" library into memory?
    Any insight would be appreciated as I cannot find a single relevant answer in 3 hours of Google searching.

    OK,
    Now I see what is really going on. I am trying to reference MCs from my "common.swc" lib which is in a different project, and the reason they are showing up and available is because I used them in MXML files within the "common" project that are called upon and loaded before the mobile specific login screen MXML is loaded.
    I just did a quick test to see if the new button I created would be available within the "common" project and it is there, and shows up with intellisense etc etc as expected.
    When I add an instance of my new button to a MXML file being loaded before the mobile specific stuff I can then drop it into my mobile specific screens and it shows up.
    I either need to figure out how to reference MCs within a swc inside of a different project directly, or just declare them when the application first loads.

  • [Q] duplicating movieclip with loaded external jpg file

    Hi, Im trying to make thumbnail and enlarged picture by
    duplication.
    What i tried was using duplication of thumbnail movieclip
    which jpg image is loaded
    However it seems not working as i intended,so I had to make
    empty movieclip and loaded image again!!!
    I am concerning that if I use new movieclip and loading the
    image again..it means users have to download the same image twice.
    Basically, I am trying to make a list of thumbnailed images
    with enlarged picture popes up when mouse rolls over them
    Is there any proper way to make it happen?
    or duplication just doesnt work even thou movieclip is
    already loaded with image?
    Thank you for your time~

    > simple create your movieclip. Now create an empty clip
    inside. You will
    load
    > your JPG in the empty clip. This one can't be
    duplicated, but you will be
    able
    > to duplicate its parent. Like that:
    > myMc.anEmptyClip.loadMovie("blabla.jpg");
    > myMc.duplicateMovieClip("theNameYouWant",
    levelNumYouWant);
    >
    > That will works.
    No, that will not work
    You are partly right - if you create a nested clip and assign
    properties
    (such as an onPress handler) to the parent clip, you can then
    load content
    into the child without overwriting the parent's properties.
    If you load an
    image into the child and then duplicate the parent however,
    the image in the
    child clip *will not be duplicated*. Try it.
    > 2- Also, the way you where going to do, works too. yes
    the user will have
    to
    > load it again, but it is already in the Browser Cache.
    It means that will
    load
    > quickly the second time and after that. Bad side is more
    that you will
    doble
    > the bandwidth of the images loading on your site.
    Again, partly right. Lets take it bit by bit:
    > yes the user will have to
    > load it again, but it is already in the Browser Cache
    The movie will have to load it again, but will probably load
    it from cache.
    > Bad side is more that you will doble
    > the bandwidth of the images loading on your site.
    Not so. If it's in the cache, it doesn't use any bandwidth at
    all - that's
    what caching means! A copy of the image is saved on the
    user's local hard
    drive, so no bandwidth needs to be used when loading from
    cache.
    Basically, for the *majority* of users, loaded images will be
    cached (this
    is dependent on browser settings, but most users will have
    their browsers
    set to cache). This means that after the first load,
    subsequent loads of the
    same image will be quick and carry no bandwidth overheads.
    The real issue here is that dynamic content in movieClips,
    such as loaded
    images, swfs, or graphics created with the drawing API will
    not duplicate
    when the clip is duplicated/ The accepted work around used to
    be simply to
    reload the aimge. Now with Flash 8 though you can use the
    BitmapData class
    to grab a copy of the image and redraw it to the newly
    created clip if you
    so wish.
    Pete
    Remove '_spamkiller_' to mail

  • Flash CS5 crashing when saving

    OK! What's the deal?
    I have just purchased Adobe Master Collection CS5, all $4400 worth! To give the software it's credit, I formatted my HDD and clean installed Win 7 x64 OS. I then clean installed the entire CS5 suite! As I have to somewhat justify the purchase to my boss (who paid for the software), I have gone to continue doing some work, (not even trying out new features!!), I needed to complete a task, so I got onto it.
    I opened up an existing file which was created using CS4, noticed a few bugs that arose when published out using CS5 (mainly around the way that fonts were referred as), fixed those, then all was going well. As we have all done, I got involved with the work, and worked for a long time without saving. I realised this and quickly went to save. The dialog box came up advising that it needed to change versions to CS5 (rather than the original CS4), so I cancelled out and did a file Save As.
    I thought I would create a new file so that if anything went wrong, I would have a backup. BLOODY LUCKY I DID, as when I went to save as, Flash crashed, loosing all the work I did. I did manage to get a screenshot of some of my AS which was lucky, but when I looked into the folder where I tried to save, there was a completley useless *.fla of 1kb in size which was completely corrupted and couldn't open up.
    Resigned to the fact that I lost all my work (nothing new - as we all know it happens every now and then), I thought I would open up Flash, and the very first task would be to save it as CS5 format. Low and behold, flash crashes again, again leaving a corrupted file in it's place. For $4400, you would think you could at least save the work you have done!!
    In other tests, it seems it can save new files, and some simple animations created in CS4, but what the hell do I do with all the existing work that I have spent the last year developing? Can someone please help me, as I really cannot work until this issue is resolved.
    HELP!
    Duncan Buchanan

    I have found the solution to fix my file
    In my case, I had to remove from the XML descriptor of a movieclip a reference to an FLVPlayback component! (don't ask me why)
    I am pasting the XML node I had to remove on the bottom, first the step by step solution in case others may stumble on this.
    It seems that movieclips get corrupt somehow, so, in order to find which ones, we have to proceed this way:
    solution
    1 - if you save your file as CS5 FLA, then rename the corrupt file from xxx.fla to xxx.zip.
    2 - Unzip the file, and you are going to have the same directory structure as if you save in xfl. Now, if you open the xfl file inside the unzipped folder, you get the same error you get opening the fla.
    3 - Go into the LIBRARY folder. This is a hyerarchical representation of your library.
    4 - If like I do, your library is well organized in folders and subfolders, this step will not be too annoying. If you have all library items free in the library, then it could be boring. Anyway... The thing here is to find which library items are causing the problem, so you have to remove them one by one, or in groups, and try to launch the xfl each time. When the xfl gets opened, you have removed the right library item.
    In my case, even for very large projects, I have only 4 folders in library's root. So what I did, I tried removing one of them, till I found the rightt one. Then I went deeper and deeper, and eventually found the **** movieclip causing the crash.
    If its not an important item, you can just happily continue to work and do it again. In my case, it was a vital component, so I went inside the xml definition, and tried to remove nodes untill it finally opened.
    TAHDAH
    The file got opened again, just with a missing reference inside that movieclip.
    I have read that often an empty frame may cause the problem, so you should look for <element/> tag.
    In my case, was a FLVPlayback component.
    Find below the node I had to remove (someone from Adobe may give a look)
    It is advised untill Flash CS5 doesn't get stabilized on file save  (yeah, I know, a detail!) to store your projects as xfl and not as FLA  files. (I don't really know why, since a fla file is just a zipped xfl  folder renamed as .fla)
    Exhausted but happy.
    Filippo
                    <DOMCompiledClipInstance libraryItemName="FLVPlayback" name="_video" selected="true" uniqueID="8">
                      <matrix>
                        <Matrix a="2.45603942871094" d="2.04177856445313"/>
                      </matrix>
                      <transformationPoint>
                        <Point x="160" y="119.95"/>
                      </transformationPoint>
                      <dataBindingXML><![CDATA[<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='HighlightItem' oldCopiedComponentPath=''>
    </component>
    ]]></dataBindingXML>
                      <parametersAsXML><![CDATA[   <property id="align">
          <Inspectable name="align" variable="align" category="" verbose="0" defaultValue="center" enumeration="center,top,left,bottom,right,topLeft,topRight,bottomLeft,bottomRight" type="List"/>
       </property>
       <property id="autoPlay">
          <Inspectable name="autoPlay" variable="autoPlay" category="" verbose="0" defaultValue="false" type="Boolean"/>
       </property>
       <property id="cuePoints">
          <Inspectable name="cuePoints" variable="cuePoints" category="" verbose="0" defaultValue="" type="Video Cue Points"/>
       </property>
       <property id="isLive">
          <Inspectable name="isLive" variable="isLive" category="" verbose="0" defaultValue="false" type="Boolean"/>
       </property>
       <property id="preview">
          <Inspectable name="preview" variable="preview" category="" verbose="0" defaultValue="None" type="Video Preview"/>
       </property>
       <property id="scaleMode">
          <Inspectable name="scaleMode" variable="scaleMode" category="" verbose="0" defaultValue="exactFit" enumeration="maintainAspectRatio,noScale,exactFit" type="List"/>
       </property>
       <property id="skin">
          <Inspectable name="skin" variable="skin" category="" verbose="0" defaultValue="" type="Video Skin"/>
       </property>
       <property id="skinAutoHide">
          <Inspectable name="skinAutoHide" variable="skinAutoHide" category="" verbose="0" defaultValue="false" type="Boolean"/>
       </property>
       <property id="skinBackgroundAlpha">
          <Inspectable name="skinBackgroundAlpha" variable="skinBackgroundAlpha" category="" verbose="0" defaultValue="0.85" type="Number"/>
       </property>
       <property id="skinBackgroundColor">
          <Inspectable name="skinBackgroundColor" variable="skinBackgroundColor" category="" verbose="0" defaultValue="#666666" type="Color"/>
       </property>
       <property id="source">
          <Inspectable name="source" variable="source" category="" verbose="0" defaultValue="" type="Video Content Path"/>
       </property>
       <property id="volume">
          <Inspectable name="volume" variable="volume" category="" verbose="0" defaultValue="1.00" type="Number"/>
       </property>
    ]]></parametersAsXML>
                    </DOMCompiledClipInstance>

  • How to transfer a saved flash game's progress onto another computer using a flashdrive?

    I downloaded a .swf file of a flash a game that I put into an html file and found that it saved data into the sharedobjects folder inside of the macromedia folder but I'm just wondering if theres a way to redirect where the flash game goes to load player progress so that I can just copy the folder into my flashdrive and play it from there. In case anyone asks why I won't just copy the folder's contents into the second computer I'm planning on playing the game on a computer in school.

    No, there's no good way to do this.  You *could* (if you can run an .exe file off the flash drive) try the Flash Projector, if you can run the SWF as a standalone application. 
    Adobe Flash Player - Downloads

  • Saving on a mobile device

    Can anyone tell me how to save score/level/etc. information for a game on a mobile device?  Or point me to any tutorials/examples please?
    I'm still unsure how to read/write files in the apk (Android).
    Basically, I want to allow the player to save his progress at some point so that they can restore it later.
    John

    You may want to try using Flash SharedObjects
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject. html
    I used this method when saving data to an iPhone and it worked well. It's fairly easy to get started with and it writes in the application specific directory on the phone (or app data on windows).
    It retains an 'object' type so you can reference items you store through normal object referece ie. myStorageObject.data.username, myStorageObject.data.score etc, (assuming there is data).

  • Using SharedObject between multiple apps

    Assuming I own and have access to two different apps' SharedObject variables ... is it possible to save settings from Game A and have it be remembered in Game B?
    Essentially, I'm just trying to bring settings from a "Lite" version of a game and if users choose to purchase and install the "Full" version, all of their settings from the "Lite" version will be remembered, saving them some hassle.
    Is this possible? Or is there a better way altogether that I just don't know about? Thanks!

    I think SharedObjects can only be seen by the app that created them. If you find otherwise, please let me know!
    I also wanted to share saved data from a lite game and a full game, but I think I would have had to use SQLite to achieve this.
    In the end I just set some of the early levels of the full version to be unlocked by default.

  • Sharing SharedObjects between multiple .swfs

    Relatively simple problem; I have a project that I think may be more manageable if I break it up into multiple small .swf files rather than having a gargantuan mega .swf.
    Now, I know that I could use a root .swf and load data from the others, but I think that it'll be a lot easier to debug and update if I'm using separate self-contained .swfs, so this is the direction I'm currently investigating.
    However, the .swfs won't really work unless I can have user-data persist between them, so I'm wondering if I can load a SharedObject saved by another .swf file? Are there any important caveats that I need to be aware of?
    In particular, can anyone give me sample code that would allow me to do this with both an online and offline copy of the files; i.e - if I run the same set of .swfs from haravikk.com, and locally, I want them to still be able to share data with one-another. In this case though I won't need to worry about sharing data between a local copy and haravikk.com, just so long as the files themselves can pass data within whatever domain they're loaded it should be fine.

    To do this I still need to make sure that all .swfs are retrieving/flushing their SharedObjects to the same domain though, right?
    I'm curious, is there a good way to work out what the right domain is dynamically?
    For example; say I have "Menu.swf", and "About.swf", both store in the same folder "MySite", so the files are located at "MySite/Menu.swf" and "MySite/About.swf" respectively. To avoid tying the files to a particular domain-name (so it can still work offline) I'd like to grab the current location of the .swf, and remove the file-name so that I have a domain containing just the enclosing folder.
    Is there a best way to do this? Basically so I can have my .swf files using a consistent domain for storing/saving, while still supporting relocating the files, so they will work offline if I copy them to my local machine for example.

  • Example of saving app state

    Does anyone have an example of this to share ?

    This is my class for saving and retreiving top ten score in this app: http://itunes.apple.com/app/haunted-house-the-game/id396419936
    import flash.net.SharedObject;
    public class HighScoreShared {
    var highScores: SharedObject;
    var cookie_name: String;
    public function HighScoreShared(cookie_name:String) {
    this.cookie_name = cookie_name;
    highScores = SharedObject.getLocal(this.cookie_name);
    if (highScores.data.scores==undefined){
    //trace("highscore undefined... create a new array");
    defaultScores();
    // testing
    //reset();
    //defaultScores();
    //trace("highScores.data.scores: "+highScores.data.scores);
    public function reset(){
    highScores.clear();
    public function defaultScores(){
    highScores.data.scores = new Array();
    for(var i:uint=0;i<10;i++){
    highScores.data.scores.push({name:"none",value:(10-i)*100});
    public function getHighScores():Array{
    highScores = SharedObject.getLocal(this.cookie_name);
    return highScores.data.scores;
    public function getNamesFormatted():String{
    var returnStr:String="";
    for(var i:uint=0;i<10;i++){
    returnStr+=highScores.data.scores[i].name+"\n";
    return returnStr;
    public function getValesFormatted():String{
    var returnStr:String="";
    for(var i:uint=0;i<10;i++){
    returnStr+=highScores.data.scores[i].value+"\n";
    return returnStr;
    public function getTopOne():Number{
    return highScores.data.scores[0].value;
    public function getLastOne():Number{
    return highScores.data.scores[9].value;
    public function setNewScore(thename:String,thescore:int){
    if (thename.length>10) thename = thename.substring(0,10);
    highScores = SharedObject.getLocal(this.cookie_name);
    if (highScores.data.scores==undefined){
    //trace("error undefined!");
    }else{
    for(var i:uint=0;i<10;i++){
    //trace("i: "+i+" value: "+highScores.data.scores[i].value);
    if (highScores.data.scores[i].value <=thescore){
    //trace("found the right place");
    for (var j:uint=9;j>i;j--){
    trace("j: "+j+" value: "+highScores.data.scores[j].value+" <--" +highScores.data.scores[j-1].value);
    highScores.data.scores[j].name = highScores.data.scores[j-1].name;
    highScores.data.scores[j].value= highScores.data.scores[j-1].value;
    highScores.data.scores[i].name = thename;
    highScores.data.scores[i].value = thescore;
    //trace("i: "+i+" value: "+highScores.data.scores[i].value+" <--thescore: " +thescore);
    return;
    Hope this can help.
    Emanuele

Maybe you are looking for