How do I load an array of XYgraphs at runtime
Hello everyone. I need to load an array of XYgraphs at runtime. Each array element is a collection, of which one element is an XY graph. Each curve on its own XYgragh is generated as part of an optimization search. The number of curves generated being a function of user input at runtime. Resulting curves may be sorted by the user according to different criteria. Using the sorted curves, the user selects one or more associated sets of operating conditions. So, only 1 curve per graph, as each curve has its own operating conditions which were responsible for its generation (the other members of the collection).
When I try to wire data in a little test vi, I get the listed error message... which seems to be complaining that my data types do in fact match!!??
Thanks a bunch
Terry
Solved!
Go to Solution.
Attachments:
xygrapharrayerror.jpg 230 KB
Excellent. But how may I ask did you know about association with wire color. Is there a list of all wire colors and what data type is associated with them? ...or do you just learn these over time? Thanks much.
Terry
Attachments:
xygrapherrorfix.jpg 229 KB
Similar Messages
-
How to Load 3D Array faster from a DataInputstream
Hi,
I have a task like reading a file using fileinputstream and loading the values into a 3Dimensional array. Before loading the array I need to convert each byte that i read into LittleEndian. I am attaching the code here
public boolean loadIter(int iter) {
try {
picArray = new float[NUMOFIMAGES][HEIGHT][WIDTH];
word = new byte[8];
file = new File(fileName);
/* long start = System.currentTimeMillis( );
*/ fileInput = new FileInputStream(file);
dataInputStream = new DataInputStream(fileInput);
dataInputStream.skipBytes(iter*NUMOFIMAGES*HEIGHT*WIDTH*4);
maxAll = 0;
for (int l = 0; l < NUMOFIMAGES; l++) {
for (int k = 0; k < HEIGHT; k++) {
for (int j = 0; j < WIDTH; j++) {
dataInputStream.readFully(word, 0, 4);
float in = Float.intBitsToFloat((word[3]) << 24 | (word[2] & 0xff) << 16
| (word[1] & 0xff) << 8 | (word[0] & 0xff));
picArray[l][k][j] = in;
if(in > maxAll)
maxAll = in;
fileInput.close();
/* System.out.println(" Elapsed time is "+(System.currentTimeMillis()-start)/ 1000F
+ "Seconds.");
*/ return true;
} catch (IOException ioe) {
System.err.println("initFile ioe " + ioe.getMessage());
return false;
}The above process is taking abt 15sec for 126(NUMOFIMAGES) 212(HEIGHT) & 212(WIDTH) which are constants for me. How can I make this whole thing faster. Are there any other techniques to improve performance?
ThanksCreate your DataInputStream like this:
dataInputStream = new DataInputStream(new BufferedInputStream(fileInput));
Does that help? -
How do you create an array without using a shell on the FP?
I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file. I was thinking an array would be a way to do this, as I have done that in VB. (Saving it as a text file, then reading lines back into the array when the file is read and point the control(s) values/states to the corresponding array element.
So how do I create an array of X dimensions without using a shell on the front panel? Or can someone suggest a better way to accomplish what I am after? (Datalogging doesn't allow for saving the status by a filename, so I
do not want to go that route.)Thanks so much m3nth! This definitely looks like what I was wanting... just not really knowing how to get there.
I'm not sure I follow all the icons. Is that an array (top left with 0 constant) in the top example? And if so, that gets back to part of my original question of how to create an array without using a shell on the FP. Do I follow your diagram correctly?
If I seem a tad green... well I am.
I hope you understand the LabVIEW environment and icons are still very new to me.
Also, I had a response from an NI app. engineer about this problem. He sent me a couple of VI's that he threw together approaching this by using Keys. (I still think you are pointing to the best solution.) I assume he wouldn't mind m
e posting his reply and the VI's for the sake of a good, thorough, Roundtable discussion. So here are his comments with VI's attached:
"I was implementing this exact functionality this morning for an application I'm working on. I only have five controls I want to save, but they are all of different data types. I simply wrote a key for each control, and read back that key on initialization. I simply passed in property node values to the save VI at the end, and passed the values out to property nodes at
the beginning. I've attached my initialize and save VI's for you to view. If you have so many controls that this would not be feasible, you may want to look into clustering the controls and saving the cluster as a datalog file.
Attachments:
Initialize_Settings.vi 55 KB
Save_Settings.vi 52 KB -
Hi, I am trying to load an array with the code below but I keep on getting an "illegal start of expression" message from the compiler and I'm not sure what I'm doing wrong or what to change, any help would be appreciated.
Object[][] data = new Object[itemList.size()][numberOfColumns];
for(int i = 0; i<itemList.size(); i++)
item = itemList.get(i);
for(int j=0; j<numberOfColumns; j++)
data[i][j] = {{new Integer(item.getItemID()), item.getItemName()}}; //this is where the error occurs
}But how would the compiler or runtime know what exact type of array to create?Object[] array;
array = { "This won't work." };Should the compiler create a Object[] or String[] array the second line? The language designers couldn't decide, so it's up to you to specify the type you want:array = new Object[] { "This will." }; -
How can I load my data faster? Is there a SQL solution instead of PL/SQL?
11.2.0.2
Solaris 10 sparc
I need to backfill invoices from a customer. The raw data has 3.1 million records. I have used pl/sql to load these invoices into our system (dev), however, our issue is the amount of time it's taking to run the load - effectively running at approx 4 hours. (Raw data has been loaded into a staging table)
My research keeps coming back to one concept: sql is faster than pl/sql. Where I'm stuck is the need to programmatically load the data. The invoice table has a sequence on it (primary key = invoice_id)...the invoice_header and invoice_address tables use the invoice_id as a foreign key. So my script takes advantage of knowing the primary key and uses that on the subsequent inserts to the subordinate invoice_header and invoice_address tables, respectively.
My script is below. What I'm asking is if there are other ideas on the quickest way to load this data...what am I not considering? I have to load the data in dev, qa, then production so the sequences and such change between the environments. I've dummied down the code to protect the customer; syntax and correctness of the code posted here (on the forum) is moot...it's only posted to give the framework for what I currently have.
Any advice would be greatly appreciated; how can I load the data faster knowing that I need to know sequence values for inserts into other tables?
DECLARE
v_inv_id invoice.invoice_id%TYPE;
v_inv_addr_id invoice_address.invoice_address_id%TYPE;
errString invoice_errors.sqlerrmsg%TYPE;
v_guid VARCHAR2 (128);
v_str VARCHAR2 (256);
v_err_loc NUMBER;
v_count NUMBER := 0;
l_start_time NUMBER;
TYPE rec IS RECORD
BILLING_TYPE VARCHAR2 (256),
CURRENCY VARCHAR2 (256),
BILLING_DOCUMENT VARCHAR2 (256),
DROP_SHIP_IND VARCHAR2 (256),
TO_PO_NUMBER VARCHAR2 (256),
TO_PURCHASE_ORDER VARCHAR2 (256),
DUE_DATE DATE,
BILL_DATE DATE,
TAX_AMT VARCHAR2 (256),
PAYER_CUSTOMER VARCHAR2 (256),
TO_ACCT_NO VARCHAR2 (256),
BILL_TO_ACCT_NO VARCHAR2 (256),
NET_AMOUNT VARCHAR2 (256),
NET_AMOUNT_CURRENCY VARCHAR2 (256),
ORDER_DT DATE,
TO_CUSTOMER VARCHAR2 (256),
TO_NAME VARCHAR2 (256),
FRANCHISES VARCHAR2 (4000),
UPDT_DT DATE
TYPE tab IS TABLE OF rec
INDEX BY BINARY_INTEGER;
pltab tab;
CURSOR c
IS
SELECT billing_type,
currency,
billing_document,
drop_ship_ind,
to_po_number,
to_purchase_order,
due_date,
bill_date,
tax_amt,
payer_customer,
to_acct_no,
bill_to_acct_no,
net_amount,
net_amount_currency,
order_dt,
to_customer,
to_name,
franchises,
updt_dt
FROM BACKFILL_INVOICES;
BEGIN
l_start_time := DBMS_UTILITY.get_time;
OPEN c;
LOOP
FETCH c
BULK COLLECT INTO pltab
LIMIT 1000;
v_err_loc := 1;
FOR i IN 1 .. pltab.COUNT
LOOP
BEGIN
v_inv_id := SEQ_INVOICE_ID.NEXTVAL;
v_guid := 'import' || TO_CHAR (CURRENT_TIMESTAMP, 'hhmissff');
v_str := str_parser (pltab (i).FRANCHISES); --function to string parse - this could be done in advance, yes.
v_err_loc := 2;
v_count := v_count + 1;
INSERT INTO invoice nologging
VALUES (v_inv_id,
pltab (i).BILL_DATE,
v_guid,
'111111',
'NONE',
TO_TIMESTAMP (pltab (i).BILL_DATE),
TO_TIMESTAMP (pltab (i).UPDT_DT),
'READ',
'PAPER',
pltab (i).payer_customer,
v_str,
'111111');
v_err_loc := 3;
INSERT INTO invoice_header nologging
VALUES (v_inv_id,
TRIM (LEADING 0 FROM pltab (i).billing_document), --invoice_num
NULL,
pltab (i).BILL_DATE, --invoice_date
pltab (i).TO_PO_NUMBER,
NULL,
pltab (i).net_amount,
NULL,
pltab (i).tax_amt,
NULL,
NULL,
pltab (i).due_date,
NULL,
NULL,
NULL,
NULL,
NULL,
TO_TIMESTAMP (SYSDATE),
TO_TIMESTAMP (SYSDATE),
PLTAB (I).NET_AMOUNT_CURRENCY,
(SELECT i.bc_value
FROM invsvc_owner.billing_codes i
WHERE i.bc_name = PLTAB (I).BILLING_TYPE),
PLTAB (I).BILL_DATE);
v_err_loc := 4;
INSERT INTO invoice_address nologging
VALUES (invsvc_owner.SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
v_inv_id,
'BLAH INITIAL',
pltab (i).BILL_DATE,
NULL,
pltab (i).to_acct_no,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
SYSTIMESTAMP,
NULL);
v_err_loc := 5;
INSERT INTO invoice_address nologging
VALUES ( SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
v_inv_id,
'BLAH',
pltab (i).BILL_DATE,
NULL,
pltab (i).TO_ACCT_NO,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
SYSTIMESTAMP,
NULL);
v_err_loc := 6;
INSERT INTO invoice_address nologging
VALUES ( SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
v_inv_id,
'BLAH2',
pltab (i).BILL_DATE,
NULL,
pltab (i).TO_CUSTOMER,
pltab (i).to_name,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
SYSTIMESTAMP,
NULL);
v_err_loc := 7;
INSERT INTO invoice_address nologging
VALUES ( SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
v_inv_id,
'BLAH3',
pltab (i).BILL_DATE,
NULL,
'SOME PROPRIETARY DATA',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
SYSTIMESTAMP,
NULL);
v_err_loc := 8;
INSERT
INTO invoice_event nologging (id,
eid,
root_eid,
invoice_number,
event_type,
event_email_address,
event_ts)
VALUES ( SEQ_INVOICE_EVENT_ID.NEXTVAL,
'111111',
'222222',
TRIM (LEADING 0 FROM pltab (i).billing_document),
'READ',
'some_user@some_company.com',
SYSTIMESTAMP);
v_err_loc := 9;
INSERT INTO backfill_invoice_mapping
VALUES (v_inv_id,
v_guid,
pltab (i).billing_document,
pltab (i).payer_customer,
pltab (i).net_amount);
IF v_count = 10000
THEN
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS
THEN
errString := SQLERRM;
INSERT INTO backfill_invoice_errors
VALUES (
pltab (i).billing_document,
pltab (i).payer_customer,
errString || ' ' || v_err_loc
COMMIT;
END;
END LOOP;
v_err_loc := 10;
INSERT INTO backfill_invoice_timing
VALUES (
ROUND ( (DBMS_UTILITY.get_time - l_start_time) / 100,
2)
|| ' seconds.',
(SELECT COUNT (1)
FROM backfill_invoice_mapping),
(SELECT COUNT (1)
FROM backfill_invoice_errors),
SYSDATE
COMMIT;
EXIT WHEN c%NOTFOUND;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
errString := SQLERRM;
INSERT INTO backfill_invoice_errors
VALUES (NULL, NULL, errString || ' ' || v_err_loc);
COMMIT;
END;Hello
You could use insert all in your case and make use of sequence.NEXTVAL and sequence.CURRVAL like so (excuse any typos - I can't test without table definitions). I've done the first 2 tables, so it's just a matter of adding the rest in...
INSERT ALL
INTO invoice nologging
VALUES ( SEQ_INVOICE_ID.NEXTVAL,
BILL_DATE,
my_guid,
'111111',
'NONE',
CAST(BILL_DATE AS TIMESTAMP),
CAST(UPDT_DT AS TIMESTAMP),
'READ',
'PAPER',
payer_customer,
parsed_francises,
'111111'
INTO invoice_header
VALUES ( SEQ_INVOICE_ID.CURRVAL,
TRIM (LEADING 0 FROM billing_document), --invoice_num
NULL,
BILL_DATE, --invoice_date
TO_PO_NUMBER,
NULL,
net_amount,
NULL,
tax_amt,
NULL,
NULL,
due_date,
NULL,
NULL,
NULL,
NULL,
NULL,
SYSTIMESTAMP,
SYSTIMESTAMP,
NET_AMOUNT_CURRENCY,
bc_value,
BILL_DATE)
SELECT
src.billing_type,
src.currency,
src.billing_document,
src.drop_ship_ind,
src.to_po_number,
src.to_purchase_order,
src.due_date,
src.bill_date,
src.tax_amt,
src.payer_customer,
src.to_acct_no,
src.bill_to_acct_no,
src.net_amount,
src.net_amount_currency,
src.order_dt,
src.to_customer,
src.to_name,
src.franchises,
src.updt_dt,
str_parser (src.FRANCHISES) parsed_franchises,
'import' || TO_CHAR (CURRENT_TIMESTAMP, 'hhmissff') my_guid,
i.bc_value
FROM BACKFILL_INVOICES src,
invsvc_owner.billing_codes i
WHERE i.bc_name = src.BILLING_TYPE;Some things to note
1. Don't commit in a loop - you only add to the run time and load on the box ultimately reducing scalability and removing transactional integrity. Commit once at the end of the job.
2. Make sure you specify the list of columns you are inserting into as well as the values or columns you are selecting. This is good practice as it protects your code from compilation issues in the event of new columns being added to tables. Also it makes it very clear what you are inserting where.
3. If you use WHEN OTHERS THEN... to log something, make sure you either rollback or raise the exception. What you have done in your code is say - I don't care what the problem is, just commit whatever has been done. This is not good practice.
HTH
David
Edited by: Bravid on Oct 13, 2011 4:35 PM -
I have hierarchy data in R/3 side how will i load that data from R/3 to BW
Hi all,
i have my hierarchy data in the R/3 side how will i load that data from R/3 to BW side
Regard
Kiran KumarHi Kiran,
Here is the procedure:
1. In the Data Warehousing Workbench under Modeling, select the InfoSource tree.
2. Select the InfoSource (with direct update) for the InfoObject, to which you want to load the hierarchy.
3. Choose Additional Functions® Create Transfer Rules from the context menu of the hierarchy table object for the InfoObject. The Assign Source System dialog box appears.
4. Select the source system from which the hierarchy is to be loaded. The InfoSource maintenance screen appears.
○ If the DataSource only supports the transfer method IDoc, then only the transfer structure is displayed (tab page DataSource/Transfer Structure).
○ If the DataSource also supports transfer method PSA, you can maintain the transfer rules (tab page Transfer Rules).
If it is possible and useful, we recommend that you use the transfer method PSA and set the indicator Expand Leaf Values and Node InfoObjects. You can then also load hierarchies with characteristics whose node name has a length >32.
5. Save your entries and go back. The InfoSource tree for the Data Warehousing Workbench is displayed.
6. Choose Create InfoPackage from the context menu (see Maintaining InfoPackages). The Create InfoPackage dialog box appears.
7. Enter the description for the InfoPackage. Select the DataSource (data element Hierarchies) that you require and confirm your entries.
8. On the Tab Page: Hierarchy Selection, select the hierarchy that you want to load into your BI system.
Specify if the hierarchy should be automatically activated after loading or be marked for activation.
Select an update method (Full Update, Insert Subtree, Update Subtree).
If you want to load a hierarchy from an external system with BAPI functionality, make BAPI-specific restrictions, if necessary.
9. If you want to load a hierarchy from a flat file, maintain the tab page: external data.
10. Maintain the tab page: processing.
11. Maintain the tab page: updating.
12. To schedule the InfoPackage, you have the following options:
○ (Manually) in the scheduler, see Scheduling InfoPackages
○ (Automatically) using a process chain (see Loading Hierarchies Using a Process Chain)
When you upload hierarchies, the system carries out a consistency check, making sure that the hierarchy structure is correct. Error messages are logged in the Monitor. You can get technical details about the error and how to correct it in the long text for the respective message.
For more info visit this help pages on SAP Help:
http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a6729e07211d2acb80000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/3d/320e3d89195c59e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6729e07211d2acb80000e829fbfe/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4dae0795-0501-0010-cc96-fe3a9e8959dc
Cheers,
Habeeb -
How can i get a array from a JSP ?
Hi all,
i have a STORED PROCEDURE like this:
static public void getMyArray(double [] xx) {
for (int i=0; i<myarr.length;i++){
myarr=3.145*i;
xx=myarr;
return ;
how can i get the array with XSQL and transform with a XSL ?
Is this at all possible?
Thanks for any help.
Achimu r asking how ca u get array from jsp?
and u r asking xsql ...some stuff i couldnot understand .can u repeat the question properly?
null -
How to ask for an array and how to save the values
I'm supposed to be learning the differences between a linear search and a binary search, and the assignment is to have a user input an array and search through the array for a given number using both searches. My problem is that I know how to ask them how long they want their array to be, but I don't know how to call the getArray() method to actually ask for the contents of the array.
My code is as follows:
import java.util.Scanner;
import java.util.ArrayList;
public class Main
private static Scanner input = new Scanner(System.in);
public static void main (String args[])
//creates ArrayList
int List[];
System.out.println("How long would you like the array to be?");
int arrayLength = input.nextInt();
//Initializes array list
List = new int [arrayLength];
System.out.println("Please enter the first value of the array");
public static void getArray(int List[], int arrayLength)
for(int i=0; i < arrayLength; i++) {
System.out.println("Enter the next value for array");
List[i] = input.nextInt();
public static void printArray(int List[])
for(int i=0; i < List.length; i++)
System.out.print(List[i] + " ");
public class search
public static int binarySearch(int anArray[], int first, int last, int value)
int index;
if(first > last) {
index = -1;
else {
int mid = (first + last)/2;
if(value == anArray[mid]) {
index = mid; //value found at anArray[mid]
else if(value < anArray[mid]) {
//point X
index = binarySearch(anArray, first, mid-1, value);
else {
//point Y
index = binarySearch(anArray, mid+1, last, value);
} //end if
} //end if
return index;
//Iterative linear search
public int linearSearch(int a[], int valueToFind)
//valueToFind is the number that will be found
//The function returns the position of the value if found
//The function returns -1 if valueToFind was not found
for (int i=0; i<a.length; i++) {
if (valueToFind == a) {
return i;
return -1;I made the changes. Two more questions.
1.) Just for curiosity, how would I have referenced those methods (called them)?
2.) How do I call the searches?
import java.util.Scanner;
import java.util.ArrayList;
public class Main
private static Scanner input = new Scanner(System.in);
public static void main (String args[])
//creates ArrayList
int List[];
System.out.println("How many values would you like the array to have?");
int arrayLength = input.nextInt();
//Initializes array list
List = new int [arrayLength];
//Collects the array information
for(int i=0; i < arrayLength; i++) {
System.out.println("Enter a value for array");
List[i] = input.nextInt();
//Prints the array
System.out.print("Array: ");
for(int i=0; i < List.length; i++)
System.out.print(List[i] + " ");
//Asks for the value to be searched for
System.out.println("What value would you like to search for?");
int temp = input.nextInt();
System.out.println(search.binarySearch()); //not working
} -
How can I convert an array off byte into an Object ?
Hi folks...
I�m developing an application that comunicates a PDA and a computer via Wi-Fi. I�m using a DataStream ( Input and Output ) to receive / send information from / to the computer. Most off the data received from him is in the byte[] type...
How can I convert an array off byte ( byte[] ) into an Object using MIDP 2.0 / CLDC 1.1 ?
I found on the web 2 functions that made this... but it uses a ObjectOutputStream and ObjectInputStream classes that is not provided by the J2ME plataform...
How can I do this ?
Waiting answers
Rodrigo KerkhoffThere are no ObjectOutputStream and ObjectInputStream classes in CLDC. You must know what you are writing to and reading from the DataStream. You should write the primitives like int, String to the DataOutputstream at one end and read those in exactly the same sequence at the outher end using readInt(), readUTF() methods.
-
I am reading a signal from a USB-8451. This signal is stored as an array where each element represents a bit in the signal, but is stored in the array as a byte. How do I convert this array into a single Hex number. I attatched what I have so far, there are a few extra things to help me see what ia going on. One code uses Queue and the other uses arrays, let me know if you can help.
Attachments:
845x_EEPROMarrays.vi 27 KB
845x_EEPROM.vi 26 KBmkssnwbrd wrote:
... so we can't introduce any other forms of signals or power into the circuit other than what the circuit already has. Trithfully I don't really know how I2C devices work, but my mentor here says that we can't use an I2C method becuase it will introduce voltage into the circuit and may damage out TCON chip.
That makes absolutely no sense. What do you think is happening when you write the digital lines? You're setting a pin high. That voltage is being generated by the 8451x. I think you're not understanding what your mentor is saying. If it's an I2C device then you should be able to use the I2C function to simply talk to it. You still have not indicated what the device is, so there's little more I can say about that aspect of it.
As far as the conversion is concerned, you basically need loop through your array of "bits", taking 16 at time since you said you have 16-bit values. It's not clear from your code whether your eventual goal is to get a numeric value or a string. This does not appear to be a subVI, so a simply numeric indicator formatted to display in hex format should be quite adequate. The array you are generating is an array of rings, whose datatype is I32, but they will have values of 0 or 1. You can use the example just posted, or you can use the attached variation.
Attachments:
Bits to Hex 2.vi 17 KB -
How can I load an external SWF into a movie clip that's inside other movie clip?
Hi.
I creating my first flash (actionscript 3.0) website but I'm
stuck with a visual effect I want to create.
I have a window on my website called contentWindow. Every
time you click a button this window is supposed to leave the stage,
load the requested content and return to the stage.
The sliding window is a movie clip with 83 frames, 21 to
enter the stage, 21 to leave the stage again, 20 for nothing (its
just to simulate the loading time) and 21 to return to the stage.
Now my goal is, when the user clicks on a navigation button,
the window exits the stage, loads an external SWF with the content,
and then returns to the stage.
I've the "window" movie clip with an instance name of
"contentWindow". Inside there is another movie clip with an
instance name of "contentLoader". The content that the user
requested should appear inside the "contentLoader".
Now, when the contentWindow leaves the stage, I get this
error message:
quote:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at rwd_fla::MainTimeline/trigger()
If I switch
"contentWindow.contentLoader.addChild(navLoader);" for
"contentWindow.addChild(navLoader);" it works fine, but the
external SWF doesn't move with the window.
How can I load an external SWF into a movie clip that's
inside other movie clip?Hi,
Recently, I have been putting together a flash presentation.
And I am just wondering if the following might help you, in your
communication with the said swf file:
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
onComplete);
function onComplete(event:Event):void
event.target.content.thinggy_mc.y -= 100;
Not the best example, but this allows you to target a mc
within an external swf file. I think if you look up this code, you
will have an answer ;)
Kind Regards,
Boxing Boom -
I guess I'll show you what I am trying to do rather and then explain it
public class arraycalc
int[] dog;
public void arraycalc()
dog = new int[2];
public void setSize(int size)
dog[1] = size;
public int getSize()
return dog[1];
This gives me a null pointer exception...
How can I use my array from other methods?You have to make the array static. :)
Although I must admit, this is rather bad usage. What you want to do is use an object constructor to make this class an object type, and then create the array in your main class using this type, and then call the methods from this class to modify your array. Creating the array inside the other method leads to a whole bunch of other stuff that's ... well, bad. :)
Another thing: Because you're creating your array inside this class and you want to call your array from another class, you need to make the array static; to make it static, you must make your methods static. And according to my most ingenious computer science teacher, STATIC METHODS SUCK. :D
So, if you want to stick with your layout, it would look like:
public class arraycalc
static int[] dog;
public static void arraycalc()
dog = new int[2];
public static void setSize(int size)
dog[1] = size;
public static int getSize()
return dog[1];
}But I must warn you, that is absolutely horrible code, and you shouldn't use it. In fact, I don't even know why I posted it.
You should definitely read up on OOP, as this problem would be better solved by creating a new object type. -
I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open? Next in Elements 11, how do I load and print different pictures and different sizes options on the same page?
Thanks,
Shirsbmgrams wrote:
I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open?
See here:
Reading PhotoDeluxe PDD Files -
How do I load photos & Music to my iPhone 3G from iPhoto /iTunes?
How do I load photos & Music to my iPhone 3G from iPhoto /iTunes?
If I want to use photos as wallpaper on the phone do they have to be resized or can I just load them?With your iphone plugged into itunes go to the tables for music, photos, etc and set to sync with the album,playlist you want.
Sounds like you might need to read the owners manual:
http://manuals.info.apple.com/enUS/iPhone_UserGuide.pdf -
How can we load apps without creating an Apple ID for each employee?
We have at least two apps that we'd like to distribute to our company iPads. We would like to hand the employee the iPad with everything loaded. We don't care if they create their own Apple ID and manage it after the fact but when the employee gets the iPad, it should have the apps they require.
How do we load these apps without creating an Apple ID for each employee? If we load the apps from App Store with our Apple ID, the app requires that username and password whenever there is an update. The employee can not update the app without our username and password or they have to delete and reinstall the app with their own credentials. Is there a way to load an app so that it doesn't require the credentials of the person that loaded it whenever there's an update?Turn on computer.
Open itunes.
Connect a device.
Select what you want to sync.
Sync
Repeat for the otehr device
Maybe you are looking for
-
hi can any one send me the material Regarding BADI & OO ABAP Concepts........ Thanks in advance........ my mail id is: <b>[email protected]</b> Regards, Ravi
-
Elements 9 printing problems with epson 3880
HI All: Elements was working fine with epson 3880. Problems developed: 1. Would print color pics in black and white only while in Editor; color pics printed ok in Organizer 2. Now Print Preview does not work in either Editor or Organizer 3. Now canno
-
Naming conventions/hierarchies for products and software components
Hi, Can someone please advise what they have found works well for naming products and software components and recommended hierarchies? Following the SAP model it seems to make sense to have a custom product for each SAP product when we are developing
-
Help!! My Power Mac G5 won't start up!!
I was working on my computer when all of a sudden everything froze. I tried all the key commands and no response. So, I held the start button until it shut down. Then when I tried to start it back up again after a few minutes, by pushing the start bu
-
Hi, I have OSX Lion and have been backing up to Time Machine, I now want to do a clean install of Snow Leopard (not from backup), but can I restore my data (iTunes Library, Photo's, files etc.) to Snow Leopard from a Time Machine backup made on OSX L