AP Comp Sci problem

Hi, I'm kind of a beginner to java, and i'm in comp sci 2. I'm looking for an answer to one of the questions that I got for my project. I think that it is just that I don't really understand all of the terminology related to the code. I have only been trained in basic java, and some of the things are a bit over my head...
The given code:
public class A {
private int i;
public A(int n) {
i=n;
public void methodA() {
System.out.println(i);
public class B extends A {
public B(int n) {
super(n);
public void methodA() {
System.out.println(i/2);
public void methodB() {
System.out.println("hello");
public class C {
A aRef;
A bRef;
void methodC1() {
System.out.println("hello again");
public void methodC2() {
The problem states:
"Write a sub-class of C called E. This class should have a constructor that accepts a reference of type A and assigns A to aRef, and a method called justTesting() which invokes method B() from aRef if it is an instance of class B."
I think I should basically start out with:
public class E extends C {
public E(...something...) {
aRef = new A();
public void justTesting() {
if (aRef instanceof B) {
B.methodB();
I'm not really sure about much of it, or whether i'm on the right track or completely off. But thanks for reading, and if you have a hint or correction that I could make, please keep in touch!

When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.
Resources for Beginners
Sun's basic Java tutorial
Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's Thinking in Java (Available online.)
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java. This one has been getting a lot of very positive comments lately.

Similar Messages

  • My comp with Windows7 doesn´t recognise iPhone 5c. I reinstalled USB drivers,iTunes,restarted both devices but without positive result. iPad is recognised on the same comp without problems. Could me somebody help?

    My comp with Windows7 doesn´t recognise iPhone 5c. I reinstalled USB drivers,iTunes,restarted both devices but without positive result. iPad is recognised on the same comp without problems. Could me somebody help?

    Hi there tsubert,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    -Griff W. 

  • Could you help out a comp-sci student from Germany?

    Dear
    database experts,
    my name is Anna and I’m a
    comp-sci student from Germany, currently in the process of writing my Bachelor’s Thesis on the use of mobile devices for monitoring and administrating RDBMS. I’m conducting a survey among database experts to get a better feel for what DBAs are already using
    today, what they’d like to use in the future and what devices and operating systems are most revalent among DBAs.
    If you are currently a DBA,
    I would be absolutely thrilled if you could spare 5 minutes to complete the following survey!
    https://docs.google.com/forms/d/1Q2d5cfLvD4TvCa979Sho1ro8seYll_AxA7W1pX1aUgk/viewform
    The survey
    is of course completely anonymous!
    Many thanks in advance and
    warm regards, 
    Anna

    Helping isn't writing it for you.
    Change what you think needs changing. Test it.
    If you get stuck, post a proper question, not a requirement.

  • Suggestion of a topic for masters project from the Comp sci point of view

    I want to decide a topic for my masters project. Preferably dont want to use any hardware. Can i simulate an engine simulator without any hardware.

    Simulating a simulator. Yes, that sounds like a very theoretical topic ;-)
    But seriously, LabVIEW is a great environment for simulation. NI even has a simulation toolkit for simulating control systems.

  • The dreaded 3F0, "hard disk not exist" problem

    Okay, I have a degree in EE with a minor in comp sci.  I understand how bios' work, etc.  This is why the "answers" HP "tech support" gave me make absolutely no sense.   Could someone please shed some light on this bizarre problem?   I am trying to install a BRAND NEW, WORKING hard drive in a DV7-6163 and the laptop refuses to recognize the existence of the SATA drive.   I have tried this drive in another laptop and IT WORKS,  I have tried other working hard drives in this machine and they DO NOT work.   I have checked to make sure the SATA cable was good....yes!    I went as far as to switch the connector from the DVD drive to the SATA port that was meant for the hard drive.   Guess what,  IT WORKS and the laptop thinks there is a hard drive installed (it even runs the hd diag.. no more "hard disk not exist" error!!)  SO I now know that that actual hardware port is able to communicate with a SATA device.  HP has been LESS THAN HELPFUL as they insist it must be a bad drive or bad main board (even after I explained my various tests demonstrate that it cannot be (why does the port that refuses to recognize the hard drive talk fine to the DVD drive??).   So the only thing left is either a corrupted bios, or a major firmware issue with the code.    Could someone please point me in the right direction?   This was a very expensive laptop and I am ready to throw it through a window!!

    Could you provide a link to the UEFI diagnostics utility?  I tried to google it, but there are so many hits, it makes it confusing to know which one!    Are you saying that the UEFI diag dos utility can bypass the bios functions?  HP blatently LIES about the ability to access the advanced bios settings!   How do I know?  I have the Insyde H20 EzH20 tool.   For some reason i cannot get it to work with my dv7 bios (it is RSA signed), but it works fine on my DV6 bios and allows you to access a plethora of advanced settings!   Namely the SATA mode which I sorely need access to.     How HP justifies not allowing a customer access to settings on property we own is beyond me.   Of course the impetus must be they want to be able to charge us to change a simple setting.    I will NEVER buy HP again!  Twenty years ago they were a respectable brand.   Today, they are all about squeezing every drop of blood from the customer!

  • Strange noise problem with music layer after replacing the music file using script in CS6

    Hey guys,
    I got a strange problem. Sometime when I import a music file, or replace a music footage with another music file using the "replace()" or "importFile()" method, the music layer added one second noise at the beginning. like this,
    Does anyone know what's going on here?
    I'm using After Effects CS6 windows Server 2008 64bit.
    Thanks in advance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi Myleniu,
    Thanks for your replay. Actually, it doesn't matter what makes up my comp, this problem just randomly happen when I render any comp. For example, I have a comp named "noise", I run a script to replace the music then render it, I use a "for" loop to do this 5 times and the music noise problem just happen one time.
    I'm starting to think that win server might be the problem.

  • Backgound problem Acrobat standard. 8.0

    I have a scaling problem with acrobat background.
    If I convert a letter from word or excel into PDF or use an external PDF and I want to set my background behind that document.
    The background is placed bigger behind it then when I open the background in pdf.
    What should I change in the settings to have it fit as 100% behind my document.
    I had this problem before and it got corrected automatically after a few weeks.
    But since I reinstalled my comp the problem was there again.
    Greetings Pieter

    I don;t know what UAC is, so not sure if it enabled or not. perhaps you can tell me how to check?
    This acrobat 8.0 upgrade was downloaded from adobe, i don't have the CD to work off of. When the file d/l it came in a compressed format and needs to be opened in order to access the setup or install command. I cannot get the files to decompress into a destination folder. I expect it is a windows settings issue. But not knowing VISTA at all, i am at a loss to know how to fix it.

  • Can't apply transitions to After Effects comps in Premiere Pro

    Hi people, newbie Premiere user here (my boss is trying to convert me from FCS) :-)  I downloaded the trial version of CS5 and want to learn as much as I can before my initial 30 days is up.  My initial experience has been pleasant, but I've come up against an obsticle I could sure use some help with.
    1)     Creating my timeline with serveral clips
    2)     Exporting certain clips to After Effects; 'Replace with After Effects composition'
    3)     Adding my effects
    4)     Back in Premiere Pro my clip is replaced by the comp.
    5)     Try to apply a simple cross-dissolve across 'Comp 01/Comp 02'
    PROBLEM!
    Seems the transition will only snap to the start of the second comp.  With clips I can drag & drop the effect to span the clips and get perfect results, but not on an After Effects comp.
    6)     In Premiere Pro 'Effect controls' change parameter so that the transition centre is at 'cut'
    The result indeed spans the clips, but the effect quality is terrible - decent fade from comp 01 to a sudden dip to black before fade-up on comp 02.
    Yes, I understand the 'Layers' concept, but I'm not asking the software to do anything nonsensical, just a simple cross-fade across 2 comps.
    I really would appreciate any advice anyone can offer, I'd really like to be converted (mainly because if I AM my boss has promised to buy me a licence when my 30 days are up!) :-)
    All the best
    Steve

    To expand a bit on Colin's comments, back in the film days, the concept of Handles was easy to grasp, as the pieces of film were on an A and a B Roll, and the editor had to physically overlap them by the desired amount, so that the lab could print with a Dissolve. The same held for the days of A-B Roll digital editing, where the Clips were again physically overlapped on separate Tracks. Then, digital editors were developed that allowed one to edit with the Clips on a single Track, and where Transitions were applied between them. The Handles were necessary still, but were no longer visually obvious.
    These images will tell you a bit more about the concept:
    Hope that this helps,
    Hunt

  • Postfix Expressions Problem

    I wrote a program for my AP Comp Sci A class that takes a postfix expression (e.g. 32+) and converts it into an infix expression (e.g. 3+2) and then solves it. It worked before I converted it into the 'solve' method, but now I did (because its required), it keeps giving me an EmptyStackException on the line "if(comparingyay.compareTo("+")==0)
                         stk.push(stk.pop()+stk.pop());"
    If anyone can help me debug this, I would be forever greatful.
    import java.util.*;
       import java.io.*;
        public class PostfixExpressions                                                                                                                             
           public static void main(String[] args)
             Scanner scan=new Scanner(System.in);
             String in=scan.next();
             int answer=solve(in);
             System.out.println(answer);
           public static int solve(String y)
             Stack<Integer> stk= new Stack<Integer>();
             for(int x=0;x<y.length();x++)
                char chars1=y.charAt(x);
                if(Character.isLetterOrDigit(chars1))
                   Integer ints=new Integer(0);
                   stk.push(ints.valueOf(y.substring(x,x+1)));
                String comparingyay=y.substring(x,x+1);
                if(comparingyay.compareTo("+")==0||comparingyay.compareTo("-")==0||
                   comparingyay.compareTo("*")==0||comparingyay.compareTo("/")==0)
                   if(!stk.isEmpty())
                      if(comparingyay.compareTo("+")==0)
                         stk.push(stk.pop()+stk.pop());
                      else if(comparingyay.compareTo("-")==0)      
                         int b=stk.pop();
                         int a=stk.pop();
                         stk.push(a-b);
                      else if(comparingyay.compareTo("/")==0)
                         int b=stk.pop();
                         int a=stk.pop();
                         stk.push(a/b);
                      else if(comparingyay.compareTo("*")==0)
                         stk.push(stk.pop()*stk.pop());
             return stk.pop();
       }

    You don't check for the number of elements in your stack, you just check whether it's empty and, if not, pop 2 elements (though it might be only 1) off it.
    Your program looks rather C-ish; equality checking on Strings is done via equals(), compareTo() is, uhm, unconventional. Though you don't need to check Strings at all while you have chars1.
    The Integer conversion part could be done this way:
    stk.push(new Integer(chars1 - '0'));Edit: apart from these comments, your program works for me with the input "32+".

  • JTabbedPane problem! its urgetnt

    this is the tabbedpanel i wanted to create but has some problem..
    the connected panels dont show their content.
    the tabbed panel shows but the linked panels dont.
    wats the prob wid it!!
    public class tabbedpane extends JApplet
    public void init()
    JTabbedPane jtp=new JTabbedPane();
    jtp.addTab("searchbook",new searchbook());
    jtp.addTab("searchmember",new searchmember());
    getContentPane().add(jtp);
    class searchbook extends JPanel
    public searchbook()
    setLayout(null);
    JTextfield txt1=new JTextField();
    setBounds(40,40,120,20);
    add(txt1);
    JRadioButton rb1=new JRadioButton("by name");
    setBounds(40,60,60,20);
    add(rb1);
    JRadioButton rb2=new JRadioButton("by author");
    setBounds(40,80,60,20);
    add(rb2);
    class searchmember extends JPanel
    public searchmember()
    setLayout(null);
    JTextfield txt2=new JTextField();
    setBounds(40,40,120,20);
    add(txt2);
    JRadioButton rb1=new JRadioButton("by id");
    setBounds(40,60,60,20);
    add(rb1);
    JRadioButton rb2=new JRadioButton("by name");
    setBounds(40,80,60,20);
    add(rb2);
    plz help!!!very urgent......

    take a look at the constructors of the classes searchbook and searchmember
    when basicaly you have multipls of following code
    Component comp = someComponent();
    setBounds(blah, blah, blah...);
    add(comp);the problem is in the set bounds call you are setting the bounds of the container not the component so the code should be corrected as
    Component comp = someComponent();
    comp.setBounds(blah, blah, blah...);
    add(comp);And please use code tags when you post codes. It is very deficult to read the code without them fortunetly for you I was in a strange mode so I read your code and that will not happen next time

  • Advice Needed for Coding FCP Plugin's

    This will be my first attempt at coding anything for FCP and I am hoping to get some advice on how to proceed and where I can get technical information.
    Project 1: Create a plugin to add a selection to the Canvas/Viewer Overlay windows - just under "Show TimeCode Overlays", or there abouts. The option will allow the visual display of the embedded DV Date/Time stamp on the tape, in the same fashion as Time-code is overlaid. As far as I have been able to find, this plugin does not exist yet, so I thought I would give it a shot.
    Project 2: Create a plugin to enhance "DV Start/Stop Detect" to label markers with the embedded DV Date/Time code. i.e. Instead of "Segment 1" the marker would be labeled "20070131 19:15:45", assuming of course, a valid date/time existed, otherwise default back to "Segment xx".
    But, I guess my first question would be, would these be "legal" projects to pursue. i.e. Is there an API to modify the functionality of FCP in this manner?
    I know the DT is available as CatDV has no problem reading it, so I figure FCP should be able to as well.
    I figure I will need:
    1. Info on how the DT is encoded (hex) in the stream
    2. FCP API info
    3. Editing app to put the code together.
    4. Forums that deal with Mac and FCP coding discussions.
    5. Any other advice ANY ONE would like to give.
    I have a BSc in Comp Sci and coded on the Main Frame for 15 years, so I have "basic" coding skills, but I have not coded on the Mac yet. I have registered for the FREE Developer Account, but haven't had a chance to explored the service yet.
    Any help or suggestions would be greatly appreciated!
    ASIDE: I have been editing in FCP since v1 and I shoot events with multiple cameras, sometimes hiring additional cameramen (with their own gear). Because, the events I shoot are usually live "one-of" events like weddings, sports... etc, there is a lot of ON/OFF recording. As such, I find the best way to sync up tapes is to match up Date/Time codes. I accomplish this by playing back the captured video through Firewire back to a Panasonic PV-GS400 which displays the DT on the pop-out display. I then MANUALLY update the previously created "DV Start/Stop Detect" segments with the appropriate DT.
    This is a very time consuming process, and if I can get FCP to display the DT directly, it would knock hours off my work flow.
    I hope this all makes sense.
    FYI I will also be posting this in the 2-pop forums, so if I get any advice there, I will update my post here.
    TIA
    Gary

    Hi Gary
    Regarding both your proposed projects afaik there is no API to directly allow you to do this.
    However a few options spring to mind: analyzing midi control /mackie control data as provided to a control surface (check out Digital Heaven's BigTime for an idea of how this could work); similarly you could create a virtual DV output device that would appear in the external video outputs list whereby the output video stream would be passed through your code to extract and display the info; perhaps simplest although the least dynamic would be simply to write an FxPlug filter that could be dropped on the clip ... the user could then populate the filter with static display data by manually scavenging the clip for the info with a "button" in your filter (see the options dialog example in the FxPlug SDK)
    Good luck
    Andy

  • I'm new and I REALLY need help

    Hi, my name is Chris, I'm new to java.sun.com and I'm a beginner programmer seeking a degree in Comp Sci. I've been writing some code and I've stumbled on some problems that I can't troubleshoot, (run-time?) error seems to be way over my head, the program should work, i don't know why not? Can someone please please give me a clue as to what's going on?
    Here's the program;
    I have to greate a Coins class that will define the different coins (dime, nickelsk, etc.) that will be used in the main .java file. The main .java file has to randomly generate some "change" and sort it out in the least amount of coins possible.
    The problem:
    There are no compilation errors; however, when I run the program I receive this run-time error:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at cs130project3.Project3.paint(Project3.java:48)
         at sun.awt.RepaintArea.paint(RepaintArea.java:298)
         at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)
         at java.awt.Component.dispatchEventImpl(Component.java:2663)
         at java.awt.Container.dispatchEventImpl(Container.java:1213)
         at java.awt.Component.dispatchEvent(Component.java:2497)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    What does this mean?
    Some things I've tried are sticking a g.drawOval() into the paint method, it works just fine, so i assumed there must a problem passing the g object into the coins.draw(g) method, is there a file placement problem or an object passing problem? I'm using Borland JBuilder 7 and i'm assuming that it places the files in the right location, its all in a package called cs130Project3.
    Here is the code:
    Coins class:
    import java.awt.*;
    public class Coins {
    private final int DIAMETER = 30;
    private int coinsAmount = 0;
    private String coinsType = "";
    private int coinsPosX = 0;
    private int coinsPosY = 0;
    public Coins(int coinAmount, String coinType, int coinPosX, int coinPosY) {
    coinsAmount = coinAmount;
    coinsType = coinType;
    coinsPosX = coinPosX;
    coinsPosY = coinPosY;
    public void draw(Graphics screen){
    for(int i = 0; i < coinsAmount; i++)
    screen.drawOval(coinsPosX,coinsPosY,DIAMETER,DIAMETER);
    coinsPosX += 5;
    coinsPosY += 5;
    if(i == (coinsAmount - 1))
    screen.drawString(coinsType,(coinsPosX+10),(coinsPosY+10));
    Here is the main class:
    import java.awt.*;
    import java.util.Random;
    import java.applet.Applet;
    public class Project3 extends Applet {
    private Coins Pennies, Nickels, Dimes, Quarters;
    public void init() {
    int randomChange = 0;
    int numPenny = 0, numNickel = 0, numDime = 0, numQuarter = 0;
    String Penny = "1c", Nickel = "5c", Dime = "10c", Quarter = "25c";
    Random generator = new Random();
    randomChange = generator.nextInt(100);
    while(randomChange > 0)
    while(randomChange >=1)
    while(randomChange >= 5)
    while(randomChange >= 10)
    while(randomChange >= 25)
    numQuarter++;
    randomChange -= 25;
    if(randomChange >= 10)
    numDime++;
    randomChange -= 10;
    if(randomChange >= 5)
    numNickel++;
    randomChange -= 5;
    if(randomChange >= 1)
    numPenny++;
    randomChange -= 1;
    } // End while loop
    Coins Pennies = new Coins(numPenny,Penny,10,10);
    Coins Nickels = new Coins(numNickel,Nickel,100,10);
    Coins Dimes = new Coins(numDime,Dime,150,10);
    Coins Quarters = new Coins(numQuarter,Quarter,200, 10);
    public void paint (Graphics g)
    Pennies.draw(g);
    Nickels.draw(g);
    Dimes.draw(g);
    Quarters.draw(g);
    help me!!
    Thank you,
    Chris

    Chris, I can't even compile your stuff because you didn't post all your classes (Coin is missing), but the runtime error is telling you a lot:
    java.lang.NullPointerException
    at cs130project3.Project3.paint(Project3.java:48)It says you're dereferencing an object that's null at line 48 of your Project3 class. Turn on line numbering in your text editor, go to line 48, and see what you've missed. One of your objects wasn't initialized. I'll bet you declared a reference type in a class but never initialized it properly in a constructor. The JVM will set those references to null unless you provide a value. - MOD

  • Went from wrt 310n to 610n now i can't get it to connect to the internet.

    Hi, I was wondering if anyone had this problem.  I changed my router from an old linksys wireless G speedboost to the wrt 310n.  The setup disc was wonderful and I had no problems at all.  What surprised me was that the setup disc knew I had a router and guided about changing the router..  Everything went well and I had no problems for a day.  Then I saw the dual band 610n wireless n.  So I took out the wrt 310n and exchanged it for the 610n.  During the setup disc which looked almost similar to the 310n one, I encountered a slight problem.  It states that I don't have an internet connection.  I rebooted everything and still does not work. I'm connected to the network but no internet connection.  My computer gets an IP address of 192.168.1.100.   I checked my username and password because I'm using a PPPOE DSL connection.  I hooked up my modem directly to the computer and I got an internet connectoin. So I did the setup disc.  When it was time to switch to the router, it still does not pick up an internet connection.  Any tips in solving this?  Is my stuff defective?

    Thanks for responding.   I tried that method and it didn't work for me. Also, I need the MTU to be above 1400 for online play.  However, I found this on amazon review about the WRT610N.  http://www.amazon.com/review/product/B001AZ01EO?showViewpoints=1  Seems like everyone is either enjoying this router or having problems with it. 
    This guy says the solution is to change the router's address to 192.168.2.1.  Ok I'm confused, but why does changing the router's address seem to work for some people.  I'm gonna try this when I get home from work later.  But can anyone tell me why changing the router's address may be the answer to get this router to connect to the internet?  Has this solution worked for anyone else that was having the same problem.  Also, why isn't this implemented in wrt610n, but all the router versions before it seems to be fine? (WRT310N, WRTGS, etc.) You would think the wrt610n is almost like the top of the line router you can get for your home that they would have implemented this in the setup disc or the router.  For it being Dual band maybe?  Who knows, this is a mystery to me.
    Solution
    http://www.amazon.com/review/R16YOJTVKHJI15/ref=cm_cr_pr_cmt?%5Fencoding=UTF8&ASIN=B001AZ01EO&nodeID...
    I also found this answer in the linksys docs as well under step #2.  Almost makes the setup disc useless to me.
    http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=3687&lid=7783210227B...
    Not too sure why that would work.  I'm kinda embarassed to ask this since I graduated in networks and security of a Comp Sci degree. .  Hope my teacher isn't reading this.

  • Help with shared objects...again...

    Okay, I've been looking at a really good tutorial for shared objects in AS2, and I think I've gotten the basic concept down of how they work... now the problem lies in just integrating it into what I already have, which is making my brain hurt.  Basically its for a quiz game, which will have a dynamic scoreboard.  I want the scores in the shared object to update when the submit button is pressed, and then have the new values loaded into text boxes.  Displaying the values is going to be the easy part, its just updating them is what my brain doesnt want to wrap itself around.  Here is the array I have at the moment (yes, horribly inefficient, but the last time I actually did any coding before this was over 2 years ago when I was still a computer science major... with all of 4 actual Comp Sci courses under my belt -_-)
    scores= new Array();
    names= new Array();
    insert=function() {
         var newscore;
         var newname;
         newscore=0
         newscore=_global.correct;
         if (newscore > scores[0]) {
             scores[14]=scores[13];
             scores[13]=scores[12];
             scores[12]=scores[11];
             scores[11]=scores[10];
             scores[10]=scores[9];
             scores[9]=scores[8];
             scores[8]=scores[7];
             scores[7]=scores[6];
             scores[6]=scores[5];
             scores[5]=scores[4];
             scores[4]=scores[3];
             scores[3]=scores[2];
             scores[2]=scores[1];
             scores[1]=scores[0];
             scores[0]=newscore;
             names[14]=names[13];
             names[13]=names[12];
             names[12]=names[11];
             names[11]=names[10];
             names[10]=names[9];
             names[9]=names[8];
             names[8]=names[7];
             names[7]=names[6];
             names[6]=names[5];
             names[5]=names[4];
             names[4]=names[3];
             names[3]=names[2];
             names[2]=names[1];
             names[1]=names[0];
             names[0]=newname;
             else if (newscore > scores[1]) {
             scores[14]=scores[13];
             scores[13]=scores[12];
             scores[12]=scores[11];
             scores[11]=scores[10];
             scores[10]=scores[9];
             scores[9]=scores[8];
             scores[8]=scores[7];
             scores[7]=scores[6];
             scores[6]=scores[5];
             scores[5]=scores[4];
             scores[4]=scores[3];
             scores[3]=scores[2];
             scores[2]=scores[1];
             scores[1]=newscore
             names[14]=names[13];
             names[13]=names[12];
             names[12]=names[11];
             names[11]=names[10];
             names[10]=names[9];
             names[9]=names[8];
             names[8]=names[7];
             names[7]=names[6];
             names[6]=names[5];
             names[5]=names[4];
             names[4]=names[3];
             names[3]=names[2];
             names[2]=names[1];
             names[1]=newname;
    Continues all the way down to scores[14]
    Now, if I wanted this to pull data from the shared object, would I just put user_so.score[3]=user_so.score[2] for instance?  Or would I run the array and just update the new valued individually once the array insertion function completes?  THe problem with the latter is that it's not directly accessing the shared object so I'd need to find a way to pull them out into other variables first, and this is about the point where my brain just decides to short out on me and stop working alltogether...yay...
    So yea, any help on this would be much appreciated.
    also, would the array have to be declared within the shared object as well?  If so, how would I do that exactly?  Probably something so simple but the fact that it's shared objects is throwing me off...

    Ok, the shared object WAS working just fine until I had the banner start referencing it.  Then the quiz began giving me syntax errors like crazy, and even when the banner isnt runnit it gives me issues.
    user_so.data.soArray[0]=scores[0];
    user_so.data.soArray[1]=scores[1];
    user_so.data.soArray[2]=scores[2];
    user_so.data.soArray[3]=scores[3];
    user_so.data.soArray[4]=scores[4];
    user_so.data.soArray[5]=scores[5];
    user_so.data.soArray[6]=scores[6];
    user_so.data.soArray[7]=scores[7];
    user_so.data.soArray[8]=scores[8];
    user_so.data.soArray[9]=scores[9];
    user_so.data.soArray[10]=scores[10];
    user_so.data.soArray[11]=scores[11];
    user_so.data.soArray[12]=scores12];
    user_so.data.soArray[13]=scores[13];
    user_so.data.soArray[14]=scores[14];
        _global.player= "Input Name";
        player.text=_global.player;
        _global.correct= 0;
        phrase=" ";
    gotoAndStop (1);
    these are the lines it's telling me I need an on handler for, which I do have, at the very start of the entire code.
    Ive counted the brackets and those seem to line up, but I'll double check again.  The code is on the submit button itself (yes I know it's poor coding form, but this is how I learned it and what I'm used to, and since I'm on a bit of a time schedule now isn't the time to completely re-learn the proper conventions and etiquite of coding in flash).
    on (release) {
        if (user_so.data.tname!=undefined){
            user_so.data.tname = _global.player;
            user_so.data.newscore = _global.correct;
            insert=function() {
        var newscore;
        var newname;
        newscore=0
        newscore=_global.correct;
        if (newscore > scores[0]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=scores[1];
            scores[1]=scores[0];
            scores[0]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=names[1];
            names[1]=names[0];
            names[0]=newname;
            else if (newscore > scores[1]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=scores[1];
            scores[1]=newscore
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=names[1];
            names[1]=newname;
        else if (newscore > scores[2]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=newname;
            else if (newscore > scores[3]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=newname;
            else if (newscore > scores[4]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=newname;
            else if (newscore > scores[5]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=newname;
            else if (newscore > scores[6]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=newname;
                else if (newscore > scores[7]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=newname;
                    else if (newscore > scores[8]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=newname;
                        else if (newscore > scores[9]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=newname;
                            else if (newscore > scores[10]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=newname;
                                else if (newscore > scores[11]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=newname;
                                    else if (newscore > scores[12]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=newname;
                                    else if (newscore > scores[13]) {
            scores[14]=scores[13];
            scores[13]=newscore;
            names[14]=names[13];
            names[13]=newname;
                                        else if (newscore > scores[14]) {
            scores[14]=newscore;
            names[14]=newname;
        else {
            user_so.data.tname = _global.player;
            user_so.data.newscore = _global.correct;
            scores[0]=user_so.data.newscore;
            names[0]=user_so.data.tname;
    user_so.data.soArray[0]=scores[0];
    user_so.data.soArray[1]=scores[1];
    user_so.data.soArray[2]=scores[2];
    user_so.data.soArray[3]=scores[3];
    user_so.data.soArray[4]=scores[4];
    user_so.data.soArray[5]=scores[5];
    user_so.data.soArray[6]=scores[6];
    user_so.data.soArray[7]=scores[7];
    user_so.data.soArray[8]=scores[8];
    user_so.data.soArray[9]=scores[9];
    user_so.data.soArray[10]=scores[10];
    user_so.data.soArray[11]=scores[11];
    user_so.data.soArray[12]=scores12];
    user_so.data.soArray[13]=scores[13];
    user_so.data.soArray[14]=scores[14];
        _global.player= "Input Name";
        player.text=_global.player;
        _global.correct= 0;
        phrase=" ";
    gotoAndStop (1);

  • Motion randomly stopped opening

    I downloaded Motion from the App Store summer of 2011, have upgraded every time it came out and now have 5.0.3, which Apple says is compatible with OS X 10.6.8, which is what I am running. It has worked perfectly for months and then today it suddenly decided not to open. The error message told me to make sure that my current OS was compatible with Motion, which it is, and then displayed the following error message:
    Process:         Motion [5211]
    Path:            /Applications/Motion.app/Contents/MacOS/Motion
    Identifier:      com.apple.motionapp
    Version:         ??? (???)
    Build Info:      Motion-197050125~2
    App Item ID:     434290957
    App External ID: 7274434
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [105]
    Date/Time:       2012-05-09 01:59:00.660 -0400
    OS Version:      Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:          411998 sec
    Crashes Since Last Report:           32
    Per-App Crashes Since Last Report:   31
    Anonymous UUID:                      722B48CE-4C07-4D7D-B018-DF231126993B
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Crashed Thread:  0
    Dyld Error Message:
      Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.6/Python
      Referenced from: /Applications/Motion.app/Contents/MacOS/../Frameworks//Ozone.framework/Versions /A/Ozone
      Reason: no suitable image found.  Did find:
              /System/Library/Frameworks/Python.framework/Versions/2.6/Python: no matching architecture in universal wrapper
              /Library/Frameworks/Python.framework/Versions/2.6/Python: no matching architecture in universal wrapper
              /System/Library/Frameworks/Python.framework/Versions/2.6/Python: no matching architecture in universal wrapper
    Binary Images:
        0x7fff5fc00000 -     0x7fff5fc3bdef  dyld 132.1 (???) <B536F2F1-9DF1-3B6C-1C2C-9075EA219A06> /usr/lib/dyld
    Model: MacBook6,1, BootROM MB61.00C8.B00, 2 processors, Intel Core 2 Duo, 2.26 GHz, 4 GB, SMC 1.51f53
    Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.10.131.42.4)
    Bluetooth: Version 2.4.5f3, 2 service, 12 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: ST95005620AS, 465.76 GB
    Serial ATA Device: HL-DT-ST DVDRW  GS23N
    USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8507, 0x24400000 / 2
    USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0236, 0x04600000 / 2
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x06100000 / 2
    USB Device: Bluetooth Module, 0x05ac  (Apple Inc.), 0x8218, 0x06130000 / 5
    I have restarted my computer, reinstalled Motion I think 6 times now, and uninstalled and reinstalled several versions of Python which seems to be causing the problem. I have tried everything I can possibly think of and still it gives me basically the same error message every time (with slight variations depending on whether or not/where python is installed on my hard drive). I know there were some problems with Ozone in older versions of Motion, but I haven't found any on the discussion board that helped with the current version. Any ideas?

    Problem is fixed, if anyone else should happen to have the same problem, I went back to an old copy of my hard drive backed up on an external and replaced the python frameworks folder on my current hard drive with the old one and it works fine. I guess the updated version of python I had downloaded for my comp/sci class was corrupted.

Maybe you are looking for

  • A Fluid Gallery from MySQL using PHP and various column widths

    I have decided to try the new Fluid Layout option in Dreamweaver. I pull information from a database (MySQL) and use php to present it. To show a gallery, I would pull the info and use the repeater code, and something like Tom Muck's horizontal repea

  • Default form value using sql with bind variable

    I wish to create a form based upon a table with a foreign key. I wish to add a field to the form that is an uneditable text field with a default value using sql of 'select name from other_table where other_table_id = ?' where ? is a bind variable def

  • Gamil contacts Duplicates, Triplicates X4 etc.

    I'm new to the forum but.. I hope this is where I can get some good advice. My iPhone 3gs syncs my google contacts but gives me duplicates/triplicates of my contacts. I searched the web and it seems to be a common problem but the sites that I visited

  • Ideas to manage number of hours of appointments in a week?

    This is a strange request, but I'm looking for something I can use with Apple's Calendar to keep up for me how many appointments or how many hours of appointments I schedule for myself in a week at work, so that I know when I'm reaching a threshold t

  • SAP HCM job pricing

    hello - can any please confirm whether or not you can select multiple jobs within ONE survey and match to ONE internal job? For example - I have a title "manager" at my compant that matches 4 different titles in my vendor survey. I want to be able to