Object move question

Hi.
I think the whole day on this thing: In this example http://www.stanko-b.com/heelbopps/ (project https://www.dropbox.com/s/dr41wme9uqnm0a9/heelbopps4.zip) when you press the "down" button, the screen scrolls down to a particular object.
Сode assigned to the button "down" is:
var element = sym.$("object1");
$('html,body').animate({scrollTop: element.offset().top}, "slow");
My question. How to make itself the "down" button to move to the  "object1"?
In other words, what would I need one object, wherever it was (on click), moved to other objects on the Y axis?
Thank you.

In your Stage > compositionReady event handler, add the following code block just before your yepnope.
If I assume correctly, you will only need one of the arrowDown elements to move when the page scrolls or when the arrow is clicked. In this case I used your 'arrowDown_Products' element; then remove the remaining three since they will no longer be needed.
/////------- Copy Start ---------- //////
$(window).scroll(function(){
       var element = sym.$("arrowDown_products");
             element
            .stop()
            .animate({"marginTop": ($(window).scrollTop() -45) + "px"}, 100 );
/////--------- End Copy --------- ///////
Hope this helps. - I havn't tackled the click event but its going to require some conditional logic to function 100%.
Darrell

Similar Messages

  • Game Object Design Question

    Ok, I have a question on the logical design on my game. The game will consist of a world, levels within the world, items, NPC's, and a Player.
    I will have NPC's wandering around the world automatically. In order to move, they are obviously going to need to be able to look at the level they are on, and figure out where they want to go.
    My question is regarding the acces to the Level object. What is the smartest way to make someNPC.Move(int x, int y) be able to access the Level? Should I write some static methods for the World or Level classes? The only other way I can think of is to pass the World object on to the NPC's upon thier creation and have them store a reference to it...
    Thank you all very much,
    Michael

    My book on Java 1.3 says calling public final methods is fastest (together with calling private methods). public static methods take about twice as long to call but are still pretty fast. Values assume the jit has optimized the method. Calling synchronized methods is very slow. Instead of using synchronized, make sure only one object is making a movement decision at the same time.
    I would coordinate movement using the level objects, because unless objects move to a different level, only objects on the same level influence each other's movement (by standing in the way and for example).
    Every object in your model will have a position, and I assume part of the position information is the level it is on. You have several co-existing levels. In that case I would make the "level" postion information a reference to the level for direct access and I would make the methods the moving objects use public final (or just final if possible).
    Give your objects a reference to the level they are on. If you knew your exact position on the planet but had NO way to know what planet you are on, how would you decide where to move ? It would have to be something like "ok, I don't have any sensory information but I know I exist and I know my exact location. Lets make a step to see what happens. Oh, I still exist. This means I cannot be on the planet where the step would have resulted in a lethal drop. And oh, my position really did change. This helps too. Only 1.000.000.000.000 more planets to exclude by trial and error..."
    But Kayaman is right, the World or level needs to have a reference to each moving object too. You need a list of objects in the same area so the moving objects check for collisions, the level can tell them about environment effects that effect them (to all you moving objects inside me, the death star : You are dead because the rebells have blown up my reactor).

  • Objects move when adding pages

    When I add/remove pages, or just move pages around in my document using the Pages panel, random objects on some pages move. They normally move just a slight amount, and stay with the page, but it is very annoying. I never know which objects will move, and I have to spend a lot of time trying to find the ones that have moved. Then if I move pages again, or add/remove pages, other random objects move. Does anyone else have this problem, or know how to stop it?
    Thanks!

    Try sending one of these files through .idml and see if it makes a difference. See http://forums.adobe.com/thread/526991  You may also want to try replacing the preferences. See http://forums.adobe.com/thread/526990  If you don't know what layout adjustment is, it's not likely that you've turned it on, and it probably wouldn't do this anyway except to move objects snapped to guides on master pages that have different left/right layouts.

  • I see a line when an object moves fast

    Ok, I shoot a Video with My CANON XHA1S AT: 1440 X 1080 30 fps, with the speed of 60. I created a new project as you can see in Capture Shot.
    I don't know why, But I suddenly see a shakey - line when a hand or any object moves close to the camera. Inside my Timeline I Slowed Motion few Tracks to 32%, the rest is at normal speed, When I check the speed for other Tracks it shows 99.9 %.
    Any answer please
    Thanks
    Simon

    Try rendering a small part (and exporting it) of your timeline and preview it. Is the line still there?
    My experience now is that with the hacked Mercury, the preview is not always top notch but rendering is.
    Are you using interlaced video (you seem to be)? If yes, and you are slowing down your footage the shutter speed you used will make a huge difference in your slows. Usually you want it to be double what you normally use. 60 would be the bare minimum. 250 would be great.
    On my XH A1 (not your model) 120 works fine (increasing it to 250 would mean I have lots of light, like outdoors for example). BTW, try the 60i mode. It has *double* the frames, which is great for slows.

  • Docs about RowSet, and Object RowSet questions?

    Docs about RowSet, and Object RowSet questions?
    I can find RowSet forum, so I ask here!
    Can you give me URLs where I can find more about RowSet and URLs for any RowSet implementation?
    Does Borlans, Oracle, IBM, etc., have RowSet implementation?
    I find out about Sun's RowSet implementation, but I can't find Object Rowset in this implementation?
    Is it possible to develop Object RowSet and is it useful?
    I know about O/R tools like Hibernate, but Object RowSet can be useful?
    Run SQL query and get Objects, or maybe even run Object query (like EJB or Hibernate or JDO have) and get Objects.
    No XML mapping mess and simmilar, like with EJB or Hibernate or JDO?

    You can try
    http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    This is a tutorail for RowSet

  • MTS converted to MOV/MP4 start lagging and sometimes appear like waves everytime any object move in video

    Hey there, I want to ask and need your help. I just convert a MTS file to mov. And it suddenly ruin everything in my Macbook Pro. I was convert it to mov, but when I play it back on my Mac/windows, its lag and sometimes the picture like waving everytime any object move in video. And then start from that, all my video file become green screen. But when I play, it works, its not green but lag/waving picture. I tried to put in to my premier pro, and it starts affecting another footage file. After the render, all footages become waving. Do you have any Idea why it happens? I've been doing this for the last 10 months but this is the first time it happens to me and my video.
    example like waving picture for a movement in videoall preview screen become green
    Message was edited by: rizky ramadhan

    I prefer this
    iPad Manager software, with the assistance of iPad Manager, you can make iPhone ringtone, connect your PC to iPad to backup iPad files to Computer directly, import computer file or folder to iPad. 
    Furthermore, it's easy to convert DVD/video to iPad. 
    This versatile iPad Manager can help you transfer videos, songs, photos from computer to iPad and from iPad to PC in fastest speed. Have a try with this tool and manage your iPad, iPod, iPhone in a much easier way. 
    * Convert DVD/video to iPad
    * Backup iPad files to PC
    * Import computer file or folder to iPad 
    iPod Manager
    iPod Video Converter
    DVD to iPhone Converter
    iPod Mate

  • Object movies in dps how?

    i want to add a quicktime object movie to an indesign dps which i want to save as an app or as a magazine   but i cant seem to find out how - i have seen someone talk about it  i think it can be done   but dont have a clue how to do it   can anyone help?

    yo bob  thanks  - ive been making vr panos and obj mov for over 15 years but have no idea how to make one in these codecs - could you help me a litte further and suggest some software that will do it on a mac -  say i have the images to make the obj movie but need something to stick them together maybe ad hotspots etc
    i was also reading some were that you could add a html link to a DPS  which was going to be an ap- which is where i want to go    in other words the aim of adding my obj movie is so that i can save it out as a ap     any help most gratfully recieved !   as garden gnome obj software on saves out to jpeg codec

  • Another "Magic Move" question...

    *Hi there!*
    I'm trying Keynote 09 and all goes fine, except for this *"Magic Move"* thing.
    I can actually "move" one object through both slides, but can't go further than that; if I try to scale it, rotate or everything else that's not just repositioning on x and y axis, all I get is a darkened (and often cropped) image which moves towards the final position and suddenly gets replaced by the modified one at the end of the transition.
    Since I'm on an old hardware and running Tiger, I was wondering if there was some sort of hw limitation for the Magic Move transition +(although the ones for which I know hw limitations do exist are regularly grayed out in their menu and MM is the only one that gives me problems)+.
    I've tried every suggestion I came across in this forum and over the net, but still had no luck +(even thou' I couldn't find anyone else experiencing the same problem)+.
    I've already re-installed the iWorks demo...
    Any hint?
    TIA!
    ale

    Hi, Pesto1.
    Yep, I know... MM is pretty young and Keynote itself is not so much older, after all (and still is WAY better than PPT).
    I must say I'm pretty satisfied with all its feature, even if - me too - I can see all of their potentials and often find myself thinking about improvements more as a +"*Keynote Pro*"+ application build, rather than some actual improvement on Keynote itself
    There are probably too many... people coming from Graphics/DTP have their own, people coming from Flash have others and so do people coming from video-editing.
    (I still didn't get why did Apple cut out QT's capability of reading .swf files, to say one).
    On the other side, if we're using Keynote is because we need something editable by our clients (if it wasn't for that, I think I'd rather go for a Flash presentation); and clients - or intermediate users in general - are pretty rarely skilled enough to deal with _too many_ choices.
    I think Apple's trying to keep Keynote as simple as it can, yet powerful.
    And, indeed, it IS pretty much simpler than PPT, yet way more powerful.
    *Back to the "MM" thing...*
    I know it has some limitation, but - on my side - it's not working *at all*.
    It does move objects, but if I resize (no crop, no template text, no group) or just rotate them, it doesn't work anymore.
    +And by "doesn't work" I mean it randomly crops images/objects, moves them and then suddenly pops them up in their final position; no fading as when "it does nothing".+
    I managed to get a file in which I've seen (on another Mac) MM working as it should, and I experienced the very same issues (on my G4).
    The only thing I can think about at this point is the G4 Graphic Card that is pretty obsolete, and probably MM is one of those "GPU stresser" effects. What makes me doubt about it is that Apple didn't mention it in the iWorks specs.
    And the fact that I couldn't find any other similar complaint on the whole Internet.
    +(I've been googling around so much for this I think this month Google's gonna send me a bill)!!+ :/
    Or maybe is just the fact that no one uses G4s anymore?
    It sounds logical and unacceptable at the same time.
    No one here "magic moving" anything on a G4?
    I'd love to hear some clear words about it, so that I can decide whether to stop looking around or try to improve my search skills.
    As for your issues, maybe there could be some workaround...
    1. If you have to crop your image, probably making a placeholder IN which you resize the image and the placeholder itself through MM, could work.
    +(I can't try this myself 'cause... well, I wouldn't be here if I could)+ :/
    2. I think it's fair you can't move template objects in general +(I also come from DTP, where "Masters pages" and their elements *must not* be editable, unless you badly want to)+. But I think if you just select the text boxes you want to move, making a command-X ("cut") and command-V should "unchain" them from the master slide and make them become brand new objects.
    +EDIT: just tried it and it does work (at least just moving it), even directly on template text boxes. Am I missing something?+
    3. Groups are evolving... Keynote is not enough skilled on groups, yet.
    (I wish I could group many object with different actions/builds applied without losing them forever). Sorry... I have no hint on this.
    As for the slide not accepting different timing that's not a (direct) bug of Keynote, but is the way Keynote imports files from PPT.
    Dunno if it's Keynote to blame or PPT, but somehow I tend to bet on the last one.
    That is a HUGE problem, 'cause I often have to convert PPT presentations made by clients and all of the effects and transitions are stuck in PPT time (which is more than often around 2,00 sec!!).
    You can figure what a "PIA" it is to remove each effect on every object and then re-apply them just to have time control back!
    And I'm talking of hundreds of slide with 3-8 objects per each!
    +(I wish there was a script or something that could read PPT timing format and kinda "translate" it in a Keynote one).+
    Btw... if it's only one or a couple of slide, it's no big deal.
    Select the action or transition you don't get the timing control on, put the action to "none" and then re-apply the same effect/transition.
    You'll have your timing control back.
    +(If i did get what you mean).+
    cià
    ale

  • Creating a Plane On Wich Objects move

    Okay, for my final Computer Science project I am creating a bomberman game. Originally I was going to use the gridworld case study's grid to put everything on, and then we decided not to use it. We are going to use a contious plane and snap bombs, pillars, and enemy paths to central locations while allowing the characters to move freely.
    Here is my question, in the applet is there a way to make a sort of array plane? A set of points on which things can exist and be drawn? Also with user input can just certain sections of the board be redrawn without the entire board being redrawn ever single move? We were thinking about a double buffer but that might slow things down. Yes I know Java is not meant to do video games in, and using DX would be better, but this has to be in Java, and it is a very cool project. I can do everything else. I just need direction in how to make a plane like that in applets? Or would it just be better to place everything, store everything in an array, and just check for collision?

    IntelliSense in a Java Development forum suggests a disconnect.
    Java protocol is set/get prefix for object properties.
    With .NET, it'll be just plain InfoObject.ParentID = <value here>
    But I'm assuming you're not using .NET, since this post is in the Java Development fourm.
    Sincerely,
    Ted Ueda

  • Should I use Embed or Object - quick question...

    Hi all,
    I've got a few .swf files on my site. One of them uses the following code:
    <object style="float:left;" id="intro" name="intro"
    type="application/x-shockwave-flash"
    data="<?php echo $siteurl; ?>/intro_movie/intro.swf" width="300"
    height="188">
    <param name="wmode" value="image" />
    <param name="movie" value="<?php echo $siteurl; ?>/intro_movie/intro.swf" />
    </object>
    Another one uses the following:
    <script type="text/javascript">
    var flashvars = {};
    var params = {};
    var attributes = {};
    swfobject.embedSWF("<?php echo $siteurl;  ?>/swf/testimonials.swf", "_testimonials", "405", "43", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
    </script>
    <div id="_testimonials">
    <a href="http://www.adobe.com/go/getflashplayer" title="Get flashplayer">
    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" width="112" height="33" alt="Get Flashplayer" border="0" />
    </a>
    </div>
    On a computer recently the first example showed up fine but the second example didn't show up at all.
    I just wondered what the correct way to show .swf files is on a webpage.
    I'm very sorry if this is a stupid question but any help you could give me on this would be much appreciated.
    Many thanks
    John Thornley ;-)

    kglad.com
    Thank you for your reply.
    I should clarify that both of those examples are working on my machine. However, on another machine only the top example showed up at the bottom example caused 404 errors as it was trying to load expressInstall.swf which wasn't in the directory.
    This confused me as I wondered if there was any detriment to just having all my swf on my site integrated using the top method?
    I didn't write the bottom example and I don't really understand it fully. I'm not sure whether my best move is to just convert everything to the top example or whether I should try and find a copy of "expressInstall.swf" and try and get the bottom example working on this other machine?
    Which is the correct way?
    Thanks again for your continued support
    Cheers
    John ;-)

  • How to make text/objects move nonlinear speed on AE CC?

    Hi,
    I was wondering two questions:
    1) how to make "text holders" that has small animation. Here is an example from a video http://www.youtube.com/watch?v=5oSWt84VoAg (0:41).
    2) how to move objects with increasing speed and soft slow down. I know how to change speed, but how to make it so that it is only accelerating and slowing down? Same examle can be found from the clip above with the place holders and texts.
    Thank you for your help. If there is same kind of discussion going on please let me know. I could not find it.

    All of what you want to do comes down to the fine art of learning how to magle curves in the graph editor, which is nothing you can learn from just watching totorials. You learn it by doing and collecting experience.
    Mylenium

  • Trying to make object move parabolically....

    Im creating a race track where an object goes around in laps.. So far, the object is moving at straight 90 degree angles when it hits sides.. Im trying, and also wondering how to make the object curve when it turns a corner instead of hitting the edge, then turning a full 90 degree angle.... Im really stumped, first year takin Java :(
    Here's what I got so far:
    // The "Race" class.
    import java.applet.*;
    import java.awt.*;
    public class Race extends Applet implements Runnable
        Dimension d = getSize ();
        Font f;
        int counter = 0;
        int xchange;
        int ychange;
        int x = 50;
        int y = d.height - 50;
        boolean beg = false;
        boolean slow = false;
        boolean medi = false;
        boolean fast = false;
        Button start, slo, med, fas, stop;
        TextField output;
        Thread t;
        Graphics bufferg;
        Image buffer;
        Image CARu, CARd, CARl, CARr, bakg;
        AudioClip intro, test;
        public void init ()
            test = getAudioClip (getCodeBase (), "1.au");
            intro = getAudioClip (getCodeBase (), "laser.au");
            Dimension d = getSize ();
            buffer = createImage (d.width, d.height);
            bufferg = buffer.getGraphics ();
            start = new Button ("Start");
            start.setBackground (Color.yellow);
            add (start);
            slo = new Button ("Slow");
            slo.setBackground (Color.yellow);
            add (slo);
            med = new Button ("Medium");
            med.setBackground (Color.yellow);
            add (med);
            fas = new Button ("Fast");
            fas.setBackground (Color.yellow);
            add (fas);
            stop = new Button ("Stop");
            stop.setBackground (Color.yellow);
            add (stop);
            CARu = getImage (getCodeBase (), "carUP.jpg");
            CARd = getImage (getCodeBase (), "carDOWN.jpg");
            CARl = getImage (getCodeBase (), "carLEFT.jpg");
            CARr = getImage (getCodeBase (), "carRIGHT.jpg");
            bakg = getImage (getCodeBase (), "bakg.jpg");
        public boolean action (Event e, Object o)
            if (e.target == start)
                beg = true;
                test.loop ();
                intro.play ();
            if (e.target == slo)
                slow = true;
                medi = false;
                fast = false;
            if (e.target == med)
                slow = false;
                medi = true;
                fast = false;
            if (e.target == fas)
                slow = false;
                medi = false;
                fast = true;
            if (e.target == stop)
                beg = false;
                slow = false;
                medi = false;
                fast = false;
                counter = 0;
                x = 50;
                y = d.height - 50;
            return true;
        public void start ()
            if (t == null)
                t = new Thread (this);
                t.start ();
        public void stop ()
            if (t != null)
                t.stop ();
                t = null;
        public boolean keyDown (Event e, int key)
            if (key == 's')
                intro.stop ();
            return true;
        public void run ()
            while (true)
                //Thread sleeps for 15 milliseconds here
                try
                    t.sleep (15);
                catch (Exception e)
                Dimension d = getSize ();
                bufferg.setColor (Color.green);
                bufferg.fillRect (0, 0, d.width, d.height);
                // (d.width-50) ((d.height/3) -50)
                bufferg.drawImage (bakg, 0, 0, this);
                bufferg.setColor (Color.red);
                xchange = 0;
                ychange = 0;
                if (beg == true)
                    if (x <= (d.width - 50) && y >= (d.height - 50))
                        xchange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval (x, d.height - 50, 50, 50);
                        //bufferg.drawImage (car_r, x, 300, this);
                        x += xchange;
                    if (x >= (d.width - 50) && y >= ((d.height / 3) - 50))
                        ychange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval ((d.width - 50), y, 50, 50);
                        // bufferg.drawImage (car_u, 350, y, this);
                        y -= ychange;
                    if (y <= ((d.height / 3) - 50) && x >= 50)
                        xchange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval (x, ((d.height / 3) - 50), 50, 50);
                        //bufferg.drawImage (car_l, x, 115, this);
                        x -= xchange;
                    if (x <= 50 && y <= (d.height - 50))
                        ychange = 1;
                        if (slow == true)
                            ychange = 1;
                            xchange = 1;
                        if (medi == true)
                            ychange = 2;
                            xchange = 2;
                        if (fast == true)
                            ychange = 6;
                            xchange = 6;
                        bufferg.fillOval (50, y, 50, 50);
                        //bufferg.drawImage (car_d, 50, y, this);
                        y += ychange;
                    if ((x <= 50) && (y <= (d.width - 50)) && (x <= (d.width - 50)) && (y >= (d.height - 50)))
                        counter++;
                else
                { //bufferg.drawImage (car_r, 50, 300, this);
                    x = 50;
                    y = d.height - 50;
                    bufferg.fillOval (x, y, 50, 50);
                repaint ();
        public void update (Graphics g)
            paint (g);
        public void paint (Graphics g)
            bufferg.setColor (Color.red);
            f = new Font ("Test", Font.BOLD, 25);
            bufferg.setFont (f);
            bufferg.setColor (Color.blue);
            bufferg.drawString ("Lap " + counter, 300, 300);
            g.drawImage (buffer, 0, 0, this);
        } // paint method
    } // Race classCan anyone help me please?

    here's a stripped down bounded sprite engine. use the arrows keys. up=accelerate forward. down=accelerate backwards. left=turn left. right=turn right. supply a 32x32 image named "image.jpg" (or write your filename in the code below) to see the picture rotate as it corners. otherwise, you'll just see non rotating colored squares which represent the bounding box of the image. the variable turns is the number of images you will have on the screen at a time. i should have chosen a better variable name.
    import java.awt.*;
    import java.util.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.net.*;
    import java.io.*;
    public class SpriteEngine extends Applet implements Runnable, KeyListener{
         Graphics2D dbg;
         Image dbImage;
         public int gameSpeed = 100;
         public int turns = 10;
         Thread th;
         boolean forward=false, reverse=false, left=false,right=false;
         Sprite[] sprite = new Sprite[turns];
         public void init(){
              setSize(500,500);
              setBackground(Color.black);
              addKeyListener(this);
              Image image = getImage(getCodeBase(),"image.jpg");
              for(int a=0;a<turns;a++){
                   sprite[a]=new Sprite(image, new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255)), new Point((int)(Math.random()*500),(int)(Math.random()*500)), Math.random()*360,Math.random()*12-6);
         public void start (){
              th = new Thread (this);
              th.start ();
         public void run ()     {
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              while (true){
                   checkControls();
                   for(int i=0;i<turns;i++){
                        sprite.move();
                   repaint();
                   try     {
                        th.sleep (gameSpeed);
                   }catch (InterruptedException ex){
         public void paint (Graphics2D g)     {
              for(int a=0;a<turns;a++){
                   sprite[a].draw(g);
                   g.setColor(Color.black);
         public void update (Graphics g)     {
              if (dbImage == null){
                   dbImage = createImage (this.getSize().width, this.getSize().height);
                   dbg = (Graphics2D)dbImage.getGraphics();
              dbg.setColor (getBackground ());
              dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
              dbg.setColor (getForeground());
              paint (dbg);
              g.drawImage (dbImage, 0, 0, this);
         public void keyPressed(KeyEvent e) {
              if (e.getKeyCode()==38){forward=true;}else
              if (e.getKeyCode()==40){reverse=true;}else
              if (e.getKeyCode()==37){left=true;   }else
              if (e.getKeyCode()==39){right=true;  }
         public void keyReleased(KeyEvent e) {
              if (e.getKeyCode()==38){forward=false;}else
              if (e.getKeyCode()==40){reverse=false;}else
              if (e.getKeyCode()==37){left=false;   }else
              if (e.getKeyCode()==39){right=false;  }
         public void keyTyped(KeyEvent e) {}
         public void checkControls(){
              for(int a=0;a<turns;a++){
                   if (forward){sprite[a].accel() ;}
                   if (reverse){sprite[a].deccel() ;}
                   if (left) {sprite[a].turnLeft() ;}
                   if (right) {sprite[a].turnRight();}
    class Sprite extends Object {
         private Image image;
         AffineTransform imageLocation=new AffineTransform();
         double velocity;
         Rectangle bounds;
         Rectangle refShape=new Rectangle(32,32);
         double MaxSpeed=6;
         double AccelRate=.3;
         public double Rotation=6;
         double posX,posY,angle;
         Color boxColor;
         public boolean keyDown = false;
         double dx,dy;
         public Sprite(Image img, Color color, Point location, double ang, double speed){
              posX=location.x;          posY=location.y;          boxColor = color;
              image=img;                    velocity=speed;               angle=ang;
              bounds=new Rectangle((int)posX,(int)posY,32,32);
         public void draw(Graphics2D g){
              g.setColor(boxColor);
              g.fill((bounds));
              g.setColor(Color.black);
              g.drawImage(image,imageLocation,null); //this draws your image with the AffineTranform applied
         public void setLocation(Point point) {posX=point.x; posY=point.y; }
         public Point getLocation() {return bounds.getLocation();}
         public void setBounds(Rectangle rect){bounds=rect;                }
         public Rectangle getBounds() {return bounds;              }
         public void setSpeed(double speed) {velocity=speed;                 }
         public double getSpeed() {return velocity;            }
         public void setAngle(double theta) {angle=theta;                }
         public double getAngle() {return angle;               }
         public void turnLeft() {angle=angle-Rotation;       }
         public void turnRight() {angle=angle+Rotation;       }
         public AffineTransform getForm() {return imageLocation;          }
         public void setForm(AffineTransform xform){                       }
         public void accel(){if(velocity<MaxSpeed){velocity=velocity+AccelRate;}}
         public void deccel(){if(velocity> -MaxSpeed){velocity=velocity-AccelRate;}}
         public void move(){
              dx=Math.cos(Math.toRadians(angle))*velocity;
              dy=Math.sin(Math.toRadians(angle))*velocity;
              posX=posX+dx;
              posY=posY+dy;
              imageLocation=AffineTransform.getTranslateInstance(posX,posY); //these two line set the affinetransform
              imageLocation.rotate(Math.toRadians(angle)+Math.PI/2,16,16); //to the right place and angle.
              bounds.setLocation((int)posX,(int)posY);
              if(!keyDown){
                   if (velocity<0){
                        velocity=velocity+.15; // -drag
                   }else if (velocity>0){
                        velocity=velocity - 0.15; // +drag

  • System and Object privileges question

    hello everyone.
    I was really making it a priority to really understand both system and object privileges for users. I have setup a couple of 'sandboxes' at home and have done lots of testing. So far, it has gone very well in helping me understand all the security involved with Oralce (which, IMHO, is flat out awesome!).
    Anyway, a couple of quick questions.
    As a normal user, what view can I use to see what permissions I have in general? what about permissions on other schemas?
    I know I can do a:
    select * from session_privs
    which lists my session privileges.
    What other views (are they views/data dictionary?) that I can use to see what I have? Since this is a normal user, they don't have access to any of the DBA_ views.
    I'll start here for now, but being able to see everything this user has, would be fantastic.
    Cheers,
    TCG

    Sorry. should have elaborated more.
    In SQLPLUS, (logged in while logged into my Linux OS), I am working to try and get sqlplus to display the results of my query so it is easy to read. Right now, it just displays using the first 1/4 or 1/3 of the monitor screen to the left. Make sense? So it does not stretch the results out to utilize the full screen. it is hard to break down and read the results because they are "stacked" on top of each other.
    Would be nice if I could adjust sqlplus so the results are easier to read.
    HTH.
    Jason

  • Object oriented question

    I am sure my n00bieness is going to shine here but I have a pressing question.
    I have two classes that do a similar activity they attach some elements to an xml document and then call a web service.
    Object A uses in its method signature different object parameters then Object B does.
    For example -
    Object A{
      public ProprietaryObject doMagic(ProprietaryObject po){
        //do stuff
    Object B{
      public DiffProprietaryObject doMagic(DiffProprietaryObject po){
        //do stuff
    }There is more than one method that is similar between the two objects but this is just to get the point across.
    Anyway, Instead of creating two separate objects that do "almost" the same thing (on different object types) how can I create an elegant solution to this?
    The problem I run into is that if I create a common interface for these two object to implement the object use different proprietary objects to do their work.
    I find that I keep using the instanceof operator everywehre to determine the object type.
    Hope this is not explained to horribly...
    Any help is appreciated!

    I'd create an Interface which defines a common access method for the-operations-you-require from both proprietory classes, then implement that interface in a couple of "boundary" classes which "wrap" the proprietory classes...
    If possible, extend the disparate proprietory classes, and delegate to the appropriate methods of the "real" classes.
    If the propritory classes are final then you have to write a ship load more "boilerplate" code... every single fraggin method has to pass the buck to the appropriate method of the private instance of the "wrapped" class, and return the result... which isn't usually too bad once you roll up your sleeves and get into it.
    From memory (mine is poor) this is the essence of the [Adapter pattern|http://en.wikipedia.org/wiki/Adapter_pattern].
    Like a said, there may be quit a bit of work involved, but the advantages usually outweigh the costs... You can "refer to" the disparate proprietory classes seemlessly throughout the rest of your system... if ProprietoryClassA changes (in the next release) you can (hopefully) adapt your adapter to those changes, without having to modify all your consumer code... because it still exposes the same interface... which is the motivation for any boundary class ("Trust no one";-)
    Cheers. Keith.
    Edited by: corlettk on 8/08/2008 06:28 - Better.

  • Help In ABAP Object Certification Question

    Hi ABAP Gurus,
       iam going to write certification Exam on Nov 11. i have got some model question from SAP domain for all the topics Except ABAP Objects which is so important...
    Please anybody send me some Example question you guys got from the Certification Exam
    it will be be grateful to me...
    Thanks a lot in advance.
    Prabhu
    SAP Lead Consultant

    Hi,
    Sending ABAP Objects questions is not an option but normally, your concepts are tested for:
    - Classes and objects
    - Inheritance
    - Casting
    - Interfaces
    - Events
    - Global classes and interfaces
    - Exception handling
    - Dynamic programming
    You can use help.sap.com to take a look at these topics one by one. Hope this helps.
    Good luck.

Maybe you are looking for

  • Help setting up Aiport Express with a non BT broadband service

    Just bought a MacBook with Airport Express and am having trouble connecting to the net. I've got a green light on my Express unit but when I try to configure it I can't see a Connect Using PPPoA setting which my ISP says I need, they claim the PPPoE

  • Hello why cant we store more then 25,000 songs that have been uploaded in the Icloud from my cd's

    Hello why cant we store more then 25,000 songs that have been uploaded in the Icloud from my cd's, I'm a DJ and the purpose of getting the Icloud was not only for backup but to have access to all my music and this 25,000 song limit is not acceptable

  • Transfering from one g5 to another

    i bought a used powermac g5 and i want to transfer everything from my old g5 to the new g5 how do i do this they both have the exact same operating system

  • Why to auto conversion?

    Working on a PC with PS5. Why are RAW files automatically being converted to JPGs when opened in PS5? I want them to stay RAW files until I've processed them, then I will export them as JPGs. What is happening?

  • Question on animation

    Hi, me again.  I was moving on with my little project, and I am trying to think of the best way to do something.  So, on the user input, I am going to call up animated letters for each letter inputted (At the moment it is working with still images).