Preloader and linkage problem

I am using the preloader below on swfs being loaded to the
main movie. The preloader didn't show until I delinked some jpgs in
the swf to be loaded. Then the preloader worked fine. But on going
to frame 2 "start" I have actionscript that creates a menu using
jpgs. And now since they are not exported in the first frame can't
be found. How does one get both the preloader to work and the jpgs
or other assets that need to be link in the swf to work?
Thanks.
Preloader code:
stop();
onEnterFrame = function() {
framesLoaded = (Math.ceil ((_parent.getBytesLoaded() /
_parent.getBytesTotal()) * 100));
gotoAndStop (framesLoaded);
info_txt.text = framesLoaded + "% completed";
if (framesLoaded >= 90) {
_parent.gotoAndPlay ("start");

I found a solution where one loads the assets that need to be
attached on frame two as the preloader is stopped running on frame
1 When the movie has loaded the movie is assigned to gotoAndPlay(3)
where the assets are available for use. I don't know if there is a
better method.

Similar Messages

  • Help with Flex preloading and transitions please

    I downloaded and installed Flex Builder 3, and I think I have
    my slideshow project about 75% finished. It's the last 25% that I
    can't figure out, regarding preloading and transitions. Can someone
    take a look at the code below and see if you can help me? I tried
    to write the code in such a way that you can debug it from any
    computer as it's calling an PHP/XML file and images that are on a
    server.
    Here's what's finished...
    1. PHP file looks at image files on server and builds XML
    file.
    2. Flex app calls PHP file and traverses the XML in the
    response.
    3. Flex app figures out how many "slides" there and displays
    the slides one at a time, each slide with 3 images, with a 5 second
    delay between "slides."
    Here's what's not finished...
    1. I would like a fade-out to white at the end of each slide,
    and a fade-in from white at the beginning of each slide.
    2. I need each slide to stay put intil the next slide is
    pre-loaded. That is, during the 5 seconds that a slide is
    displayed, the next 3 images need to be preloaded, and then the
    slide should not progress to the next until slide is completely
    loaded.
    3. The very first slide should not appear until it is
    completely loaded, and when it does appear, it should fade in from
    white.
    How do I do this?!? Please help! Here's the code...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="472" height="195"
    backgroundGradientAlphas="[1.0, 1.0]"
    backgroundGradientColors="[#FFFFFF, #FFFFFF]"
    creationComplete="StartFunction();" >
    <mx:Fade id="fadeOut" duration="2000" alphaFrom="1.0"
    alphaTo="0.0"/>
    <mx:Fade id="fadeIn" duration="2000" alphaFrom="0.0"
    alphaTo="1.0"/>
    <mx:Image id="PhotoA" x="0" y="0" width="154"
    height="195" />
    <mx:Image id="PhotoC" x="318" y="0" width="154"
    height="195" />
    <mx:Image id="PhotoB" x="159" y="0" width="154"
    height="195" />
    <mx:Script>
    <![CDATA[
    private function StartFunction():void {
    var oXML:XML = new XML();
    var sXmlUrl:String = "
    http://www.smis.org/templates/smis/slideshowxml.php";
    var oUrlReq:URLRequest = new URLRequest(sXmlUrl);
    var oUrlLoader:URLLoader = new URLLoader(oUrlReq);
    oUrlLoader.addEventListener("complete", xmlLoaded);
    function xmlLoaded(event:Event):void {
    oXML = XML(oUrlLoader.data);
    var iSlide:int = 0;
    function ChangeImages():void {
    PhotoA.load("
    http://www.smis.org/" +
    oXML.slide[iSlide].photo[0]["@filepath"]);
    PhotoB.load("
    http://www.smis.org/" +
    oXML.slide[iSlide].photo[1]["@filepath"]);
    PhotoC.load("
    http://www.smis.org/" +
    oXML.slide[iSlide].photo[2]["@filepath"]);
    iSlide++;
    if (iSlide >= oXML.children().length())
    iSlide = 0;
    PhotoA.load("
    http://www.smis.org/" +
    oXML.slide[iSlide].photo[0]["@filepath"]);
    PhotoB.load("
    http://www.smis.org/" +
    oXML.slide[iSlide].photo[1]["@filepath"]);
    PhotoC.load("
    http://www.smis.org/" +
    oXML.slide[iSlide].photo[2]["@filepath"]);
    iSlide++;
    if (iSlide >= oXML.children().length())
    iSlide = 0;
    setInterval(ChangeImages,5000);
    ]]>
    </mx:Script>
    </mx:Application>

    What you've done is beyond my capabilities, as of now. But, I
    ran into the same problem with the fading in and out of the photos.
    Here's my solution.
    I defined my fade with only the id and the duration
    parameters. No 'from' and 'to'.
    Then I used the 'showEffect' and 'hideEffect' parameters.
    showEffect="{bannerFade}" hideEffect="{bannerFade}"
    Works like a charm for my project.
    I hope this helps.
    Randy

  • Flex 4 - is it possible to load xml data into the preloader and pass it to the application?

    or is there a similar method to load XML data while the preloader is active, so the XML data will be ready when the main application loads?

    i'm having great difficulty finding any relevant info from the forum and the web about accessing preloader variables from the application.
    is there a way to access the preloader itself from the application?
    It seems logical that the systemManager garbage collects it. If that's the case, how can i access the systemManager from the preloader and possible pass variables to it, then later access them from the application? this seems to be the best direction to tackle this problem. but maybe i'm overlooking another way?

  • Preloader and Sound Object

    My Flash site has a media player which uses the attachSound
    method to play and skip through 3 mp3s. As a result the preloader
    shows up after the movie has loaded 60%. To rectify this, i changed
    the Publish Settings under the Flash Tab so that the classes for AS
    2.0 load in the 2nd frame of the Preloader Scene(I have separated
    the preloader and the main movie to diffrerent scenes..)
    I read it somewhere that to correct a similar problem with
    MCs, you need to place them somewhere in the timeline (say,Off
    Stage), But how can same be done for Sound Objects.???

    if i do that then the preloader works fine,however the player
    doesnt work...since the audio files dont get loaded..

  • Java Audio Metronome | Timing and Speed Problems

    Hi all,
    I’m starting to work on a music/metronome application in Java and I’m running into some problems with the timing and speed.
    For testing purposes I’m trying to play two sine wave tones at the same time at regular intervals, but instead they play in sync for a few beats and then slightly out of sync for a few beats and then back in sync again for a few beats.
    From researching good metronome programming, I found that Thread.sleep() is horrible for timing, so I completely avoided that and went with checking System.nanoTime() to determine when the sounds should play.
    I’m using AudioSystem’s SourceDataLine for my audio player and I’m using a thread for each tone that constantly polls System.nanoTime() in order to determine when the sound should play. I create a new SourceDataLine and delete the previous one each time a sound plays, because the volume fluctuates if I leave the line open and keep playing sounds on the same line. I create the player before polling nanoTime() so that the player is already created and all it has to do is play the sound when it is time.
    In theory this seemed like a good method for getting each sound to play on time, but it’s not working correctly.
    At the moment this is just a simple test in Java, but my goal is to create my app on mobile devices (Android, iOS, Windows Phone, etc)...however my current method isn’t even keeping perfect time on a PC, so I’m worried that certain mobile devices with limited resources will have even more timing problems. I will also be adding more sounds to it to create more complex rhythms, so it needs to be able to handle multiple sounds going simultaneously without sounds lagging.
    Another problem I’m having is that the max tempo is controlled by the length of the tone since the tones don’t overlap each other. I tried adding additional threads so that every tone that played would get its own thread...but that really screwed up the timing, so I took it out. I would like to have a way to overlap the previous sound to allow for much higher tempos.
    I posted this question on StackOverflow where I got one reply and my response back explains why I went this direction instead of preloading a larger buffer (which is what they recommended). In short, I did try the buffer method first, but I want to also update a “beat counter” visual display and there was no way to know when the hardware was actually playing the sounds from the buffer. I mentioned that on StackOverflow and I also asked a couple more questions regarding the buffer method, but I haven’t received any more responses.
    http://stackoverflow.com/questions/24110247/java-audio-metronome-timing-and-speed-problems
    Any help getting these timing and speed issues straightened out would be greatly appreciated! Thanks.
    Here is my code...
    SoundTest.java
    import java.awt.*; 
    import java.awt.event.*; 
    import javax.swing.*; 
    import javax.swing.event.*; 
    import java.io.*; 
    import javax.sound.sampled.*; 
    public class SoundTest implements ActionListener { 
        static SoundTest soundTest; 
        // ENABLE/DISABLE SOUNDS 
        boolean playSound1  = true; 
        boolean playSound2  = true; 
        JFrame mainFrame; 
        JPanel mainContent; 
        JPanel center; 
        JButton buttonPlay; 
        int sampleRate = 44100; 
        long startTime;  
        SourceDataLine line = null;  
        int tickLength; 
        boolean playing = false; 
        SoundElement sound01; 
        SoundElement sound02; 
        public static void main (String[] args) {        
            soundTest = new SoundTest(); 
            SwingUtilities.invokeLater(new Runnable() { public void run() { 
                soundTest.gui_CreateAndShow(); 
        public void gui_CreateAndShow() { 
            gui_FrameAndContentPanel(); 
            gui_AddContent(); 
        public void gui_FrameAndContentPanel() { 
            mainContent = new JPanel(); 
            mainContent.setLayout(new BorderLayout()); 
            mainContent.setPreferredSize(new Dimension(500,500)); 
            mainContent.setOpaque(true); 
            mainFrame = new JFrame("Sound Test");                
            mainFrame.setContentPane(mainContent);               
            mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
            mainFrame.pack(); 
            mainFrame.setVisible(true); 
        public void gui_AddContent() { 
            JPanel center = new JPanel(); 
            center.setOpaque(true); 
            buttonPlay = new JButton("PLAY / STOP"); 
            buttonPlay.setActionCommand("play"); 
            buttonPlay.addActionListener(this); 
            buttonPlay.setPreferredSize(new Dimension(200, 50)); 
            center.add(buttonPlay); 
            mainContent.add(center, BorderLayout.CENTER); 
        public void actionPerformed(ActionEvent e) { 
            if (!playing) { 
                playing = true; 
                if (playSound1) 
                    sound01 = new SoundElement(this, "Sound1", 800, 1); 
                if (playSound2) 
                    sound02 = new SoundElement(this, "Sound2", 1200, 1); 
                startTime = System.nanoTime(); 
                if (playSound1) 
                    new Thread(sound01).start(); 
                if (playSound2) 
                    new Thread(sound02).start(); 
            else { 
                playing = false; 
    SoundElement.java
    import java.io.*; 
    import javax.sound.sampled.*; 
    public class SoundElement implements Runnable { 
        SoundTest soundTest; 
        // TEMPO CHANGE 
        // 750000000=80bpm | 300000000=200bpm | 200000000=300bpm 
        long nsDelay = 750000000; 
        long before; 
        long after; 
        long diff; 
        String name=""; 
        int clickLength = 4100;  
        byte[] audioFile; 
        double clickFrequency; 
        double subdivision; 
        SourceDataLine line = null; 
        long audioFilePlay; 
        public SoundElement(SoundTest soundTestIn, String nameIn, double clickFrequencyIn, double subdivisionIn){ 
            soundTest = soundTestIn; 
            name = nameIn; 
            clickFrequency = clickFrequencyIn; 
            subdivision = subdivisionIn; 
            generateAudioFile(); 
        public void generateAudioFile(){ 
            audioFile = new byte[clickLength * 2]; 
            double temp; 
            short maxSample; 
            int p=0; 
            for (int i = 0; i < audioFile.length;){ 
                temp = Math.sin(2 * Math.PI * p++ / (soundTest.sampleRate/clickFrequency)); 
                maxSample = (short) (temp * Short.MAX_VALUE); 
                audioFile[i++] = (byte) (maxSample & 0x00ff);            
                audioFile[i++] = (byte) ((maxSample & 0xff00) >>> 8); 
        public void run() { 
            createPlayer(); 
            audioFilePlay = soundTest.startTime + nsDelay; 
            while (soundTest.playing){ 
                if (System.nanoTime() >= audioFilePlay){ 
                    play(); 
                    destroyPlayer(); 
                    createPlayer();              
                    audioFilePlay += nsDelay; 
            try { destroyPlayer(); } catch (Exception e) { } 
        public void createPlayer(){ 
            AudioFormat af = new AudioFormat(soundTest.sampleRate, 16, 1, true, false); 
            try { 
                line = AudioSystem.getSourceDataLine(af); 
                line.open(af); 
                line.start(); 
            catch (Exception ex) { ex.printStackTrace(); } 
        public void play(){ 
            line.write(audioFile, 0, audioFile.length); 
        public void destroyPlayer(){ 
            line.drain(); 
            line.close(); 

    Thanks but you have never posted reply s0lutions before ?? And F 4 is definitely not 10 times faster as stated before I upgraded !!

  • Preloader and moviecliploader class

    Hello
    Firstly thanks to kglad for some advice yesterday. More needed
    I am using FlashMX 2004 Professional.
    I have been having problems with my preloader which i have placed as a movieclip at the start of the pertinent scenes where it is needed. The problem has been one of file size in frame one -  a common problem I beieve. This causes the preloader script to malfunction and come in late and show just 100% loaded of the preloader animation - again a common problem I am reading. SO it seems clear having designed the whole website using LoadMovie Number that the movieClipLoaderClass would be the solution to getting my Preloader to work. Hmm..
    So can people tell me that if I now create a seperate scene for the preloader and have it listen for any downloading swf to activate using the moviecliploader class will this work ok in tandem with how I have connected all the other scenes using the loadmovienumber? Just need to now before I start trying that out. My hope is that the Preloader will then overcome the file size issue of the first frame because and it will not have to load itself every time afresh.
    Hope this makes sense, I am fairly inexperienced here...
    Cheers
    Pete

    I know everything about the file, I know that the sound starts on the first frame and also I know it ends on the last frame. If the sound data are on the main timeline, the sound could be streamed and you don't have to load it fully to start playback. The question is the same, how much I need to load to start the sound.
    I think it's not very clear why I need this. Imagine:
    - you need to play the external SWF file
    - you start to load it via the MovieClipLoader class
    - onLoadInit you stop the movie and wait for the load
    - check, if you can run the movie - based on bytes and/or frames you can determine, you preloaded enough, so the movie won't be stopped and you don't have to load more to continue
    - but, when you run the movie, the animation starts, just the sound doesn't, because more of it needs to be loaded.
    - then after short time the sound start to play and since it's streamed and on the timeline, it's sync with the animation
    So, in this scenario a few seconds of the sound are skipped / missing in playback. Of course, it could happen that the sound runs fine, because the SWF content could be different. I can't say 20% of the file size is audio and the rest is the animation.
    I wanted fully flash solution, but it seems I'll have to find it in combination with Java, because it seems there is no way to distinguish between audio and other data in the Flash movie in AS.
    Anyway, thank you for your help.

  • Quicktime Pro, preload and Director Que Points

    Hi All,
    I have just discovered that the latest version of quicktime
    Pro (7x) does not have the prelaod option when exporting a movie.
    If you have markers embedded in your quicktime movie that you want
    to use as que points in Director you can no longer do this as you
    MUST have the preload setting enabled in Quicktime Pro when
    exporting the movie. Director will throw an error when you try to
    import the quicktime file warning you that the file is not
    preloaded and the que point will be disabled for that file.
    Has anyone else upgraded to Quicktime Pro 7?
    The only solution that I can find is to install Quicktime 6x
    BUT I haven't got the installer and Apple do not have it on their
    site, looks that it was money mis-spend when I upgraded to version
    7.
    Does anyone have any ideas?
    Many thanks!
    Andrew
    See
    http://discussions.apple.com/thread.jspa?messageID=5924800
    for the apple snag.

    I faced the same problem one month ago. At the end I decided
    to use flash. It has the possibility to work with cue points in a
    natural way. One solution I explored with Director was to do my own
    cue points controls. Basically, I got a list of my cue points, I
    used the old CoolEdit to define and export the list, then I checked
    the time of the movie in a loop (exitFrame) and I compared the time
    of the movie with the list of CP to trigger the events. But as I
    told you, I decided to use Flash
    Sorry not to be useful
    Good luck

  • Blank screen between preloader and beginning of SWF movie

    I'm having a problem with a published SWF. A long lag time is occurring between the end of my AS3 preloader and the beginning of my SWF movie. Once the preloader disappears, the SWF screen goes blank for up to 10 seconds before the movie begins. I've monitored the SWF's download progress using Firebug, and the preloader disappears once 45% of the SWF has been downloaded, as is to be expected.  But the movie does not begin until most of the SWF has been downloaded, which causes the 10 seconds of blank screen. After reading some blog posts, I suspected that the audio embedded in the Captivate presentation was causing the SWF to download all of the audio before starting the movie. I followed recommendations to add a tiny amount of silence the beginning of each slide, but it hasn't resolved the problem.
    Does anyone know how to fix a long lag time between a preloader and movie? My SWF settings and other details are below. Thanks in advance.
    - Using Captivate 5
    - The presentation has 18 slides.  Each slide has one JPG and one audio clip.  (The audio clips were imported one at a time, instead of importing one large audio file and having Captivate spread it across multiple slides.)
    - Each slide is .4 seconds longer than its audio clip, leaving .2 seconds of silence before and after the audio clip. 
    - SWF Size and Quality are set to Low
    - Audio Quality is set to MP3, 64Kbps, 44.100 KHz
    - Using AS3 preloader set to 45%
    - The SWF is hosted on a web server and is viewed via the htm file that is generated when the SWF is published.
    Kim

    Hi Vikranth,
    Thanks for your help.  The online SWF is here:
    http://leo.lincolninst.edu/eTeach/captivate-tests/inside-focus-area/new-opt-img-mp3-chunks -full-2/inside-focus-area-new-opt-img.htm
    I've also posted the same SWF with a 15% preloader here (the smaller the preloader percentage, the longer the blank screen):
    http://leo.lincolninst.edu/eTeach/captivate-tests/inside-focus-area/new-opt-img-mp3-chunks -full-2-15/inside-focus-area-new-opt-img.htm
    I've sent the cptx file to your email address.
    Kim

  • Deleting/hiding a preloader and a button

    Pls help - i have to figure this out before 2pm ESP today. I
    purchased a flash intro template and switched out the text, images,
    etc. for a colleague for an internal presentation. Here's the
    problem: he wanted the intro to run twice - seemlessly - so at the
    end of the first .fla file I changed the 'stop" action to a
    loadMovie action. The problem is the preloader and button that is
    OK when the first .swf file runs is fine but I can't figure out how
    to delete it from the 2nd .swf file. (The company i bought the
    template from said this modification is out of their realm...) I'm
    desparate now... The .fla files are huge - but I can send a link to
    show what I mean. Thanks,
    Lisa

    I solved it in this way:
    package untitled24;
    import javax.swing.UIManager;
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    public class Application1 extends Frame
       private TextArea tekstgebied;
       private MenuItem ok;
       public Application1()
        MenuBar menubalk = new MenuBar();
        setMenuBar(menubalk);
        Menu hoogste = new Menu("ok");
        menubalk.add(hoogste);
        ok = new MenuItem("test");
        ok.addActionListener(new MenuHandler());
        hoogste.add(ok);
        tekstgebied = new TextArea();
        add(tekstgebied);
        addWindowListener(new WindowAdapter()
          public void windowClosing(WindowEvent e)
            dispose();
            System.exit(0);
        setSize(300,200);
        setTitle("oef 1");
        setVisible(true);
        public static void main(String[] args )
          new Application1();
        public class MenuHandler implements ActionListener
          public void actionPerformed(ActionEvent f)
            FileWriter uit;
            String inhoud;
            inhoud = tekstgebied.getText();
            try
              uit = new FileWriter("bestand.txt");
              uit.write(inhoud);
              uit.close();
            catch (IOException e)
              System.out.println("Fout bij het openen, maken of sluiten bestand");
              e.printStackTrace();
      }

  • I am not able to launch FF everytime i tr to open it, it says FF has to submit a crash report, i even tried doing that and the report was submitted too, but stiil FF did not start, and the problem still persists, please help me solve this issue in English

    Question
    I am not able to launch FF everytime i try to open it, it says FF has to submit a crash report,and restore yr tabs. I even tried doing that and the report was submitted too, but still FF did not start, and the problem still persists, please help me solve this issue
    '''(in English)'''

    Hi Danny,
    Per my understanding that you can't get the expect result by using the expression "=Count(Fields!TICKET_STATUS.Value=4) " to count the the TICKET_STATUS which value is 4, the result will returns the count of all the TICKET_STATUS values(206)
    but not 180, right?
    I have tested on my local environment and can reproduce the issue, the issue caused by you are using the count() function in the incorrect way, please modify the expression as below and have a test:
    =COUNT(IIF(Fields!TICKET_STATUS.Value=4 ,1,Nothing))
    or
    =SUM(IIF(Fields!TICKET_STATUS=4,1,0))
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • BOSD, Battery issues and Heating problem after iOS 8 upgrade

    i have upgraded my iPad mini to iOS 8. Ever since I upgraded to iOS 8 am facing blue screen issues and heating problem as well. This is really frustrating even the patch iOS 8.0.2 dint solve the problem. Are you guys listening our complaints. When will you fixing it.

    The same thing happened to me on my 2012 Subaru Outback.  I'm not sure this will help you since you have a Honda, but I'm posting this just in case.
    I paired the audio on my car with my iPhone 6.  However, when I turned the car off and back on again, the iPhone would not pair automatically.  I had to manually connect the iPhone with the car.  Turns out there are two separate bluetooth pairings on my car: one for phone which allows up to 5 devices and one for audio which allows only one device.  So I did the second bluetooth pairing for the phone (had already done the audio), and that fixed it.  YMMV

  • I am making code to try to make a game and my problem is that my code......

    I am making code to try to make a game and my problem is that my code
    will not let it change the hit everytime so im getting the first guy to hit 1 then next hits 8 and so on and always repeats.
    Another problem is that I would like it to attack with out me telling it how much times to attack. I am using Object oriented programming.
    Here is the code for my objects:
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class rockCrab {
         //Wounding formula
         double sL = 70;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 50;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         rockCrab() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              double done = rint(fH - fA);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("Rockcrab hit" +done);
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class self {
         //Wounding formula
         double sL = 1;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 1;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         self() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("You hit" +done);
    }Here is the main code that writes what the objects do:
    class fight {
         public static void main(String[] args) {
              self instance1 = new self();
              rockCrab instance2 = new rockCrab();
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
    }when the code is run it says something like this:
    you hit 1
    RockCrabs health is 9
    RockCrab hit 7
    your health is 38
    you hit 1
    RockCrabs health is 8
    RockCrab hit 7
    your health is 31
    you hit 1
    RockCrabs health is 7
    RockCrab hit 7
    your health is 24
    you hit 1
    RockCrabs health is 6
    RockCrab hit 7
    your health is 17
    my point is whatever some one hits it always repeats that
    my expected output would have to be something like
    you hit 1
    RockCrabs health is 9
    RockCrab hit 9
    your health is 37
    you hit 3
    RockCrabs health is 6
    RockCrab hit 4
    your health is 33
    you hit 2
    RockCrabs health is 4
    RockCrab hit 7
    your health is 26
    you hit 3
    RockCrabs health is 1
    RockCrab hit 6
    your health is 20
    Edited by: rade134 on Jun 4, 2009 10:58 AM

    [_Crosspost_|http://forums.sun.com/thread.jspa?threadID=5390217] I'm locking.

  • Remote and IR Problem

    A rather odd and annoying problem has recently been occuring on my MBP. A couple days ago my remote (after working without fail for over a year now) suddenly stopped working. Yesterday night and this morning it started working again but after a while it stopped again. I've read dozens of support articles which haven't really helped because there seems to be another problem.
    Most articles have stated that there is an option to disable the IR receiver in the "security" window under system preferences. When the IR and remote are not working this option disappears but when they are working the option is present. I have also tried replacing the battery without any result.
    I am now thinking that it might have something to do with heat buildup because it is mainly occuring after the laptop has been on for about a half hour, so I am going to try to borrow someone's fan.
    If anyone has any suggestions to solve this I would appreciate it if you could help. Thanks!
    MacBook Pro 1.83 GHz   Mac OS X (10.4.9)  

    check out this thread. Seems to be the same problem.
    http://discussions.apple.com/thread.jspa?messageID=4701905&#4701905

  • LG Ally text message and gps problems

    hello. ive been with verizon for about 10 years maybe. ive been overall happy with the service and customer service. but the prices should be alot lower.lol. i started out with the motorolas then switched to the lg phones. only problem with the motorola was the speakers. not loud enough. could never hear the phone ring. the lgs usually suffer from the same problem.
    i had a few phone problems but nothing like this lg ally. im on my second one and about to be my 3rd one in about 3 months. 1st phone i had every problem under the sun. this phone i am suffering from text message problems and gps problems. i suffer from what everyone else has problems with. the messages wont send. they will eventually lock up. it will show the envelope with the red explanation point ( i think thats the graphic). then usually everytime when i sent a text the texts will close. it will send then bounce back and show up as a draft and i have to resend it and wait for it to go thru. finally the last problem with the texts. when i send a text a phone number from my contacts shows up and freezes on the screen. its in white text with a black background. its the same number every time. it stays on the screen until i restart or pull my battery out.
    gps. when i open up google gps that comes with the phone i make sure the gps is on... when the directions are found and the map pops up 9 out of 10 times it just keeps saying searching for gps. the turn by turn never is found. the 1 time it does it takes a good 10 minutes to be found. atleast on my first one ally the gps did work 8 out of 10 times. it just took a good 5-10 minutes for gps to be found and show turn by turn.
    anyone else have these problems? where you able to fix them or did you need to get a new phone? the 2.1 update was supposed to fix problems. i think they just made it worse. the ally is supposed to have 2.2 froyo. where is it. is it ever going to get it. i got this phone because i like the lgs and the keyboard. also the sales representative on the phone was giving the lg ally rave reviews. why couldnt he say dont buy this go with a motorola droid. this phone is the biggest junk ever made

    I do apologize you are having trouble with your device I looked in our information system on the LG Ally in reguards to issues you are having it states if you have the Free Droid Security anti virus protection application down loaded it will cause the phone to lock up or freeze. Check and make sure you do not have the application on your device. Check you GPS settings and make sure correct. Go to Settings; Location & Security; make sure GPS is on wireless network. If this does not fix issue you can try doing a Master Reset on your device. Make sure your contacts are saved in your G-mail account or through Back Up Assistance.
    Master Reset/Soft Reset:
    Factory Reset option 1
    From the main screen, touch menu tab
    Touch Settings
    Touch Privacy
    Touch Factory Data reset
    Touch Reset Phone
    Warning: This will erase all data from your phone, including:
    Your Google account
    System and application data and settings
    Downloaded Applications
    It will not erase: Current System software and bundled applications; SD Card files, such as music or Photos
    Factory Reset option 2  - Warning this will reset device back to original factory settings.
    Turn off the phone
    Press and hold "home" + "end" + "volume up or down" keys together for a few seconds when the device is power off
    Once device displays boot information, release keys.
    Soft Reset
    Press the Power key.
    Touch Power off.
    Touch OK.
    Press the Power key to power on the device.
    or
    Remove battery cover, remove battery and reinstall.Also there is a new update for LG Ally it will be the Froyo 2.2 but there is not release date available at this time it will post on your device when available. Hope this Helps. Leslie

  • I am deleting files through my trash in my macbook pro (2010) and then emptying the trash can, but my hard disk space is not increasing! i recently upgraded to lion and the problem is new, wasn't the same with snow leopard! HELP!!!!!

    i am deleting files through my trash in my macbook pro (2010) and then emptying the trash can, but my hard disk space is not increasing! i recently upgraded to lion and the problem is new, wasn't the same with snow leopard! HELP!!!!!
    When i press command+I (Get Info) i see that there is 140 GB "Available Space" on my hard disk but when i click on my hard disk icon on the desktop, and then press "space" i only see 102 GB free!! What the f*???
    Please HELP!!!!!! Getting second thoughts on Lion!!!!

    Hi b,
    Have you restarted yet?

Maybe you are looking for

  • Addindex get errors

    Hi, When I tried to addindex to a container, I get some errors below: page 0: illegal page type or format PANIC: Invalid argument PANIC: fatal region error detected; run recovery */root/dbxml/addindex.sh:7: addIndex failed, Error: DB_RUNRECOVERY: Fat

  • CS4 Design Premium on a new iMac with Yosemite

    I am having trouble installing CS4 Design Premium from the original disks on a new iMac with Yosemite. It keeps going to an upgrade request and won't accept my serial number. Any ideas on what I am doing wrong?

  • Photoshop Converted My Layers into a Smart Object. Now I can't edit.

    I created a multi-layered psd in Photoshop CC that had a combo of vectors and images. When I went back into the psd, all it has is one smart object. I don't ever remember converting the layers to a smart object. And now, when I try to edit the smart

  • CD/DVD Direct Printing

    From what I can establish from the Product Specifications and Retailer's 'experts' the Photojet 6510 Printer does not support direct printing onto CD/DVD Disks. Is this true? Can anyone recommend a suitable HP printer for home use that does support d

  • Classic PCA fields in New PCA

    Hi experts, Currently we are in the midst of rolling out NewGL project for the customer who is on classic PCA now. In the NewGL, we are going to activate the document splitting for Profit center and segments. Functionality point of view, the client i