Load and Save a game in director

hi, i would like to have the option to load and save a game
that i have created in Director MX 2004. But, I'm unsure what
script to attach to my LOAD and SAVE buttons. Was wondering if sum1
has an idea as to what the lingo script might be?
thanks
corry

You can find my reply to this cross-post in the
Director
Online forum.

Similar Messages

  • How to load and save custom workspaces in PE7

    I've written a little utility which allows PE7 users to load and save custom workspaces. It's attached to post #1 of this thread.
    System requirements
    The utility has been tested with Windows XP Pro SP3 only. It might or might not run under Vista. It will only work with PE7 installations where the executable files are in the default places.
    Installation
    When you have downloaded the utility (it's only 199KB) you can run it from any convenient place in your system - it doesn't need to be installed as such.
    Usage
    It's pretty self-explanatory in use but here's the manual!
    Run the downloaded utility "PE7WS.exe".
    A file selection dialog appears. Choose the workspace layout file you wish to use. "LastUsed.layout" is the last used workspace (that's all you will be offered the first time you run the program). If you press Cancel at this point, the program will exit and nothing will happen.
    Once you have selected the workspace, click "Open" and Premiere Elements 7 will run, using the workspace layout you chose.
    After you exit from Premiere Elements 7, a workspace layout file save dialog will appear. If you made changes to the workspace during your Premiere Elements 7 session, you can now give the revised workspace a name and save it.
    Do not save the workspace in a different directory from that which the dialog offers!
    If you have changed an existing custom workspace, and you want to update the version previously stored, just select the name and over-write the saved workspace layout with the new one.
    If you don't want to save the workspace at all, just click "Cancel" - next time you run Premiere Elements, you can choose the "LastUsed.layout" workspace to use that last used unsaved workspace in any event.
    If you use the PE7WS utility to run Premiere Elements 7, and then you use the menu option "Window > Restore Workspace", then exit, you can either cancel the workspace saving stage, (which will mean that "LastUsed.layout" will contain that default workspace), or you could give that default workspace a name like "PE7 Default" so you can start a future Premiere Elements 7 session with the default workspace, even though you last used a custom workspace.
    If you run Premiere Elements 7 in the usual way without using PE7WS.exe, the workspace that appears will be the last used one.
    The usual disclaimer...
    The utility should be entirely safe in use, but I can't accept responsibility for any loss or damage it might cause. However, the only file manipulation is does is to workspace files in the directory that Premiere Elements 7 uses purely for the purpose - the utility doesn't go anywhere near your precious project files.

    I'm finding it very handy on my particular twin 22" monitor setup to sometimes use a one-screen layout and sometimes a two screen layout. I 'discovered' that having the timeline on the second monitor enables me to tweak edits there while having the playback full size after pressing the "full screen" button on the first monitor. Where the timeline would normally be I have the history, mixer, and other windows always open. As the second monitor is also used by another PC (the one I have the net and email etc on) using "Maxivista" monitor sharing software, I revert to single screen layout when doing stuff like exporting to DVD so I can see what is going on with the render while typing stuff like this.
    Selectable workspaces are dead handy!

  • How can I load and save text using FileReference class

    Let me start by saying I have no intention of using php and I can't wait until flash cs5 comes out with its new read/write capabilities
    I want to load and save XML files (stored on my local hard-drive) in AS3.
    I am using the FileReference class.
    Firstly I have noticed that when using FileReference.save if you replace an existing file instead of writing over the file data is appended to the end of the file. Can I make it so the file is overwritten (as it should be) or make it impossible for the user to save in such a situation.
    Secondly I want to load in text from an external file using FileReference.load I know that somehow you use FileReference.browse first to get it to work but I want to know exactly how to do it.
    I have looked for a tutorial about loading text in this manner and have not found one.
    Any help would be much appreciated especially if you could point me in the direction of a relevant tutorial
    Thanks

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • Load and save difficulties.

    I am new to java and do not understand how the load and save functions work.
    I have the following code and would like the load function to open selected files into text area 1 and the save function to save the contents of text area 2.
    Can anyone help me with thuis please?
    //Adding text field one
              TextArea ta1 = new TextArea(15,20);
              textPanel = new JPanel();
              textPanel.setLayout(new GridLayout(1,1) );
              textPanel.setBorder(titled);
              textPanel.add(ta1);
              container.add(textPanel, BorderLayout.NORTH);
              //Adding text field two
              TextArea ta2 = new TextArea();
              textPanel = new JPanel();
              textPanel.setLayout (new GridLayout(1,1));
              textPanel.setBorder(titled2);
              textPanel.add(ta2);
              container.add(textPanel, BorderLayout.CENTER);
              //setting the window requirements 800, 600
              setSize(800, 600);
              setVisible(true);
              setResizable(false);
              Load.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        final JFileChooser fc = new JFileChooser();
                        int returnVal = fc.showOpenDialog(fc);
              Save.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        final JFileChooser fc = new JFileChooser();
                        int returnVal = fc.showSaveDialog(fc);
         });

    Example:
    // Your code
      Load.addActionListener( new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          File file = getFile('o');
    //      final JFileChooser fc = new JFileChooser();
    //      int returnVal = fc.showOpenDialog(fc);
    // end your code
      File getFile(char fcType) {
        int returnVal = 0;
        File file = null;
        JFileChooser fc = new JFileChooser();
        if ( fcType == 'o' )
          returnVal = fc.showOpenDialog(fc);
        else
          returnVal = fc.showSaveDialog(fc);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
          try {
            file=fc.getSelectedFile();
          } catch (IOException e) {
            // show exception or handle it
        return( file );
      }

  • Load and Save MySql Database

    In what way in java can I load and save a full database ,from MySql, in java , a dump operation .

    This is how I am parsing and requesting the information.. I know it's in there somewhere I just can't get the variables, do I need to add them ? It's not making much sense to me at the moment, I'm sorry !! I need to add the variables to the request somehow.. so I can receive the info, no ?
    var tab = "SQLtab";
    var filesend = "path to php file";
    var modesend = "post";
    function variableTransaction(fichier, modesend, tab, var1, var2) {
         var URLload = new URLLoader();
         var URLrequest = new URLRequest(fichier);
         var variables:URLVariables = new URLVariables();
         variables.tab = tab;
         variables.var1 = var1;
         variables.var2 = var2;
         if (modesend == "post") {
              URLrequest.method = URLRequestMethod.POST;
         } else if ( modesend == "get") {
              URLrequest.method = URLRequestMethod.GET;
         if (var1 == false && var2 == false) {
              URLload.dataFormat = URLLoaderDataFormat.VARIABLES;
              URLrequest.data = variables;
              URLload.load(URLrequest);
              URLload.addEventListener(Event.COMPLETE, loadComplete, false, 0, true);
         } else {
              URLrequest.data = variables;
              URLload.load(URLrequest);
              var receiveObject = variableTransaction(filesend, modesend, tab, false, false);

  • How do I load and save to my iMac a dvd purchased elsewhere?

    how do I load and save to my iMac a dvd purchased elsewhere?  Thank you.

    The mods here are adverse to mentioning software to duplicate commercial media, which is called "ripping." However, you can search outside of this forum for the software you need.

  • Illustrator "Not Responding" on load and save

    Good evening..
    We bought a new computer our graphic designer (HP Z400 quad-xeon 2.66GHz, 16GB ram, Quadro 4000 graphic card), installed with Windows 7 64-bit, set it up with the Adobe CS 5.5 Master Collection.
    The problem is with Illustrator, whereas it goes to "Not Responding" on load and save of files. The progress bar when saving stops at 5-10%, but it seems like it's still doing it's thing and it eventually goes through (15-45secs). However, I really hate getting this kind of message, moreso because his current desktop (HP XW4600, Win XP 32-bit, 3BG of RAM, Adobe CS5) is not doing this at all.
    I looked a lot of the forums, and tested what was offered and it still isn't better.
    - I removed an Add-On I had installed, no luck.
    - Removed all network drives, no luck.
    - Unchecked "Create PDF compatible file", no luck.
    Working locally is the same as on the network, which makes me believe the network is not a problem in my case. (Even switched from 100mb network connection to 1GB, which was the first thing I tried)
    Mind you, all these things I've tried were done in addition to the others, so even to total of all these wasn't helpful, and I'm still at square one.
    I'd like to add that all the other applications in the suite are behaving correctly, Photoshop, Premiere, InDesign... Everything else is working great and not freezing at all. Which is why I find this wierd that Illustrator would act like that while all the others are fine.
    Anything else I should be trying?
    Jonathan
    Edit: I checked again on his previous computer, and it seems the issue is there as well, unlike what I mentionned before, which might point to a problem with Illustrator itself, since between CS5 and CS5.5, Illustrator hasn't changed. Altough I'm not sure if it may be that the old computer is just *that* slow...

    Well, it has the Adobe PDF printer (from Adobe Acrobat) and MS XPS Document Writer (from Office), but since they weren't real printer I hadn't mentionned them. Is this what you consider Virtual printer?
    Either way, I've added a printer but it's still doing the same thing.

  • Load and save text file???

    hi,i've this program works as far as i know.what i need to do now is load the file when the program starts and saves any updates made when i exit the program to the text file called "PublicationList.txt" how can i do this?i dont know where to start.if someone can show me the code to put in so it works that would be what i need please.thanks alot if you can help.
    The text file look contains the information as so:
    PubID 1 Pubname Times Pubtype National Pub UM Status A PPR 50
    PubID 2 Pubname Guardian Pubtype National Pub UM Status A PPR 60
    PubID 3 Pubname Sun Pubtype National Pub UM Status A PPR 30
    public class publication
    public int PublicationID;
    public String publicationname;
    public String publisher;
    public String PricePerIssue;
    public String pubstatus;
    public String publicationtype;
    public publication(int NewPublicationID, String Newpublicationname, String Newpublisher, String NewPricePerIssue, String Newpubstatus, String Newpublicationtype)
    PublicationID = NewPublicationID;
    publicationname = Newpublicationname;
    publisher = Newpublisher;
    PricePerIssue = NewPricePerIssue;
    pubstatus = Newpubstatus;
    publicationtype = Newpublicationtype;
    public String toString ()
    String pubreport = "---------------------------Publication-Information-----------------------------\n\n";
    pubreport += "Publication ID:" PublicationID" Publication Title: " publicationname"\n";
    pubreport += " publisher: " publisher " price Per Issue: " PricePerIssue"\n";
    pubreport += " publication Status: " pubstatus " publication Type: " publicationtype"\n";
    return pubreport;
    public void SetPublicationID(int PubID)
    PublicationID = PubID;
    public int GetPublicationID()
    return PublicationID;
    public void Setpublicationname(String pubname)
    publicationname = pubname;
    public String Getpublicationname()
    return publicationname;
    public void Setpublisher(String Pub)
    publisher = Pub;
    public String Getpublisher()
    return publisher;
    public void SetPricePerIssue(String PPI)
    PricePerIssue = PPI;
    public String GetPricePerIssue()
    return PricePerIssue;
    public void Setpubstatus(String Status)
    pubstatus = Status;
    public String Getpubstatus()
    return pubstatus;
    public void Setpublicationtype(String Pubtype)
    publicationtype = Pubtype;
    public String Getpublicationtype()
    return publicationtype;
    import java.util.*;
    import publication;
    public class PublicationContainer
    LinkedList PubList;
    public PublicationContainer()
    PubList = new LinkedList();
    public int add (publication newpublication)
    PubList.addLast(newpublication);
    return PubList.size();
    private class PubNode
    public publication pubrecord;
    public PubNode next;
    public PubNode (publication thepublicationrecord)
    publication p = thepublicationrecord;
    next = null;
    public String toString()
    return PubList.toString();
    public void remove(int PubID)
    PubList.remove(PubID);
    public publication get(int PubID)
    return (publication)PubList.get(PubID);
    public void set(int PubID,publication newpublication)
    PubList.set(PubID, newpublication);
    import cs1.Keyboard;
    import publication;
    import java.util.*;
    public class publicationmain
    public static void main(String args[])
    PublicationContainer pubdatabase = new PublicationContainer();
    int userchoice;
    boolean flag = false;
    while (flag == false)
    System.out.println("------------------------------------Publications--------------------------------");
    System.out.println();
    System.out.println("please Make a Selection");
    System.out.println();
    System.out.println("1 to add publication");
    System.out.println("2 to delete publication");
    System.out.println("0 to quit");
    System.out.println("3 to View all publications");
    System.out.println("4 to Edit a publication");
    System.out.println();
    userchoice = Keyboard.readInt();
    switch (userchoice)
    case 1:
    String PubName;
    String PricePerIssue;
    String Publisher;
    String Pubstatus;
    String Pubtype;
    int PubID;
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype = Keyboard.readString();
    pubdatabase.add (new publication(PubID, PubName, Publisher, PricePerIssue, Pubstatus, Pubtype));
    break;
    case 0:
    flag = true;
    case 2:
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    System.out.println ("publication: "+(PubID)+" removed");
    System.out.println();
    break;
    case 3:
    System.out.println (pubdatabase);
    break;
    case 4:
    System.out.println ("Enter Publication to be edited by Publication ID: ");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    String PubName1;
    String PricePerIssue1;
    String Publisher1;
    String Pubstatus1;
    String Pubtype1;
    int PubID1;
    System.out.println ("Enter Publication ID:");
    PubID1 = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName1 = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher1 = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue1 = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus1 = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype1 = Keyboard.readString();
    pubdatabase.add (new publication(PubID1, PubName1, Publisher1, PricePerIssue1, Pubstatus1, Pubtype1))
    break;
    default:
    System.out.println("Incorrect Entry");
    }

    public void readFile()
         BufferedReader br = new BufferedReader( new FileReader("PublicationList.txt") );
         String row;
         while( (row = br.readLine() ) != null)
              StringTokenizer st = new StringTokenizer(row," ");
              String temp = st.nextToken();
              String pubid = st.nextToken();
              temp = st.nextToken();
              String pubname = st.nextToken();
              temp = st.nextToken();
              String pubtype = st.nextToken();
              temp = st.nextToken();
              String pub = st.nextToken();
              temp = st.nextToken();
              String status = st.nextToken();
              temp = st.nextToken();
              String ppr = st.nextToken();
              // now you have in the Strings the values you needed
              // so what you want to do now
         } // read next line
         br.close();
    }try the writing on your own.
    tobias

  • File load and save errors???

    hi,i'am unable to get my file to oad and save in this class.i get 5 errors 1."Exception java.io.FileNotFoundEception must be caught or be declared in the throws clause" 2."Incompatible type for constructor.Cant convert java.io.FileInputStream to java.util.Properties" 3."Undefined variable: FileInputStream" 4."Variable 'p' is already defined in this method" 5. Incompatible type for constructor.cant covert java.io.FileInputStream to java.util.Properties.can someone please show me how to change this so it will compile and work?thanks
    import cs1.Keyboard;
    import publication;
    import java.util.*;
    import java.io.*;
    public class publicationmain
    public static void main(String args[])
    PublicationContainer pubdatabase = new PublicationContainer();
    int userchoice;
    boolean flag = false;
    while (flag == false)
    File file = new File("publicationsList.txt");
    //1st error on line below
    FileInputStream inputStream = new FileInputStream(file);
    //2nd error here
    Properties p = new Properties(inputStream);
    String myPublicationID = p.getProperty("PublicationID", defaultValue);
    System.out.println("------------------------------------Publications--------------------------------");
    System.out.println();
    System.out.println("please Make a Selection");
    System.out.println();
    System.out.println("1 to add publication");
    System.out.println("2 to delete publication");
    System.out.println("0 to quit");     
    System.out.println("3 to View all publications");
    System.out.println("4 to Edit a publication");
    System.out.println();
    userchoice = Keyboard.readInt();
    switch (userchoice)     
    case 1:
    String PubName;
    String PricePerIssue;
    String Publisher;
    String Pubstatus;
    String Pubtype;
    int PubID;
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype = Keyboard.readString();
    pubdatabase.add (new publication(PubID, PubName, Publisher, PricePerIssue, Pubstatus, Pubtype));
    break;
    case 0:
    //3rd error here
    FileInputStream = new FileInputStream(file);
    //4th and 5th error here
    Properties p = new Properties(inputStream);
    p.put("PublicationID", PubID);
    p.put("PublicationName", PubName);
    p.put("PublisherName" , Publisher);
    p.put("PriceperIssue" , PricePerIssue);
    p.put("PublicationStatus" , Pubstatus);
    p.put("PublicationType" , Pubtype);
    p.store(outputStream, "My Header");
    flag = true;
    case 2:
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    System.out.println ("publication: "+(PubID)+" removed");
    System.out.println();
    break;
    case 3:
    System.out.println (pubdatabase);
    break;
    case 4:
    System.out.println ("Enter Publication to be edited by Publication ID: ");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    String PubName1;
    String PricePerIssue1;     
    String Publisher1;
    String Pubstatus1;
    String Pubtype1;
    int PubID1;
    System.out.println ("Enter Publication ID:");
    PubID1 = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName1 = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher1 = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue1 = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus1 = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype1 = Keyboard.readString();
    pubdatabase.add (new publication(PubID1, PubName1, Publisher1, PricePerIssue1, Pubstatus1, Pubtype1));
    break;
    default:
    System.out.println("Incorrect Entry");
    }

    i'm sorry to ask this, but how long are you programming in java ? not so long, right ?
    maybe you should first learn how the syntax in java is. maybe you should take a look at the java tutorial.
    the errors you get are simple, so normally you should be able to solve these problems yourself.
    and, if you want to post another message with the same topic, please use the already existing (started by you) threads like
    http://forum.java.sun.com/thread.jsp?forum=31&thread=230202
    or
    http://forum.java.sun.com/thread.jsp?forum=31&thread=230185
    you can reply to your postings. you do not need to start a new thread.
    tobias

  • Using SharedObjects to load and save data

    Hello, i am having troubles with using shared objects to save and load data for my highscore feature of my game i am developing in actionscript 3. This is my main code.
    I am trying to update a dynamic text field that acts as an high score function
    [as]
    package
              // initialize;
              import flash.display.MovieClip;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
              import flash.ui.Mouse;
              import flash.events.KeyboardEvent;
              import flash.ui.Keyboard;
              import flash.events.Event;
              import flash.media.SoundChannel;
              import flash.net.SharedObject;
              import flash.text.TextField;
              import flash.display.Stage;
              import flash.events.ProgressEvent;
              public class Game extends MovieClip
                        public static var _stage:Stage;
                        static var so:SharedObject;
                        static var ship:MovieClip;
                        static var healthMeter:HealthMeter;
                        static var score:Score;
                        static var highScore:HighScore;
                        static var enemyShipTimer:Timer;
                        static var gameOverMenu:GameOverMenu;
                        static var startMenu:StartMenu;
                        static var helpMenu:HelpMenu;
                        static var startButton:StartButton;
                        static var returnButton:ReturnButton;
                        static var helpButton:HelpButton;
                        static var pauseButton:PauseButton;
                        static var playButton:PlayButton;
                        static var mainMenuButton:MainMenuButton;
                        public var currentValue:Number;
                        public var loadingProgress:LoadingProgress;
                        public function Game()
                                  loadingProgress = new LoadingProgress();
                                  loadingProgress.x = 550;
                                  loadingProgress.y = 500;
                                  addChild( loadingProgress );
                                  loaderInfo.addEventListener( Event.COMPLETE, onCompletelyDownloaded );
                                  loaderInfo.addEventListener( ProgressEvent.PROGRESS, onProgressMade );
                        public function showMenuScreen():void
                                  _stage = this.stage;
                                  Key.initialize(stage);
                                  ship = new Ship();
                                  healthMeter = new HealthMeter();
                                  var score:Score = new Score();
                                  var highScore:HighScore = new HighScore();
                                  so = SharedObject.getLocal("scores");
                                  if (so.data.score)
                                            highScore.bestScore.text = so.data.score.toString();
                                  else
                                            highScore.bestScore.text = "0";
                                  addChild(score);
                                  addChild(highScore);
                                  gameScore.visible = false;
                                  bestScore.visible = true;
                                  healthMeter.x = 2.5;
                                  healthMeter.y = 576;
                                  gameOverMenu = new GameOverMenu();
                                  gameOverMenu.x = 217;
                                  gameOverMenu.y = 244;
                                  addChild(gameOverMenu);
                                  gameOverMenu.visible = false;
                                  helpMenu = new HelpMenu();
                                  helpMenu.x = 480;
                                  helpMenu.y = 312;
                                  addChild(helpMenu);
                                  helpMenu.visible = false;
                                  returnButton = new ReturnButton();
                                  returnButton.x = 54;
                                  returnButton.y = 52;
                                  addChild(returnButton);
                                  returnButton.visible = false;
                                  gameOverMenu.playAgainButton.addEventListener("mouseDown", newGame);
                                  startMenu = new StartMenu();
                                  mainMenuButton = new MainMenuButton();
                                  startButton = new StartButton();
                                  helpButton = new HelpButton();
                                  startMenu.x = 151;
                                  startMenu.y = 111;
                                  startButton.x = 93;
                                  startButton.y = 426;
                                  helpButton.x = 631;
                                  helpButton.y = 386;
                                  mainMenuButton.x = 656;
                                  mainMenuButton.y = 483;
                                  addChild(mainMenuButton);
                                  mainMenuButton.visible = false;
                                  stage.addChildAt(startMenu, 0);
                                  addChild(startButton);
                                  addChild(helpButton);
                                  startMenu.visible = true;
                                  startButton.visible = true;
                                  helpButton.visible = true;
                                  startMenu.visible = true;
                                  startButton.addEventListener("mouseDown", newGame);
                                  helpButton.addEventListener("mouseDown", helpGame);
                                  mainMenuButton.addEventListener("mouseDown", mainMenu);
                                  returnButton.addEventListener("mouseDown", mainMenu2);
                                  pauseButton = new PauseButton();
                                  pauseButton.x = 896;
                                  pauseButton.y = 63;
                                  pauseButton.addEventListener("mouseDown", PauseGame);
                                  playButton = new PlayButton();
                                  playButton.x = 896;
                                  playButton.y = 63;
                                  addChild(playButton);
                                  playButton.visible = false;
                                  playButton.addEventListener("mouseDown", PlayGame);
                        static function gameOver()
                                  scoreF();
                                  mainMenuButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  gameOverMenu.visible = true;
                                  enemyShipTimer.stop();
                                  for (var i in EnemyShip.list)
                                            EnemyShip.list[i].kill();
                                  ship.takeDamage(-ship.maxHealth);
                        function newGame(e:Event)
                                  addEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = false;
                                  gameScore.visible = true;
                                  addChild(pauseButton);
                                  addChild(healthMeter);
                                  addChild(mainMenuButton);
                                  enemyShipTimer = new Timer(750);
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  addChild(ship);
                                  healthMeter.visible = true;
                                  startMenu.visible = false;
                                  mainMenuButton.visible = false;
                                  startButton.visible = false;
                                  healthMeter.visible = true;
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = false;
                                  ship.visible = true;
                                  ship.x = 367;
                                  ship.y = 542;
                                  enemyShipTimer.start();
                                  currentValue = 0;
                                  updateDisplay();
                        function mainMenu(e:Event)
                                  removeEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  removeChild(mainMenuButton);
                                  removeChild(ship);
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  ship.takeDamage(ship.maxHealth);
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                        function mainMenu2(e:Event)
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                                  helpMenu.visible = false;
                        function PauseGame(e:Event)
                                  enemyShipTimer.removeEventListener("timer", sendEnemy);
                                  stage.frameRate = 0;//
                                  pauseButton.visible = false;
                                  playButton.visible = true;
                        function PlayGame(e:Event)
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  stage.frameRate = 30;//
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                        function helpGame(e:Event)
                                  startMenu.visible = false;
                                  startButton.visible = false;
                                  helpButton.visible = false;
                                  helpMenu.visible = true;
                                  returnButton.visible = true;
                        function sendEnemy(e:Event)
                                  var enemy = new EnemyShip();
                                  stage.addChildAt(enemy, 0);
                                  addToValue(1);
                        function addToValue( amountToAdd:Number ):void
                                  currentValue = currentValue + amountToAdd;
                                  updateDisplay();
                        static function scoreF():void
                                  if (so.data.score)
                                            if (getFinalScore()>so.data.score)
                                                      so.data.score = getFinalScore();
                                                      so.flush();
                                  else
                                            so.data.score = getFinalScore();
                                            so.flush();
                        function updateDisplay():void
                                  if (currentValue>Number(highScore.bestScore.text))
                                            scoreF();
                                            highScore.bestScore.text = currentValue.toString();
                                  TextField(gameScore.getChildByName("scoreDisplay")).text = currentValue.toString();
                                  TextField(bestScore.getChildByName("bestScore")).text = highScore.bestScore.text;
                                  loadingProgress.percentDisplay.text = currentValue.toString();
                        static function getFinalScore()
                                  _stage;
                                  return;
                                  gameScore.currentValue;
                        public function onCompletelyDownloaded( event:Event ):void
                                  gotoAndStop(3);
                                  showMenuScreen();
                        public function onProgressMade( progressEvent:ProgressEvent ):void
                                  setValue( Math.floor( 100 * loaderInfo.bytesLoaded / loaderInfo.bytesTotal ) );
                        public function setValue( amount:Number ):void
                                  currentValue = amount;
                                  updateDisplay();
    [/as]
    when i run this, it crashes with this error.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at Game/updateDisplay()[C:\Users\Ben\Desktop\SFUR\Game.as:329]
              at Game/setValue()[C:\Users\Ben\Desktop\SFUR\Game.as:356]
              at Game/onProgressMade()[C:\Users\Ben\Desktop\SFUR\Game.as:351]
    help would be greatly appreciated.
    if you need any more details please ask.
    Line 329:  if (currentValue>Number(highScore.bestScore.text))
    Line 356:  updateDisplay();
    Line 351:
    setValue( Math.floor( 100 * loaderInfo.bytesLoaded / loaderInfo.bytesTotal ) );
    -Ben

    Ok, i have changed my classes a bit to try and fix the issue. I found a tutorial online called MJW avoider game or something and so i split some of my code in to seperate classes. But now the score doesnt update. I have fixed the loading issue (hopefully) i can access the main menu etc... but the highscore doesnt show at all after a game. Here are my classes.
    Document class (Game.as)
    package
              // initialize;
              import flash.display.MovieClip;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
              import flash.ui.Mouse;
              import flash.events.KeyboardEvent;
              import flash.ui.Keyboard;
              import flash.events.Event;
              import flash.media.SoundChannel;
              import flash.net.SharedObject;
              import flash.text.TextField;
              import flash.display.Stage;
              import flash.events.ProgressEvent;
              public class Game extends MovieClip
                        public static var _stage:Stage;
                        static var so:SharedObject;
                        static var ship:MovieClip;
                        static var healthMeter:HealthMeter;
                        static var score:Score;
                        static var enemyShipTimer:Timer;
                        static var gameOverMenu:GameOverMenu;
                        static var startMenu:StartMenu;
                        static var helpMenu:HelpMenu;
                        static var startButton:StartButton;
                        static var returnButton:ReturnButton;
                        static var helpButton:HelpButton;
                        static var pauseButton:PauseButton;
                        static var playButton:PlayButton;
                        static var mainMenuButton:MainMenuButton;
                        public var currentValue:Number;
                        public var loadingProgress:LoadingProgress;
                        static var highScore:HighScore;
                        public function Game()
                                  loadingProgress = new LoadingProgress();
                                  loadingProgress.x = 550;
                                  loadingProgress.y = 500;
                                  addChild( loadingProgress );
                                  loaderInfo.addEventListener( Event.COMPLETE, onCompletelyDownloaded );
                                  loaderInfo.addEventListener( ProgressEvent.PROGRESS, onProgressMade );
                        public function showMenuScreen():void
                                  removeChild( loadingProgress );
                                  _stage = this.stage;
                                  highScore = new HighScore();
                                  ship = new Ship();
                                  healthMeter = new HealthMeter();
                                  var score:Score = new Score();
                                  so = SharedObject.getLocal("scores");
                                  if (so.data.score)
                                            highScore.bestScore.text = so.data.score.toString();
                                  else
                                            highScore.bestScore.text = "0";
                                  addChild(score);
                                  addChild(highScore);
                                  gameScore.visible = false;
                                  bestScore.visible = true;
                                  healthMeter.x = 2.5;
                                  healthMeter.y = 576;
                                  gameOverMenu = new GameOverMenu();
                                  gameOverMenu.x = 217;
                                  gameOverMenu.y = 244;
                                  addChild(gameOverMenu);
                                  gameOverMenu.visible = false;
                                  helpMenu = new HelpMenu();
                                  helpMenu.x = 480;
                                  helpMenu.y = 312;
                                  addChild(helpMenu);
                                  helpMenu.visible = false;
                                  returnButton = new ReturnButton();
                                  returnButton.x = 54;
                                  returnButton.y = 52;
                                  addChild(returnButton);
                                  returnButton.visible = false;
                                  gameOverMenu.playAgainButton.addEventListener("mouseDo wn", newGame);
                                  startMenu = new StartMenu();
                                  mainMenuButton = new MainMenuButton();
                                  startButton = new StartButton();
                                  helpButton = new HelpButton();
                                  startMenu.x = 151;
                                  startMenu.y = 111;
                                  startButton.x = 93;
                                  startButton.y = 426;
                                  helpButton.x = 631;
                                  helpButton.y = 386;
                                  mainMenuButton.x = 656;
                                  mainMenuButton.y = 483;
                                  addChild(mainMenuButton);
                                  mainMenuButton.visible = false;
                                  stage.addChildAt(startMenu, 0);
                                  addChild(startButton);
                                  addChild(helpButton);
                                  startMenu.visible = true;
                                  startButton.visible = true;
                                  helpButton.visible = true;
                                  startMenu.visible = true;
                                  startButton.addEventListener("mouseDown", newGame);
                                  helpButton.addEventListener("mouseDown", helpGame);
                                  mainMenuButton.addEventListener("mouseDown", mainMenu);
                                  returnButton.addEventListener("mouseDown", mainMenu2);
                                  pauseButton = new PauseButton();
                                  pauseButton.x = 896;
                                  pauseButton.y = 63;
                                  pauseButton.addEventListener("mouseDown", PauseGame);
                                  playButton = new PlayButton();
                                  playButton.x = 896;
                                  playButton.y = 63;
                                  addChild(playButton);
                                  playButton.visible = false;
                                  playButton.addEventListener("mouseDown", PlayGame);
                        static function gameOver()
                                  scoreF();
                                  mainMenuButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  gameOverMenu.visible = true;
                                  enemyShipTimer.stop();
                                  for (var i in EnemyShip.list)
                                            EnemyShip.list[i].kill();
                                  ship.takeDamage(-ship.maxHealth);
                        function newGame(e:Event)
                                  addEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = false;
                                  gameScore.visible = true;
                                  addChild(pauseButton);
                                  addChild(healthMeter);
                                  addChild(mainMenuButton);
                                  enemyShipTimer = new Timer(750);
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  addChild(ship);
                                  healthMeter.visible = true;
                                  startMenu.visible = false;
                                  mainMenuButton.visible = false;
                                  startButton.visible = false;
                                  healthMeter.visible = true;
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = false;
                                  ship.visible = true;
                                  ship.x = 367;
                                  ship.y = 542;
                                  enemyShipTimer.start();
                                  currentValue = 0;
                                  updateDisplay();
                        function mainMenu(e:Event)
                                  removeEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  removeChild(mainMenuButton);
                                  removeChild(ship);
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  ship.takeDamage(ship.maxHealth);
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                        function mainMenu2(e:Event)
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                                  helpMenu.visible = false;
                        function PauseGame(e:Event)
                                  enemyShipTimer.removeEventListener("timer", sendEnemy);
                                  stage.frameRate = 0;//
                                  pauseButton.visible = false;
                                  playButton.visible = true;
                        function PlayGame(e:Event)
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  stage.frameRate = 30;//
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                        function helpGame(e:Event)
                                  startMenu.visible = false;
                                  startButton.visible = false;
                                  helpButton.visible = false;
                                  helpMenu.visible = true;
                                  returnButton.visible = true;
                        function sendEnemy(e:Event)
                                  var enemy = new EnemyShip();
                                  stage.addChildAt(enemy, 0);
                                  addToValue(1);
                        static function scoreF():void
                                  if (so.data.score)
                                            if (getFinalScore()>so.data.score)
                                                      so.data.score = getFinalScore();
                                                      so.flush();
                                  else
                                            so.data.score = getFinalScore();
                                            so.flush();
                        function updateDisplay():void
                                  if (currentValue>Number(highScore.bestScore.text))
                                            scoreF();
                                            Game.highScore.bestScore.text = currentValue.toString();
                                  TextField(gameScore.getChildByName("scoreDisplay")).te xt = currentValue.toString();
                                  loadingProgress.percentDisplay.text = currentValue.toString();
                        static function getFinalScore()
                                  _stage;
                                  return;
                                  gameScore.currentValue;
                        public function addToValue( amountToAdd:Number ):void
                                  currentValue = currentValue + amountToAdd;
                                  updateDisplay();
                        public function onCompletelyDownloaded( event:Event ):void
                                  gotoAndStop(3);
                                  showMenuScreen();
                        public function onProgressMade( progressEvent:ProgressEvent ):void
                                  loadingProgress.setValue( Math.floor( 100 * loaderInfo.bytesLoaded / loaderInfo.bytesTotal ) );
    Counter Class (Counter.as)
    package
              import flash.display.MovieClip;
              public class Counter extends MovieClip
                        public var currentValue:Number;
                        public function Counter()
                                  reset();
                        public function addToValue( amountToAdd:Number ):void
                                  currentValue = currentValue + amountToAdd;
                                  updateDisplay();
                        public function setValue( amount:Number ):void
                                  currentValue = amount;
                                  updateDisplay();
                        public function reset():void
                                  currentValue = 0;
                                  updateDisplay();
                        public function updateDisplay():void
    LoadingProgress class (LoadingProgress.as)
    package
              import flash.text.TextField;
              public class LoadingProgress extends Counter
                        public function LoadingProgress()
                                  super();
                        override public function updateDisplay():void
                                  super.updateDisplay();
                                  percentDisplay.text = currentValue.toString();
    There not all my classes, but they are the classes where the errors are coming from.
    Please remember i am an actionscript noob
    Thanks again, Nacho

  • How to load and save a Bitmap Image?

    Hi, I have to load a directory of bitmap images, take the background(in this case: light green) and then swap those exact pixels with another image's corresponding pixels, and then save them in the same format(bitmap) in a different directory. Can anybody advise me on which libraries I need to use, and how I should approach this? I need help with every step so any help will be good. Thanks. Basically I need to do the following:
    1. Load 2 directories of images(Lets say the images are corresponding like Image1A and Image1B)
    2. Take Image1A's green pixels and swap them with the corresponding Image1B's pixels.
    3. Save Image1A in a new Directory.
    This will go on for however many images there are in those 2 directories. Can anybody advise me how to do this? I need critical help in all three stages. Thanks.
    Edited by: Taufiq on Feb 25, 2008 9:10 AM

    Taufiq wrote:
    Doesn't java handle bitmap images? Does it HAVE to be gif etc. ?
    Edited by: Taufiq on Feb 25, 2008 10:17 AMI'm not familiar with windows-specific stuff, but ImageIO supports additional image readers/writers. You should google.
    Edit: Actually, I just checked and ImageIO comes with readers and writers for both BMP and WBMP files:
    http://java.sun.com/javase/6/docs/api/javax/imageio/package-summary.html

  • Long time to load and save

    I upgraded to Premier Pro CS5 about a month ago and have had excellent results with several small projects.  But now I am working on a larger project (45 minutes) and the projects takes a long time to load - 10 to 15 minutes - and even longer to save - up to an hour.  Today, while saving, I received low memory warning from windows.  I changed optimize memory in edit - preference to "memory" with no effect.  Here are some of the particulars
    System
    Intel Core I5 650
    8 gig ram - 6.5 gig dedicated to Pr
    2 - 1 terabyte hard drives
    Gforce GTX470 video card
    Windows 7 Home Premium
    dedicated computer to Premiere Pro
    Project
    Mostly HDV video
    some DV video
    ambient sound track
    narration track
    music track
    a few still pictures
    multiple titles
    Any help would be appreciated.  This is my first post to this forum.  Am I in the right place for this question? 
    Thanks
    Don

    Wow!  Thanks for the quick and helpful replies.  It is much appreciated.
    Hunt:
    Yes both HDDs are internal  C: has programs and paging  E: is just for media scratch and project
    Page files are system managed.  Page file size is 8183 MB.  MS help suggests I set a page file size do you agree and what size would you recommend?
    Colin:
    I am embarrassed that I did not think of this.  I am at version 5.0.0   Guess I have been spoiled by s/w installations that check for recent updates at time of install.  I will update Premiere in the morning.
    Harm:
    I appreciate the words of wisdom.  The scary thing is that I think I understand and resemble quote you included!  Thanks for the link.  I will check it out after I get Premiere update.
    Thanks again to all.  Will work on this tomorrow and let you know how it turned out.
    Don

  • Load and save a cluster

    I have a cluster of data that indicates tests failed.  At the beginning of the main VI, I want to check if the file exists, if not create it, and if it does, read it.  This file will be my saved cluster, indicating the tests that have previously failed. 
    I am using open/create/replace datalog and am having a problem with the cluster elements always becoming zero. 
    I also am trying to save the cluster to the file, every time a test fails.  This does not seem to work either. 
    Is datalog sub vis the easiest thing to use here?  Should I be using something other than a cluster?
    Thanks
    metzler CLAD
    Solved!
    Go to Solution.
    Attachments:
    loading cluster.vi ‏18 KB
    save cluster.vi ‏12 KB

    I was planning on the load vi to create the file, if the folder vi created the folder, the file does not exist and the no error case structure should run, and create the file,     
    You wrote:     "But there is a problem with your logic.  Why do you call it an error if the folder exists?  When loading, you would hope that the folder does exist.  So your error cases are backwards."
    I'm sorry, I omitted the create folder from the vi, the error of which is connected to the loading cluster vi error out terminal (revised attached).  If the folder does not exist, there is no error, the folder is created, the no error case structure will then create the history.dat file, and insert the cluster with all zeros. 
    You wrote:  "In your save vi, you have to set the operation input to open/create/replace to "replace or create".  The first time you write, the datalog will be created and the data will be written."
    I was planning on the load cluster vi (no errror case) to create the file.   I then wanted the cluster to be created and written to the file. 
    I tried using the save cluster vi to create or replace the cluster, and it worked like you said.  I then loaded the cluster, but my path was wrong.  After that was fixed, it worked. 
    Thanks for your help.
    metzler CLAD
    Attachments:
    working loading cluster.vi ‏17 KB

  • Creating Load and Save methods to save to a DOT file.

    I have to create methods to save to a file and load to a file but I am not sure how to do this. So I was wondering if I could get advice on how to do this, thank you.

    LR's support for video metadata is very incomplete, and it doesn't write out video metadata back to the video file or to XMP sidecars.  Please see and vote on this topic in the official Adobe feedback forum:
    Lightroom: Metadata applied to videos in Lightroom isn't available in other applications

  • Trouble loading and playing certain games on pogo

    certain games such as word whomp, poppit,majhong safari, texas hold em. plus others will not load very frustrating why some will and others wont. my java is up to date also.............

    Update your Flash Player '''v16.0.0.296<br>https://www.adobe.com/products/flashplayer/distribution3.html'''
    '''[https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram Firefox uses too much memory (RAM) - How to fix]'''
    This article describes how to make Firefox use less memory to make it run faster and prevent crashes.
    If you have problems with current Shockwave Flash plugin versions then check this:
    * see if there are updates for your graphics drive drivers
    '''https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration'''
    * disable protected mode in the Flash plugin (Flash 11.3+ on Windows Vista and later)
    '''https://forums.adobe.com/message/4468493#TemporaryWorkaround'''
    * disable hardware acceleration in the Flash plugin
    '''https://forums.adobe.com/thread/891337'''
    See also:
    * '''http://kb.mozillazine.org/Flash#Troubleshooting'''

Maybe you are looking for

  • Error connecting JCO.Client

    Hello! I've got a little problem with Adaptive RFC calls: After exactly 10 times executing my call I always get the following Exception: com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Error connecting using JCO.Client: null H

  • HT1391 how do i authorize my computer for my purchases

    My computer crashed and I had it rebuilt. I am trying to use my itunes purchases but it is asking me to authorize my computer. How do I do this?

  • Build a sql query fro different table and insert into a table

    Hi I have a requirement , i have some table 1 table which holds rules which rules i have to apply on the sql query 2 table will hold table name and column name and transformation with these help of 2 tables i want to build a sql quey and the sql quer

  • Automator error when no files exist to move

    I have a very simple automator script set up in Snow Leopard: Find Video files in "Downloads" folder that are larger than 50 MB Move those files to the "Files to Convert" folder The script works perfectly when there are video files in the folder to c

  • Android: Textfield-Cursor movement not working in Portrait

    Hi, I just deployed a new build of my Android apps with Air 16.0.0.272 and I noticed that while Portrait mode, I am unable to move the cursor in an Input Textfield with text by tapping at the location. Instead the cursor will pop up before the first