Help with Appleworks-Spreadsheet - "Dragging down formula for entire column
I have Appleworks 6 and am attempting to duplicate what I can do in Excel - Namely, entering a simple formula (=a1*.20) and dragging the lower righthand corner down to duplicate for the entire column. I know that Appleworks doesn't mimic many of Excel's features but am wondering what the Apple variation of this is?
Thanks,
Roberta
You can "Fill Down" (or Fill Right) from the Calculate menu. Enter your formula, text, etc. it the first cell, click on that cell & drag the cursor until all of the cells you want to populate are highlighted, the choose your fill. Unless the original formula has absolute references, the filled formulas will be relative to the original cell. Say C1 is the first cell & the formula is =A1+B1, filling down from C1, the formula in C6, for example, will be =A6+B6.
Peggy
Similar Messages
-
Help with F-48 Vendor Down payment for Italy please
Hello,
I have a problem with the F-48 Vendor down payment process. I'm working with an Italian company, and they state that with a Pro-forma invoice, they post the down payment. The Vendor has Withholding tax, and when I use a Vendor that is setup for Withholding in the Vendor master, the Withholding tax is not being applied to the Down payment. They state that they need it to apply to the down payment.
Also, they claim that the VAT tax is not posted at the time of the down payment, but is used to help calculate the Withholding tax. When I create a F-48 down payment and use the 'Calculate Tax' box, the VAT that is calculated is actually posted at the time of the Down payment posting. They claim that it should not post until the Invoice is cleared.
Any ideas?
thanks for your help!Hello Deepa Khatri,
Thanks for your response. I know that the Vendor is setup correctly, because when I create and FB60 Invoice for his same vendor, the Withholding tax is properly applied. When I use the F-48 transaction, the Withholding is not brought in. Is there some Down Payment configuration that might help this Withholding to be applied?
thanks again for your help! -
Installing formula for entire Column
Im putting together a wholesale business and want to format a column so that when I enter a price in column D column E automatically calculates and additional 15% for Freight. So As I proceed down each row with additional items when I enter the price of each item in Column D the landed cost of the good(with the additional 15%) automatically appears in column E... I know how to format each cell individually but want to format all the cells in the column at the same time.
muleneck,
You said you wanted to calculate a new price including freight when you entered a basic price. So suppose you are entering this basic price in B3. Then your new price in, say, C3 would be:
=IF(B3="","",1.15*B3). This says, if there is no price value in B3, leave the cell (C3) blank. But if the price cell has a value, find the new price by adding 15% (.15) to that price or 1.15 times the original price. This lets you add rows not yet in use without seeing results of the calculation. But it's there when you enter a price.
pw
Message was edited by: pw1840 -
Apache POI- HSSFDataValidation Formula Validation for Entire column
Hello,
I have been looking HSSFDataValidation and was able to run the sample below.
My requirement is I need to apply this formula for Entire column to achieve the need like
When user enters data in col2 (B) of greater than the number specified in col1 (A) and then show the ErrorBox.
I am able to get the formula working through code only for first cell as per below code... I want it to dynamically apply for the entire column.
Please suggest...
1. import java.io.File;
2. import java.io.FileOutputStream;
3. import java.util.ArrayList;
4. import org.apache.poi.hssf.usermodel.DVConstraint;
5. import org.apache.poi.hssf.usermodel.HSSFDataValidation;
6. import org.apache.poi.hssf.usermodel.HSSFSheet;
7. import org.apache.poi.hssf.usermodel.HSSFWorkbook;
8. import org.apache.poi.hssf.util.CellRangeAddress;
9. import org.apache.poi.hssf.util.CellRangeAddressList;
10. import org.apache.poi.ss.usermodel.Cell;
11. import org.apache.poi.ss.usermodel.Row;
12.
13. public class TestThis{
14. public static void main1(String[] args) {
15. // New Workbook.
16. File outputFile = new File("C:/mamatha.xls");
17. try {
18.
19. FileOutputStream fos = new FileOutputStream(outputFile);
20. HSSFWorkbook workbook = new HSSFWorkbook();
21. HSSFSheet sheet = workbook.createSheet("Validation");
22. Row row = sheet.createRow(0);
23. Cell cell = row.createCell(0);
24. cell.setCellValue(5);
25. cell = row.createCell(1);
26. cell.setCellValue("good");
27. row = sheet.createRow(1);
28. cell = row.createCell(0);
29. cell.setCellValue(7);
30. cell = row.createCell(1);
31. cell.setCellValue("now");
32.
33. //String formula = "IF(LEN($B$1) > $A$1, FALSE, $B$1)";
34. String formula = "IF(LEN($B$1:$B10) > $A$1:$A10, FALSE, $B$1:$B10)";
35. CellRangeAddressList addressList = new CellRangeAddressList();
36. addressList.addCellRangeAddress(0, 1, 3, 1);
37. DVConstraint constraing = DVConstraint.createFormulaListConstraint(formula);
38.
39. HSSFDataValidation dataValidation = new HSSFDataValidation(addressList, constraing);
40. dataValidation.setEmptyCellAllowed(true);
41. dataValidation.setShowPromptBox(true);
42. dataValidation.setSuppressDropDownArrow(false);
43. dataValidation.createErrorBox("Invalid input !!", " Length of Col B > colA ");
44. sheet.addValidationData(dataValidation);
45. workbook.write(fos);
46. } catch (Exception e) {
47. System.out.println(e);
48. }
49. }
50. } Thanks
Mamatha
Edited by: user8984775 on Mar 17, 2011 11:20 PM
Edited by: user8984775 on Mar 17, 2011 11:22 PMuser8984775 wrote:
My requirement is I need to apply this formula for Entire column to achieve the need like
When user enters data in col2 (B) of greater than the number specified in col1 (A) and then show the ErrorBox.
I am able to get the formula working through code only for first cell as per below code... I want it to dynamically apply for the entire column. Well I'm certainly no expert on POI, but that looks like a very odd formula to me.
When you "pull" a formula down a column, Excel automatically changes the formula for each row, but because you've fixed both the column AND the row ($A$1), it'll be the same in all cases.
I don't know if POI allows that sort of "auto-generate" for formulas, but if so try something like $A1 instead; otherwise I suspect you'll need a different formula for each row.
Winston -
Need help with a customized interactive web application for apparel
Help!!!!
Hi I am a web designer at beginners stage with web
devlopment. I am seeking guidance on how to develop a customized
interactive web application so that the end user can change color
and patterns of apparel on vector images such as teamsports
uniforms and tshirts. Once the design is customized to their liking
they can save it with all of the spec information in a file to
there desktop or to a database to send to the manufacturer.
Also looking for a possible way to use a CMS so I can upload
templates of the garment easily for the end user to customize
online. Can this be done and if so how? This is an example the kind
of application I am looking for:
http://www.dynamicteamsports.com/elite/placeorder.jsp
I am in desperate need of some brilliant developer to help
with this.
Thanks in advance for anyone who is willing to assist or give
me guidance,
Danka
"Reap what you sew"some parts of that are doable using non-advanced skills, but
will be difficult and unwieldly if there are more than a few
colors/patterns.
saving the image to the server is a bit more advanced and
you're going to need some server-side scripting like php, perl, asp
etc. in addition to some flash programming ability. -
Project with profit center was not created for entire period
Hi everybody,
I need a help with a problem here.
The alert mesage "project with profit center was not created for entire period" was displayed.
Then I searched for the creation dates and the profit center was created before the project gets its firsts postings. Therefore, some line itens don't exist in profit center (ledgers).
My two questions:
The first one, is it possible to input line itens in a retroactive way?
Everytime I need to use the project master data this alert is displayed. How can I fix avoid this message?
Thanks,Hi,
Regarding your issue, it is theoretically possible to reverse all settlements up to the start of the project and then to settle again it
is a must to check in standard if the profit center is valid from the project start date onwards.
Check the attached note 1048945.
The system generates error message KM700 ('Profit center <PRCTR> does not exist for <date>') when you enter a profit center on a project definition if the profit center is not valid in the entire period between the basic start and the basic finish date of the project definition . However, only one warning message should only be generated in this case.
regards
Waman -
How to create sharepoint Group with read only permissions using powershell for entire site ?
How to create sharepoint Group with read only permissions using powershell for entire site (including subsites and top level site)
Hi
using (SPSite site = new SPSite(url))
using (SPWeb web = site.OpenWeb())
SPUserCollection users = Web.AllUsers;
SPUser owner = users[string.Format("{0}{1}", "Domain", "Owner Username")];
SPMember member = users[string.Format("{0}{1}", "Domain", "Default Member Username")];
SPGroupCollection groups = Web.SiteGroups;
string GroupName = “Super Exclusive”;//your group name
string GroupDescription = “Super exclusive group description.”;
groups.Add(GroupName, owner, member, GroupDescription);
SPGroup NewSPGroup = groups[GroupName];
SPRoleDefinition role = Web.RoleDefinitions["Read"];
SPRoleAssignment roleAssignment = new SPRoleAssignment(NewSPGroup);
roleAssignment.RoleDefinitionBindings.Add(role);
Web.RoleAssignments.Add(roleAssignment);
Web.Update();
Please 'propose
as answer' if it helped you, also 'vote
helpful' if you like this reply. -
Drop Down appearance for writeback column field
How to display drop down appearance for writeback column field(set of values in drop down for that field in the Report UI)? Currently Writeback feature in 10g provides only text Box for writeback field.
Not possible. Writeback is explicitely meant for specific updates and inserts and not for massive arbitrary record creation (official Oracle statement).
-
Here's the situation I live with my gf and roommate and we're trying to make a spreadsheet to track our finances. Here's what I'm currently having trouble making:
I have 3 types of entries Rent, Groceries and House. When a entry is added for the House catergory, I want the amount in the paid column to be divided by three with a third of it going into the Cam owing Kim (Cam -> Kim) cell and the Kar owing Kim (Kar->Kim) cell. (This is because when we buy stuff for the house we all use it and the cost should be divided evenly between the 3 of us)
When an entry is made for the Groceries catergory I want the amount paid column to be divided by two, with half going into the Cam owing Kim (Cam->Kim) cell. (This is because my gf and I buy groceries together and split the cost between the two of us)
When an entry is made for the Rent catergory I dont want any division to happen. (This is because we all pay the rent individually)
I'd greatly appreciate any help to make this work! I'd ideally like it to work this way, but I'm open to trying another way if it might be easier. Thanks in advance
Kimani Peterjerry mendelsberg wrote:
when I try print preview, the screen shows 2 versions of my spreadsheet----one with the numbers or data in the cells and one with the cells empty.
It most likely is that you are seeing one spreadsheet (the proper term in Numbers is "table") spread over two pages, with the rightmost columns empty of any data. To confirm this, look to the left of the Numbers window, where it says "Sheets." Do you see more than one item under that heading that has a yellow box next to it? Most likely, you will see just one item like this. If so, you only have one table.
If not, you have more than one table & can probably just delete the second, empty one. This is easily done by clicking once on its little yellow icon, checking the print view to make sure that it is the one selected (it will have little squares at each corner & at each midpoint of its edges), & then pressing the delete key.
If you have only one table, confirm that it only has the number of rows & columns you expect: Click on any cell once. You should see an angular tab appear it the bottom right of the table. (Most likely, you will see the tab appear on the second page of your table.) Click & hold but do not drag on this tab. You should see a yellow box appear listing the number of rows & columns in the table.
If the column or row count isn't what you expect, you have extras that most likely are empty. You can delete them by hovering the pointer over the row or column label (at the top or left edge of the table, filled with letters or numbers) & clicking on the small triangle that appears. This drops down a menu with an option to delete the row or column.
I suggest you browse through the "Getting Started" booklet to become more familiar with the basic features of this & the other iWork applications. It should quickly become clear how to use them. -
Help with sequence settings in final cut for project with 2 different frame rates.
I really need help with this one! I finished editing a wedding video and realized after exporting that it was filmed in two different frame rates. This has happened before but I converted the footage to match and fixed the problem. In this case, the footage is part 30fps and part 60fps. The majority of it was filmed in 30fps. I cannot convert the 60 to 30 without the slow motion effect which I do not need so I have to find a way to burn this to a DVD without it looking messed up! The video was shot with two Canon 7ds if that helps anything. The first sequence I set at 29.97 and exported as a quicktime movie and all the footage filmed in 60 looked perfect and the footage in 30 looked jittery. Then I tried the sequence at 59.97 and it switched. The footage filmed at 30 looked good and the 60 was cropped in. I am so confused! Any advice or suggestions would be greatly appreciated!!
Thanks for your help Michael! The frame rates are 29.97 1920 x 1080 and 59.94 1280 x 720. I did a control click on the clips in final cut and viewed the item properties/format to find this info. The Canon 7d is a DSLR but we use it for video. As for my workflow, the first thing I do is import the footage onto my computer and then drag the clips into mpeg streamclip. I choose apple prores 422 and uncheck the interlaced box. Once this is done I import the .mov files into final cut. The sequence automatically sets itself to whatever clip I drag in first so it originally set as 29.97. When I finished editing wedding video, I export it to a quicktime movie and choose whatever settings match the sequence, in this case apple prores 422 1920 x 1080 30p. Once that is done I use iDVD to burn the discs.
I knew something was wrong when I watched the quicktime movie and all the 30fps footage was jittery and most of the cross dissolves looked strange. That's when I figured out the footage was at two different frame rates. What I don't understand is why whatever the sequence is set at in final cut, the clips of the opposite frame rate look right but the clips set at the matching frame rate don't??? -
I need a little help help with the Spreadsheet 9 ActiveX control
Here's the situation: I want to import data from an Excel file to the MS Office Spreadsheet 9.0 ActiveX control on the LV front page. I can retrieve the data just fine but I can't get it to display in the control on the front page. I can select a range and when I try to write to the Value property I find that I cannot. The problem seems to be the Value property itself cannot handle 2-D data arrays. I can select a 2D range and write a single value which gets written to every cell in the range but when I read the data I get only the first cell in the range and an error if I try to caste the Variant output to a 2D array.
I've noticed a Value2 property for the range when actually working with Excel but I haven't been able to determine where or if it exists for the Spreadsheet 9 control. I've attached a little test program to better show what I'm experiencing/talking about. Anyone have any suggestions on this? It seems like it would be possible or else why have the control there but I haven't found a way around it. Thanks in advance.
Gary D
Attachments:
spreadsheet 9 test.vi 41 KBJack J. wrote:
Hey Gary,
What version of MS Office does the 9.0 ActiveX control come with. I have version 11.0 here. I could get your program working on my computer but I had to reinitialize the activex control to the 11.0 control. I also had to reselect the properties. All the properties are essentially the same except Value. In this ActiveX version, I see the Value2 property (the Value property does not exist). And your method of reading and writing to the Value2 property handles 2D arrays.
If you can tell me what version of Office you are using, I will try to find a computer with that version and try your program.
Jack J.
Applications Engineer
National Instruments
Most of the computers have Office 2000 which uses the Value property and the Spreadsheet 9.0 control. I too have been able to duplicate it ona computer with Office 2000 (Spreadsheet 11.0). I think it may just be a functionality of the Excel version though for some reason if I use Excel and go through the song and dance with the methods and properties, I get to the Value2 property.
After writing that it seems weird that using Excel properties and methods gets me to the point where I can select the Value2 method and read/write accordigly, but with the Spreadsheet 9.0 control (which, I assume is simply embedding Excel in the app) I get to a different set of properties. Perhps Spreadsheet 10 (or 11) is on the computer but not showing up? That's the only sensible conclusion I can come to, though it seems weird for it to not show up on multiple computers which effectively kills that idea anyway.
Anyway. thanks for any help you can provide. -
Need Help With Appleworks Files on New Macbook
Hey Everyone,
I had an old iMac blueberry with OS 9.2 using appleworks. I just bought a MACBOOK and i got iWORK and MS OFFICE 2004 installed on it. How can i get my appleworks files to open up on my new MACBOOK.
please help
-will Appleworks transfer and run on an INTEL based
MAC?
AppleWorks 6 is a "package" that contains both a Classic (Mac OS 9) application and an OS X application. The rest of what's essential to AppleWorks 6's operation is included in the other items inside the AppleWorks 6 folder. AppleWorks will generate all needed items outside this folder when it is run.
The OS X application will operate (and operate well) on the intel based Macs using Rosetta, which is included with these machines. AW 6.2.4 and AW 6.2.9 (IN Mac OS 9, the version numbers on the splash screen and in About AppleWorks for these two are 6.2.3 and 6.2.8) are the most stable and least error prone in OS X; update before or after the transfer if you have earlier versions.
Remember also that your AppleWorks license allows for only one copy to be installed on a computer. If you want to continue to use AppleWorks on the G3 iMac, you'll need to purchase a retail copy to install on the MacBook.
Regards,
Barry -
Help with if statement in cursor and for loop to get output
I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
Here is my cursor:
/*Cursor for Email procedure. It is working Shows userid and the string
You need to update these folders*/
DECLARE
a_user varchar2(200) := null;
v_assigneduser varchar2(20);
v_folderrsn varchar2(200);
v_emailaddress varchar2(60);
v_subject varchar2(200);
Cursor c IS
SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
--MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
WHERE f.foldertype = 'HJ'
AND f.statuscode NOT IN (20, 40)
AND f.folderrsn = fp.folderrsn
AND fp.processrsn = fpa.processrsn
AND vu.userid = fp.assigneduser
AND vu.statuscode = 1
GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
ORDER BY fp.assigneduser;
BEGIN
FOR c1 IN c LOOP
IF (c1.assigneduser = v_assigneduser) THEN
dbms_output.put_line(' ' || c1.folderrsn);
else
dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
END IF;
a_user := c1.assigneduser;
v_assigneduser := c1.assigneduser;
v_folderrsn := c1.folderrsn;
v_emailaddress := c1.emailaddress;
v_subject := 'Subject: Project for';
END LOOP;
END;
The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
emailaddress
Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
v_folderrsn
v_folderrsn
etc
[email protected]......
Subject: 'Project for: ' Jim...'not updated in the last 30 days'
284087
292709
[email protected].....
Subject: 'Project for: ' Kim...'not updated in the last 30 days'
185083
190121
190132
190133
190159
190237
284109
286647
294631
322922
[email protected]....
Subject: 'Project for: Joe...'not updated in the last 30 days'
183332
183336
[email protected]......
Subject: 'Project for: Sam...'not updated in the last 30 days'
183876
183877
183879
183880
183881
183882
183883
183884
183886
183887
183888
This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
JIM......... jim@ aol.com.... 284087............. 9/28/2006.......10/5/2006...........690
JIM......... jim@ aol.com.... 292709............. 3/20/2007.......3/28/2007............516
KIM......... kim@ aol.com.... 185083............. 8/31/2004.......2/9/2006............. 928
KIM...........kim@ aol.com.... 190121............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190132............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190133............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190159............. 2/13/2006.......2/14/2006............923
KIM...........kim@ aol.com.... 190237............. 2/23/2006.......2/23/2006............914
KIM...........kim@ aol.com.... 284109............. 9/28/2006.......9/28/2006............697
KIM...........kim@ aol.com.... 286647............. 11/7/2006.......12/5/2006............629
KIM...........kim@ aol.com.... 294631............. 4/2/2007.........3/4/2008.............174
KIM...........kim@ aol.com.... 322922............. 7/29/2008.......7/29/2008............27
JOE...........joe@ aol.com.... 183332............. 1/28/2004.......4/23/2004............1585
JOE...........joe@ aol.com.... 183336............. 1/28/2004.......3/9/2004.............1630
SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............ 1631
PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............ 48
PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............ 175
NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
[email protected]/27/2004.......3/8/2004............1631
How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
Edited by: user4653174 on Aug 25, 2008 2:40 PManalytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
CASE
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
Incorporating either of these into your query should assist you in returning the desired results. -
I need help with shooting in my flash game for University
Hi there
Ive tried to make my tank in my game shoot, all the code that is there works but when i push space to shoot which is my shooting key it does not shoot I really need help with this and I would appriciate anyone that could help
listed below should be the correct code
//checking if the space bar is pressed and shooting is allowed
if(evt.keyCode == 32 && shootAllow){
//making it so the user can't shoot for a bit
shootAllow = false;
//declaring a variable to be a new Bullet
var newBullet:Bullet = new Bullet();
//changing the bullet's coordinates
newBullet.y = tank_mc.y + tank_mc.width/2 - newBullet.width/2;
newBullet.x = tank_mc.x;
//then we add the bullet to stage
addChild(newBullet);
listed below is my entire code
import flash.display.MovieClip;
//declare varibles to create mines
//how much time before allowed to shoot again
var cTime:int = 0;
//the time it has to reach in order to be allowed to shoot (in frames)
var cLimit:int = 12;
//whether or not the user is allowed to shoot
var shootAllow:Boolean = true;
var minesInGame:uint;
var mineMaker:Timer;
var cursor:MovieClip;
var index:int=0;
var tankMine_mc:MovieClip;
var antiTankmine_mc:MovieClip;
var maxHP:int = 100;
var currentHP:int = maxHP;
var percentHP:Number = currentHP / maxHP;
function initialiseMine():void
minesInGame = 15;
//create a timer fires every second
mineMaker = new Timer(6000, minesInGame);
//tell timer to listen for Timer event
mineMaker.addEventListener(TimerEvent.TIMER, createMine);
//start the timer
mineMaker.start();
function createMine(event:TimerEvent):void
//var tankMine_mc:MovieClip;
//create a new instance of tankMine
tankMine_mc = new Mine();
//set the x and y axis
tankMine_mc.y = 513;
tankMine_mc.x = 1080;
// adds mines to stage
addChild(tankMine_mc);
tankMine_mc.addEventListener(Event.ENTER_FRAME, moveHorizontal);
function moveHorizontal(evt:Event):void{
evt.target.x -= Math.random()*5;
if (evt.target.x >= stage.stageWidth)
evt.target.removeEventListener(Event.ENTER_FRAME, moveHorizontal);
removeChild(DisplayObject(evt.target));
initialiseMine();
//declare varibles to create mines
var atmInGame:uint;
var atmMaker:Timer;
function initialiseAtm():void
atmInGame = 15;
//create a timer fires every second
atmMaker = new Timer(8000, minesInGame);
//tell timer to listen for Timer event
atmMaker.addEventListener(TimerEvent.TIMER, createAtm);
//start the timer
atmMaker.start();
function createAtm(event:TimerEvent):void
//var antiTankmine_mc
//create a new instance of tankMine
antiTankmine_mc = new Atm();
//set the x and y axis
antiTankmine_mc.y = 473;
antiTankmine_mc.x = 1080;
// adds mines to stage
addChild(antiTankmine_mc);
antiTankmine_mc.addEventListener(Event.ENTER_FRAME, moveHorizontal);
function moveHorizontal_2(evt:Event):void{
evt.target.x -= Math.random()*10;
if (evt.target.x >= stage.stageWidth)
evt.target.removeEventListener(Event.ENTER_FRAME, moveHorizontal);
removeChild(DisplayObject(evt.target));
initialiseAtm();
function moveForward():void{
bg_mc.x -=10;
function moveBackward():void{
bg_mc.x +=10;
var tank_mc:Tank;
// create a new Tank and put it into the variable
// tank_mc
tank_mc= new Tank;
// set the location ( x and y) of tank_mc
tank_mc.x=0;
tank_mc.y=375;
// show the tank_mc on the stage.
addChild(tank_mc);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onMovementKeys);
//creates the movement
function onMovementKeys(evt:KeyboardEvent):void
//makes the tank move by 10 pixels right
if (evt.keyCode==Keyboard.D)
tank_mc.x+=5;
//makes the tank move by 10 pixels left
if (evt.keyCode==Keyboard.A)
tank_mc.x-=5
//checking if the space bar is pressed and shooting is allowed
if(evt.keyCode == 32 && shootAllow){
//making it so the user can't shoot for a bit
shootAllow = false;
//declaring a variable to be a new Bullet
var newBullet:Bullet = new Bullet();
//changing the bullet's coordinates
newBullet.y = tank_mc.y + tank_mc.width/2 - newBullet.width/2;
newBullet.x = tank_mc.x;
//then we add the bullet to stage
addChild(newBullet);
if (tank_mc.hitTestObject(antiTankmine_mc))
//tank_mc.gotoAndPlay("hit");
currentHP -= 10;
// remove anti tank mine
removeChild(antiTankmine_mc);
if (tank_mc.hitTestObject(tankMine_mc))
//tank_mc.gotoAndPlay("hit");
currentHP -= 10;
// remove anti tank mine
removeChild(tankMine_mc);
//var maxHP:int = 100;
//var currentHP:int = maxHP;
//var percentHP:Number = currentHP / maxHP;
//Incrementing the cTime
//checking if cTime has reached the limit yet
if(cTime < cLimit){
cTime ++;
} else {
//if it has, then allow the user to shoot
shootAllow = true;
//and reset cTime
cTime = 0;
function updateHealthBar():void
percentHP = currentHP / maxHP;
healthBar.barColor.scaleX = percentHP;
if(currentHP <= 0)
currentHP = 0;
trace("Game Over");
updateHealthBar();USe the trace function to analyze what happens and what fails to happen in the code you showed. trace the conditional values to see if they are set up to allow a shot when you press the key
-
Need help with a Spreadsheet style app
I was just wanting some help in working with developing an app for my iphone... i had previous experience in microsoft visual basic but i don't quite understand this code....
I am in flight school and trying to develop an app that reflects the weight an balance forms we do... I am stuck on how to do basic multiplication and division with xcode, i have viewed several videos and tutorials but they each do things differently and i can't seem to bring it together into this app.
So in the picture below.... what i need help with is how to do the following
from
aircraft weight * arm = Moment outbound
front seats * arm = Moment outbound
to fuel @ landing
"0" fuel weight = aircraft weight + front seats + rear seats+ Baggage 1 + baggage 2
If anyone has any ideas or can lend me some tip or places that deal with stuff like this that would be greatA character class [...] robs some otherwise special codes from their magic. The +, for instance, is interpreted as a plus, not as "repeat ad nauseum" anymore.
So your try [\d+] will simply match either a single digit or a single plus. The solution is to move the + outside of the character class
[\d]+
.. and in that case there is no reason anymore to create a class for just digits, as you got it already.
The period *needs* to be escaped, because otherwise it will match *any* character.
Try this for a change:
\d+\.\d+
Maybe you are looking for
-
With the new Photos app, I can no longer drag and drop photos into other applications as I did with iPhoto. For instance, I have a photo collage app that in the past, I could just drag in the photos I wanted to include. Now, I can DRAG the photos,
-
The new hard drive is in - now what?
Hi everyone, Please bear with me. I've suddenly become possessed by the idea of taking apart a Mac and putting new stuff in there. I am a complete novice in this respect, but I figure everyone has to start somewhere, right? I've got an iBook G3 Clams
-
How does one link a moto x phone to a mac
how does one link a moto x phone to an I Mac?
-
Locally check how Endpoint Protection client gets updates
Hi, I'm in the middle of a large deployment of SCEP (ahem) System Center 2012 Endpoint Protection, and I've come across an interesting question. Is it possible to determine the method the local SCEP client used to obtain it's most recent definitions
-
A dimension table outer join across two databases
I have two databases of the same schema but may have different data that I would like to do comparisons on. For this discussion, each has two tables, Dimension and Fact. I created a common dimension which would show dimension data that exists on both