Help writing RTS game

I have been writing a RTS game, and need help. Can anyone tell me how to, when one of my units gets in range of a foe, to attack that foe and destroy it? It should attack the closest target in its weapons range. Here is my code so far...
Main.java
package rixor;
import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.net.URL;
import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JViewport;
public class Main extends JFrame implements ActionListener, KeyListener, Runnable, MouseListener,
        MouseMotionListener {
    Image map;
    int mouseX, mouseY;
    int counter = 0;
    Thread game = new Thread(this);
    int mode = 0;
    Point p = new Point(0,0);
    JViewport port = new JViewport();
    //Create my resources
    int resources = 10000;
    int aiResources = 10000;
    unit[] units = new unit[600];
    unit[] aiUnits = new unit[600];
    SoundClip music;
    SoundClip transferScreen;
    //Declare faction variables
    int playerFaction = 0;
    int computerFaction = 0;
    int mouseXa;
    int mouseYa;
    boolean enterGameSetupScreen = false;
    public Main() {
        super("Rixos");
        setSize(1024,768);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        draw drawer = new draw();
        Container content = getContentPane();
        content.add(drawer);
        setContentPane(content);
        addKeyListener(this);
        addMouseListener(this);
        addMouseMotionListener(this);
        game.start();
        music = new SoundClip("music.wav");
        transferScreen = new SoundClip("0000.wav");
        music.setLooping(true);
        this.setResizable(false);
        this.setDefaultLookAndFeelDecorated(true);
        FlowLayout flow = new FlowLayout();
        content.setLayout(flow);
        music.play();
    public class draw extends JPanel {
        public void paintComponent(Graphics g) {
            Image image;
            //Draw the mouse
            if(mode == 0) {
                g.setColor(Color.black);
                g.fillRect(0,0,1024,768);
                g.setColor(Color.white);
                g.setFont(new Font("Axaxax",Font.PLAIN,40));
                Toolkit tk = Toolkit.getDefaultToolkit();
                image = tk.getImage(getURL("splash.png"));
                g.drawImage(image,0,0,null);
                g.drawString("Press B to Begin",100,100);
                g.setColor(Color.GREEN);
                g.fillRect(mouseX-10,mouseY-29,20,20);
                repaint();
            if(mode == 1) {
                g.setColor(Color.black);
                g.fillRect(0,0,1024,768);
                Toolkit tk = Toolkit.getDefaultToolkit();
                image = tk.getImage(getURL("back.png"));
                g.drawImage(image,0,0,null);
                image = tk.getImage(getURL("earth.jpg"));
                g.drawImage(image,700,200,null);
                image = tk.getImage(getURL("planet.jpg"));
                g.drawImage(image,690,450,null);
                g.setFont(new Font("Axaxax",Font.PLAIN,80));
                g.drawString("Operations Center Menu",40,80);
                g.setColor(Color.RED);
                g.fillRect(73,200,300,50);
                g.fillRect(73,300,300,50);
                g.setFont(new Font("Axaxax",Font.PLAIN,35));
                g.setColor(Color.black);
                g.drawString("About This Game",75,240);
                g.setColor(Color.GREEN);
                g.fillRect(70,170,20,20);
                checkImage(70,270,20,20,mouseX-10,mouseY-29,20,20);
                g.fillRect(70,270,20,20);
                g.setColor(Color.black);
                g.drawString("Start a Game",75,340);
                g.setColor(Color.GREEN);
                g.fillRect(mouseX-10,mouseY-29,20,20);
                repaint();
            if(mode == 4) {
                //The select map screen
                g.setColor(Color.green);
                g.fillRect(0,0,1024,768);
            if(mode == 2) {
                //The game mode (Under construction)
                Toolkit tk = Toolkit.getDefaultToolkit();
                image = tk.getImage(getURL("back.png"));
                g.drawImage(image,0,0,null);
                Color transparency = null;
                if(playerFaction == 0) {
                    //Each faction gets a different HUD Color
                    transparency = new Color(10,10,10,50);
                g.setColor(transparency);
                g.fillRect(900,50,100,680);
                g.fillRect(10,20,990,25);
                g.setColor(Color.BLACK);
                g.setFont(new Font("Axaxax",Font.PLAIN,20));
                if(playerFaction == 0) {
                    //Each faction gets a different TEXT Color
                    g.setColor(Color.BLUE);
                g.drawString("Resources: "+resources,15,40);
                if(playerFaction == 0) {
                    g.drawString("Faction: None",215,40);
                g.setColor(transparency);
                g.fillRect(mouseX-10,mouseY-29,20,20);
                g.setColor(Color.RED);
                g.fillRect(970,22,20,20);
                g.setColor(transparency);
                for(int i = 0; i < 600; i++) {
                    if(units.getHealth() > 0) units[i].drawUnit(g,Color.BLUE);
if(aiUnits[i].getHealth() > 0) aiUnits[i].drawUnit(g,Color.RED);
g.setColor(Color.RED);
//Draw the tank option
image = tk.getImage(getURL("0000.png"));
g.drawImage(image,900,80,null);
repaint();
private URL getURL(String string) {
URL url = null;
try {
url = this.getClass().getResource(string);
} catch(Exception e) {}
return url;
public void checkImage(int i, int i0, int i1, int i2, int i3, int i4, int i5, int i6) {
Rectangle b = new Rectangle(i,i0,i1,i2);
Rectangle c = new Rectangle(i3,i4,i5,i6);
if(b.intersects(c)) {
enterGameSetupScreen = true;
public static void main(String[] args) {
Main i = new Main();
public void actionPerformed(ActionEvent e) {
public void keyTyped(KeyEvent e) {
public void keyPressed(KeyEvent e) {
if(mode == 0){
if(e.getKeyCode() == KeyEvent.VK_B) {
transferScreen.play();
mode = 1;
if(mode == 3) {
if(e.getKeyCode() == KeyEvent.VK_B) {
mode = 1;
transferScreen.play();
if(e.getKeyCode() == KeyEvent.VK_Y) {
mode = 2;
//Create player's construction vehicle
for(int i = 0; i < 600; i++) {
units[i] = new unit(0,0,0,0,0,0,0);
aiUnits[i] = new unit(0,0,0,0,0,0,0);
units[0].setController(1);
units[0].setType(1);
units[0].setX(500);
units[0].setY(680);
units[0].setHealth(80000);
units[0].setSpeed(0);
aiUnits[0].setController(2);
aiUnits[0].setType(1);
aiUnits[0].setX(500);
aiUnits[0].setY(30);
aiUnits[0].setHealth(80000);
aiUnits[0].setSpeed(0);
//TODO: ADD AI UNITS
transferScreen.play();
if(mode == 2) {
for(int i = 0; i < 600; i++) {
if(e.getKeyCode() == KeyEvent.VK_DELETE) {
if(units[i].isSelected()) {
if(units[i].getType() == 2) { resources = resources + 600; }
units[i].setType(0);
public void keyReleased(KeyEvent e) {
public void run() {
while(game == Thread.currentThread()) {
if(mode == 2) {
if(counter < 90) {
//Count the time for a resource addition
counter = counter + 1;
if(counter == 90) {
//Allot resources to the player
resources = resources + 5;
aiResources = resources + 5;
counter = 0;
moveCheck();
if(mode == 1) {
counter = 0;
try {
Thread.sleep(20);
} catch(Exception e) {}
repaint();
public void mouseClicked(MouseEvent e) {
public void mousePressed(MouseEvent e) {
if(mode == 1) {
if(e.getX() > 70) {
if(e.getX() < 120) {
if(e.getY() > 200) {
if(e.getY() < 500) {
mode = 3;
transferScreen.play();
if(enterGameSetupScreen) {
mode = 4;
enterGameSetupScreen = false;
if(mode == 2) {
//Does in-game mouse detection
Rectangle Quit = new Rectangle(970,22,20,20);
Rectangle mouseTest = new Rectangle(mouseX-10,mouseY-29,20,20);
if(Quit.intersects(mouseTest)) {
transferScreen.play();
mode = 1;
aiResources = 10000;
resources = 10000;
for(int i = 0; i < 600; i++) {
//Deletes the units
try {
units[i].setController(0);
units[i].setType(0);
aiUnits[i].setController(0);
aiUnits[i].setType(0);
} catch(Exception ex) {}
//Creates a new Human tank if player is human
if(mouseTest.intersects((new Rectangle(900,80,50,50)))) {
int offset = 0;
boolean found = false;
if(playerFaction == 0) {
if(resources > 700) {
resources = resources - 700;
for(int i = 0; i < 600; i++) {
if(found == false) {
if(units[i].getType() == 0) {
offset = offset - 10;
found = true;
units[i].setType(2);
units[i].setFirepower(800);
units[i].setX(550+offset);
units[i].setY(650+offset);
units[i].setSpeed(1);
units[i].setHealth(800);
units[i].setController(1);
for(int i = 0; i < 600; i++) {
if(mouseTest.intersects(units[i].getBounds())) {
units[i].setSelected(true);
if(!mouseTest.intersects(units[i].getBounds())) {
units[i].setSelected(false);
public void mouseReleased(MouseEvent e) {
public void mouseEntered(MouseEvent e) {
public void mouseExited(MouseEvent e) {
public void mouseDragged(MouseEvent e) {
for(int i = 0; i < units.length; i++) {
if(units[i].isSelected()) {
//The moving!
if(units[i].getType() == 2) {
units[i].setState(3);
if(units[i].isSelected()) {
//The moving!
if(units[i].getType() == 2) {
units[i].setState(0);
units[i].setDistance(new Point(e.getX(),e.getY()));
units[i].setTraveled(0);
public void mouseMoved(MouseEvent e) {
//Moves our mouse collision sensor accross screen
mouseX = e.getX();
mouseY = e.getY();
private void moveCheck() {
if(mode == 2) {
for(int i = 0; i < units.length; i++) {
if(units[i].getDistance() != new Point(units[i].getX(),units[i].getY())) {
if(units[i].getX() > units[i].getDistance().getX()) {
units[i].setX(units[i].getX() - units[i].getSpeed());
if(units[i].getX() < units[i].getDistance().getX()) {
units[i].setX(units[i].getX() + units[i].getSpeed());
if(units[i].getY() > units[i].getDistance().getY()) {
units[i].setY(units[i].getY() - units[i].getSpeed());
if(units[i].getY() < units[i].getDistance().getY()) {
units[i].setY(units[i].getY() + units[i].getSpeed());
And here is my unit.java file...
package rixor;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.net.URL;
public class unit {
    //This class controlls the units and structures and allows them to be declared.
    int type = 0;
    int controller = 0;
    //1 is player, 2 is computer
    int health = 0;
    int firepower = 0;
    int speed = 0;
    int x;
    int y;
    int traveled;
    Point distance = new Point(x,y);
    int sizeX;;
    int sizeY;
    int state = 0;
    //0 is being places, 1 is placed.
    boolean selected = false;
    public unit(int type, int controller, int health, int firepower, int speed, int x, int y) {
        this.type = type;
        this.controller = controller;
        this.health = health;
        this.firepower = firepower;
        this.speed = speed;
        this.x = x;
        this.y = y;
    public int getHealth() {
        return health;
    public int getType() {
        return type;
    public int getController() {
        return controller;
    public int getSpeed() {
        return speed;
    public int getFirepower() {
        return firepower;
    public int getX() {
        return x;
    public int getY() {
        return y;
    public void setX(int x) {
        this.x = x;
    public void setY(int y) {
        this.y = y;
    public void setHealth(int health) {
        this.health = health;
    public void setFirepower(int firepower) {
        this.firepower = firepower;
    public void setController(int controller) {
        this.controller = controller;
    public void setSpeed(int speed) {
        this.speed = speed;
    public void setType(int type) {
        this.type = type;
    public void setState(int state) {
        this.state = state;
    public int getState() {
        return state;
    public void drawUnit(Graphics g, Color color) {
        Image image;
        Toolkit tk = Toolkit.getDefaultToolkit();
        if(type == 1) {
            sizeX = 30;
            sizeY = 30;
            //Draw A Construction Vehicle
            g.setColor(color);
            g.fillRect(x,y,sizeX,sizeY);
            g.setFont(new Font("Axaxax",Font.PLAIN,36));
            g.setColor(Color.green);
            g.drawString("C",x+5,y+30);
            if(selected == true) {
                g.setColor(Color.PINK);
                g.drawRect(x,y,sizeX,sizeY);
        if(type == 2) {
            sizeX = 40;
            sizeY = 40;
            image = tk.getImage(getURL("0000.png"));
            g.drawImage(image,x,y,null);
            if(selected == true) {
                g.setColor(Color.PINK);
                g.drawRect(x,y,50,50);
    private URL getURL(String string) {
        URL url = null;
        try {
            url = this.getClass().getResource(string);
        } catch(Exception e) {}
        return url;
    public Rectangle getBounds() {
        Rectangle bounds = new Rectangle(x,y,sizeX,sizeY);
        return bounds;
    public void setSelected(boolean selected) {
        this.selected = selected;
    public boolean isSelected() {
        return selected;
    public void setTraveled(int traveled) {
        this.traveled = traveled;
    public void setDistance(Point distance) {
        this.distance = distance;
    public int getTraveled() {
        return traveled;
    public Point getDistance() {
        return distance;
//TODO: Implement collision testing systemThat's all you should need to help. Thanks in advance.

pardon me jwenting,
But you cannot triangulate with 2 (x,y) pairs.
TRI-angulation involves 3 coordinates.
The method our peer needs is a simple distance formula:
dist = sqrt( ( x1-x2 )^2 + ( y1-y2 )^2 )
Now...
All you need for range detection is a little "for-each loop"
Place something like this in your unit class's update method:
for ( each unit in unit list )
   if ( unit.isNotMine() && unit.isWithinMyRange() )
      this.attack( unit );
}The attack( Unit u ) function should do as follows:
double dx = this.getX()-u.getX(); //you may need to flip these i did not test
double dy = this.getY()-u.getY();
double angle = Math.atan2(dy,dx);
// here define what "attacking" even means???
if ( this.isMelee() )
   this.x += Math.cos(angle)*this.getSpeed(); //this will move your unit
   this.y += Math.sin(angle)*this.getSpeed();
   if ( this.getDistance( u ) <= this.meleeAttackRange() )
      this.causeDamage( u );
else
   load++;
   if ( load>this.loadingTime() )
      this.shootToward( unit );
}Ok, get started with that...
If that doesn't help then we cant help you!!
Show us what you're trying to do, then tell us what errors.
Dont just post all your code and say "fix-me".
Good luck though, hope this gave you some ideas.
Message was edited by:
ArikArikArik

Similar Messages

  • I'm writing XNA game and want my game to support 12 different languages

    I'm writing XNA game and want my game to support 12 different languages and be visible in all the respective markets where users speak those 12 languages. I Develop my game in English
    language. 
    So what are my next steps? I've seen examples for Silverlight, but I develop in XNA. Basically, what is the difference between globalization
    and localization? Which one should I use? Will I have to produce 12 different .xap builds or one universal?
    Please help....
    Thanks in Abvance
    Manoj Kumar

    This is covered on MSDN:
    How to: Create a Localized Game
    And this sample:
    http://xbox.create.msdn.com/en-US/education/catalog/sample/localization
    "Globalization" is the process of making a piece of software 'language-neutral' so you can translate it into many languages. Primarily this is making sure all text is in a resource file rather than hard-coded in the source, all display/layout of
    text is robust with sufficient room, and all art/sound assets with language/locale-specific content are isolated and known.
    "Localization" is the process of actually translating the assets to a specific language.
    This is not specific to XNA Game Studio, and the solution there is general to all C# applications. The main challenge for XNA Game Studio is making sure have spritefonts captured for all the languages you support. This can be particularly challenging for
    very large character fonts which are too large to capture all into a single texture sheet.
    See Developing International Software (MS Press) for a general book.

  • Need help writing host program using LabView.

    Need help writing host program using LabView.
    Hello,
    I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
    I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
    eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
    My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
    I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
    Any help would be appreciated.
    Regards, George
    George Dorian
    Sutter Instruments
    51 Digital DR.
    Novato, CA 94949
    USA
    [email protected]
    m
    (415) 883-0128
    FAX (415) 883-0572

    George may not answer you.  He hasn't been online here for almost eight years.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • The game "horn" does'nt open and shows installing but nothing happens. it was transferred from the computer to the ipad. help!, The game horn does'nt open and shows installing but nothing happens. it was transferred from the computer to the ipad. help!

    The game "horn" does'nt open and shows installing but nothing happens. it was transferred from the computer to the ipad. help!, The game horn does'nt open and shows installing but nothing happens. it was transferred from the computer to the ipad. help!

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    iOS 7: Help with how to fix a crashing app on iPhone, iPad (Mini), and iPod Touch
    http://teachmeios.com/help-with-how-to-fix-a-crashing-app-on-iphone-ipad-mini-an d-ipod-touch/
    Troubleshooting apps purchased from the App Store
    http://support.apple.com/kb/TS1702
    Delete the app and redownload.
    Downloading Past Purchases from the iTunes Store, App Store and iBooks Store
    http://support.apple.com/kb/ht2519
     Cheers, Tom 

  • Need help writing a query for following scenario

    Hi all, I need some help writing a query for the following case:
    One Table : My_Table
    Row Count: App 5000
    Columns of Interest: AA and BB
    Scenario: AA contains some names of which BB contains the corresponding ID. Some
    names are appearing more than once with different IDs. For example,
    AA BB
    Dummy 10
    Me 20
    Me 30
    Me 40
    You 70
    Me 50
    Output needed: I need to write a query that will display only all the repeating names with their corresponding IDs excluding all other records.
    I would appreciate any input. Thanks

    Is it possible to have a records with the same values for AA and BB? Are you interested in these rows or do you only care about rows with the same value of AA and different BB?
    With a slight modification of a previous posting you can only select those rows that have distinct values of BB for the same value of AA
    WITH t AS (
    SELECT 'me' aa, 10 bb FROM dual
    UNION ALL
    SELECT 'me' aa, 20 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    SELECT DISTINCT aa, bb
      FROM (SELECT aa, bb, COUNT(DISTINCT bb) OVER(PARTITION BY aa) cnt FROM t)
    WHERE cnt > 1;

  • Help writing a workflow rule

    Hello Experts!!!
    I need help writing a workflow rule condition to trigger the workflow. What I am aiming for is an email to be sent out when an opportunity is marked Closed/Won. But it can only be of a certain opportunity type (we use three options) and opportunity sub-type (we use two options) (these are custom fields we use)
    Below are the fields that need to be used:
    [<SalesStage>] = Closed/Won
    [<OpportunityType>] = Acute
    [<plOpportunity_SubType_ITAG>] = Tech
    Thanks Again!!

    Hi
    Try:
    [<SalesStage>] = Closed/Won AND [<OpportunityType>] = Acute AND [<plOpportunity_SubType_ITAG>] ='Tech'
    Note that in case of picklists it is recomended to use the lookup value and not static text like 'Tech', but both will work.
    Good luck
    Guy

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • Need help writing small program!

    Hi. I'm learning Java programming, and I need help writing a small program. Please someone help me.
    Directions:
    Create a program called CerealCompare using an if-then-else structure that obtains the price and number of ounces in a box for two boxes of cereal. The program should then output which box costs less per ounce.

    class CerealCompare {
        public static void main(String[] args) {
            // your code goes here
    }Hope that helps.
    P.S. Java does not have an if-then-else statement.

  • Help writing a excel macro to do a copy of 4 cells and paste transpose. I need to loop the copy and paste through 6900 rows of data.

      I need help writing a excelmacro to do a copy of 4 cells and paste transpose.  I need to loop the copy and paste through 6900 rows of data.  I started the macro with two rounds of copying & paster transposed but I need help getting it
    to loop through all rows.  Here is what macro looks like now.
        Range("I2:I5").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("J2").Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        Range("I6:I9").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("J6").Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
    End Sub

    Thanks Jim for the solution above.
    Hi Brogents,
    Thanks for posting in our forum. Please note that this forum focuses on questions and feedback for Microsoft Office client. For any
    VBA/Macro related issues, I would suggest you to post in the forum of
    Excel for Developers, where you can get more experienced responses:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=exceldev
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Need Help Writing Server side to submit form via API

    Hey
    I need help writing a serverside application to submit
    information via API to a separate server.
    I have a client that uses constant contact for email
    campaigns. We want to add to her website a form taht submits the
    information needed to subscribe to her email list, to constant
    contact via API.
    FORM.asp :: (i got this one under control)
    name
    email
    and submits to serverside.asp
    SERVERSIDE.ASP
    In serverside.asp i need to have
    the API URL
    (https://api.constantcontact.com/0.1/API_AddSiteVisitor.jsp)
    username (of the constant contact account)
    password (of the constant contact account)
    name (submited from form.asp)
    email (submitted from form.asp)
    redirect URL (confirm.asp)
    Can anyone help get me going in the right direction?
    i have tried several things i found on the net and just cant
    get anyone to work correctly.
    One main issue i keep having is that if i get it to submit to
    the API url correctly - i get a success code, it doesnt redirect to
    the page i am trying to redirect to.
    ASP or ASP.NET code would be find.
    THANKS
    sam

    > This does require server side programming.
    > if you dont know what that is, then you dont know the
    answer to my question. I
    > know what i need to do - i just dont know HOW to do it.
    If you are submitting a form to a script on a remote server,
    and letting
    that script load content to the browser, YOU have no control
    over what it
    loads UNLESS there is some command you can send it that it
    will understand.
    No amount of ASP on your server is going to change what the
    remote script
    does.
    http://www.constantcontact.com/services/api/index.jsp
    they only allow their customers to see the instructions for
    the API so i
    can't search to see IF there is a redirect you can send with
    the form info.
    But posts on their support board say that there is.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Get 15 mins back time from current time (pls help writing query)

    Dear all,
    I need to write a query that gives time 15 mins before the current time.
    I need to calculate hits on a website for last 15 mins.
    Kindly help writing this query.
    Regards, Imran

    select sysdate - 15/(60*24)
    from dual;
    Regards
    Asif Kabir

  • Guys need help is regarding games. I want to install games like commandos, gta vice city, counter strike etc I mean action games in which we do levels, like games in playsatation and xbox ?

    Guys need help is regarding games. I want to install games like commandos, gta vice city, counter strike etc I mean action games in which we do levels, like games in playsatation and xbox ?

    You can only install games that are in the iTunes app store on your computer and the App Store app directly on the iPad - if there are games like those that you mention in your country's store then you can buy and install them. Have you had a look in your country's store ?

  • Help with rhythm game

    So i am starting university in late september (to learn 3d character animation) and need to get the grades to get in, sadly we have a flash programming unit in the college course im in now and we didnt get taught anything at all and i mean nothing, we were given printed sheets and told to copy the code word for word. so i really need help with my game. how would i make the movement of something my cursor? so when i move the cursor it follows it? also how do i play an animation on click?
    My  idea for the game is to have a rhythm style game where the player moves the net and catches the bee's, something i thought would be simple to figure out how to do
    This is my game at the minute, ive used the code we were told to copy from sheets and just changed the sprites :\ any help would be amazing!
    https://www.dropbox.com/s/1pjbv2mavycsi3q/sopaceship%20rev7%20%20moving%20bullet.fla

    http://orangesplotch.com/blog/flash-tutorial-elastic-object-follower/
    var distx:Number;
    var disty:Number;
    var momentumx:Number;
    var momentumy:Number;
    follower.addEventListener(Event.ENTER_FRAME, FollowMouse)
    function FollowMouse(event:Event):void {
         // follow the mouse in a more elastic way
         // by using momentum
         distx = follower.x - mouseX;
         disty = follower.y - mouseY;
         momentumx -= distx / 3;
         momentumy -= disty / 3;
         // dampen the momentum a little
         momentumx *= 0.75;
         momentumy *= 0.75;
         // go get that mouse!
         follower.x += momentumx;
         follower.y += momentumy;

  • Help With Online Game (Walking Talking)...

    Hello, I just want to make like something like a game where you conrol a box, and can write messages to other people...
    But the thing is that i am absolutely new in JAVA i don't know anything in it (totally)
    So i would like to get some information in working with it... and things like that ^.^
    P.S. I worked with GameMaker but I don't think that it will help me :|

    I Don't know but it' didn't work maybe cause i am using vista???
    when it didn't work i made a bat file and wrote there: javac HelloWorldApp.java
    i think it did something but new file didn't appear anywhere. maybe it shuld appear in any other folder or something?
    EDIT: I thought that vista doesn't let me to make new files in C disk so i copied the *.java file to the desktop and when i cmd i tried to javac it, the compiler started writing:
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    by his self... it didn't stop waited about 30seconds...
    Edited by: TDEsws on Nov 5, 2008 5:37 AM

  • I am having problems being able to sign out of everything that requires a sign in and password can you help and some games only show have the page

    I have been doing online banking with this bank for 7 months with no problems. About 2 weeks ago I started having problems with certain things within the account. I called the support team with the bank and told them the problem and they suggested to uninstall firefox and reinstall so I did. Now I can move around within the account but can not sign off. Also all my accounts that require a sign in I have the same problem and some games I play only load up part of the game. I play goldminer and now I can not see the little miner to play the game. Can you help????????

    That issue can be caused by corrupted cookies.
    *https://support.mozilla.org/kb/Cannot+log+in+to+websites
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.<br />
    Rename (or delete) <b>cookies.sqlite</b> (cookies.sqlite.old) and delete other present cookie files like <b>cookies.sqlite-journal</b> in the Firefox Profile Folder in case the file cookies.sqlite got corrupted.
    *http://kb.mozillazine.org/Cookies

Maybe you are looking for

  • PO Delivery Schedule and GRN linkage

    Hello, A PO has a line Item and for that Line item , number of Delivery schedule lines have been created. Now for One delivery schedule line (EKET-EINDT) , Multiple GRN's Created and similarly for other delivery schedule lines too. I want to know for

  • Excel not showing up as a "Save As" option

    I have an existing pdf that I'd like to save as an Excel Spreadsheet but that option isn't showing up in the drop down list (Word shows up fine). It's not in the Export drop down either. Is there a setting somewhere that I should know about? I'm usin

  • Error in SOAMANAGER transaction

    Hi Buddies, I have an rfc function module for which I create a web service(service difinition). In SOAMANAGER transaction, when I select the rfc function module and click "Open Webservice navigator for selected binding", it is throwing an error sayin

  • Study material for 1Z0-007 or 1Z0-001

    Hi Does anyone provide me with study material( PDF or PPT) for 1Z0-007 introduction to oracle 9i Or 1Z0-001 introduction to oracle : SQL and PL/SQL Thanks

  • HT204150 Does iOS 6 allow you to browse groups?  I could do it before with iOS 5 on my 4S.  Now I can't.

    Does iOS 6 allow you to browse groups?  I could do it before with iOS 5 on my 4S.  Now I can't.