Using more than 1 xml file
I have this one as file that is going to be doing most of the work eventually. However, I am setting it up so that it uses another class file which is below this one. My problem is that I cannot get this to work so that all four xml files come in before the loading function gets accessed and therefore the output tells me that it cannot access a null reference. Then it loads the variables. How do I get it so that the variables load and then the loading function fires? I have also connected the files so that they can be lloked at and run. The fla is simple just create one and set the document class to Main in the properties area.
Here is the output.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Main/loading()
at Main/init()
at Main()
Then the xmlData parts list.
Main.as
package
import flash.display.*;
import flash.events.*;
import flash.net.*;// brings in functions or classes that are needed
import flash.net.URLLoader;// brings in functions to load in external data
import flash.net.URLRequest;// brings in functions that allow transfer from one variable to another
public class Main extends MovieClip
public var football:XMLClass = new XMLClass("football.xml", "football");
public var baseball:XMLClass = new XMLClass("baseball.xml", "baseball");
public var basketball:XMLClass = new XMLClass("basketball.xml", "basketball");
public var hockey:XMLClass = new XMLClass("hockey.xml", "hockey");
public var pictures01:Loader = new Loader();
public var pictures02:Loader = new Loader();
public var pictures03:Loader = new Loader();
public var pictures04:Loader = new Loader();
public function Main()
init();
public function init()
addChild(pictures01);pictures01.x = 25; pictures01.y = 25; pictures01.visible = true;
addChild(pictures02);pictures02.x = 250; pictures02.y = 25; pictures02.visible = true;
addChild(pictures03);pictures03.x = 475; pictures03.y = 25; pictures03.visible = true;
addChild(pictures04);pictures04.x = 700; pictures04.y = 25; pictures04.visible = true;
loading(4);
loading(4);
public function loading(sent:Number)
trace("got to function loading");
//trace(football.xmlData.football.team[sent], baseball.xmlData.baseball.team[sent], basketball.xmlData.basketball.team[sent],hockey.xmlData.hockey.team[sent]);
trace("got here 1");
pictures01.load(new URLRequest(football.xmlData.team[sent].logo));// sets the b loader to hold the picture of the current book cover
/*trace("got here 2");
pictures02.load(new URLRequest(baseball.xmlData.team[sent].logo));// sets the b loader to hold the picture of the current movie cover
trace("got here 3");
pictures03.load(new URLRequest(basketball.xmlData.team[sent].logo));// sets the b loader to hold the picture of the current poster
trace("got here 4");
pictures04.load(new URLRequest(hockey.xmlData.team[sent].logo));// sets the b loader to hold the picture of the current poster
trace("got here 5");*/
trace("able to end loading function");
}// end of loading function
XMLClass.as
package
import flash.display.*;// brings in functions or classes that are needed
import flash.events.Event;// brings in functions or classes that are needed
import flash.events.MouseEvent;// brings in functions or classes that are needed
import flash.net.*;// brings in functions or classes that are needed
import flash.net.URLLoader;// brings in functions to load in external data
import flash.net.URLRequest;// brings in functions that allow transfer from one variable to another
/* creates the class and sets memory area for the various parts */
public class XMLClass
public var filename:String = new String();
public var mainElement:String = new String();
public var xmlLoader:URLLoader = new URLLoader();// sets up a new variable to load in the XMl data that is only to be used by this class
public var xmlData:XML;//declares the variable that holds the information loaded in the URLLoader that is only to be used by this class
public var xmlList:XMLList = new XMLList();//sets a variable that handles the listing of the XMLdata variable that is only to be used by this class
public function XMLClass(string1:String,string2:String)
filename = string1; trace("got to set filename " + filename);
mainElement = string2; trace("got to set mainElement " + mainElement);
this.xmlLoader.load(new URLRequest(filename)); trace("got to load new URLRequest");// looks for the file named in order to load it and then loads it
this.xmlLoader.addEventListener(Event.COMPLETE, useXML);// sets the xmlLoader variable to be aware of the XML file to see if it has finished getting loaded into the program
public function useXML(e:Event):void
this.xmlData=new XML(e.target.data); trace("set up " + filename + " xmlData");//with the xml download complete populate the xmlData variable
this.xmlList=xmlData.(mainElement); trace("setup " + mainElement + " xmlList");//pass the elements of the xml data file into a list
trace(xmlData.(mainElement).team.*);
Sorry, I did not realize that. I did the download so that you could see what I was
up to. I forget that you're more experienced than I and can see things easier. Anyway, here are the parts that matter. and I would like to know where the connection is going wrong.
This is the custom class that I created.
package
import flash.events.*;
public class MyEventMaker extends EventDispatcher
private static var dispatcher:MyEventMaker = null;
public function MyEventMaker(enforcer:MyEventEnforcer) : void
if(!enforcer)
throw new Error("Direct instantiation is not allowed");
return;
}// end function
public static function GetInstance() : MyEventMaker
if(!dispatcher)
dispatcher= new MyEventMaker (new MyEventEnforcer());
}// end if
return dispatcher;
}// end function
class MyEventEnforcer{}
These are the lines in the XMLClass that is supposed to throw the event.
import MyEventMaker;
MyEventMaker.GetInstance().dispatchEvent(new WorkerEvent());
And this is the part in the actual class program that listens for the custom class event.
myEventMaker.GetInstance().addEventListener(WorkerEvent.UNREACHABLE_EVENT, checkCount);
myEventMaker.GetInstance().addEventListener(WorkerEvent.UNREACHABLE_EVENT, checkCount);
myEventMaker.GetInstance().addEventListener(WorkerEvent.UNREACHABLE_EVENT, checkCount);
myEventMaker.GetInstance().addEventListener(WorkerEvent.UNREACHABLE_EVENT, checkCount);
if(variableCount >= 4){
init();
Similar Messages
-
Am I able to use more than 1 audio file in IDVD?
Am I able to use more than 1 audio file in my IDVD project? I want to have different songs in my subtitles.
Yes. Each menu had an info/settings page that you can add a different audio track to:
When you add a track to a menu the the playing time should be set to 30 seconds or 1 minute. If you leave it at the full lenght that full length will apply towards the 15 minutes total allowed for all menus.
OT -
To check that the ligical file is used more than one program.
HI all,
Is there any way to check that the one logical file are used more than one program.
Ex: one logical file is used in one program. I want to check that the same logical file are used in any other program.Hi To all,
NO ideas... -
LSMW error: Field name '' used more than once in file"
Hi,
I am doing a sample vendor master load with LSMW but while reading data I am getting an error
"Field name '' used more than once in file
'C:\Users\sdurgia\Desktop\LSMW\MM\vendor_master_te
s'."
Not getting proper reason.Can you please guide?
Urgent please help.
BR
SumeetHi,
FYI.
LIFNR
BUKRS
EKORG
KTOKK
NAME1
NAME2
SORT1
SORT2
STREET
HOUSE_NUM1
STR_SUPPL1
STR_SUPPL2
CITY2
CITY1
REGION
POST_CODE1
LAND1
TAXJURCODE
PFACH
PSTL2
REMARK
TEL_NUMBER
TEL_EXTENS
MOB_NUMBER
FAX_NUMBER
FAX_EXTENS
SMTP_ADDR
DEFLT_COMM
KUNNR
VBUND
KONZS
BEGRU
STCD1
STCD2
STCD3
STCD4
SCACD
SFRGR
DLGRP
BANKS
BANKL
BANKN
KOINH
BKONT
LNRZA
XZEMP
AKONT
ZUAWA
FDGRV
BEGRU1
QSSKZ
QSZNR
QSZDT
ALKTN
ZTERM
TOGRU
REPRF
KULTG
ZWELS
ZAHLS
LNRZB
HBKID
TOGRR
EIKTO
WAERS
ZTERM1
INCO1
INCO2
EIKTO1
WEBRE
XERSY
XERSR
VSBED
NAMEK
J_1IPANO
QLAND
LFBW-QSREC
XVERR
FYTYP
STCDT
BKREF
4000048674
2550
M004
DHL EXPRESS (USA) INC
PAY
4000069273
PO BOX 4723
HOUSTON
TX
US
77210-4723
CONTAC: IRMA MURILLO
800-225-5345
281-874-0678
[email protected]
94-3380425
US
11000536
999999
ACCOUNT HOLDER
221300
1
AP VEND
Z011
X
T
B
USD
Z011 -
Can we use more than one Help Provider class in a same project in ADF11g
Hi All,
There are two help providers i want to use .They are "ResourceBundleHelpProvider","OHW Help Provider"
In adf-settings.xml file
<help-provider>
<help-provider-class>oracle.adf.view.rich.help.ResourceBundleHelpProvider</help-provider-class>
<property>
<property-name>baseName</property-name>
<value>com.symmetry.dashboard.panels.Help</value>
</property>
</help-provider>
if try to register both help providers confliction occurs. Is it possible to register and use more than one help provider.?
Thanks in advance.:)Thanks Frank,
In adf-settings.xml file
<help-provider>
<help-provider-class>oracle.adf.view.rich.help.ResourceBundleHelpProvider</help-provider-class>
<property>
<property-name>baseName</property-name>
<value>com.symmetry.dashboard.panels.Help</value>
</property>
</help-provider>
<help-provider prefix="RB_">
<help-provider-class>oracle.help.web.rich.helpProvider.OHWHelpProvider</help-provider-class>
<property>
<property-name>ohwConfigFileURL</property-name>
<value>/myHelpset/config.xml</value>
</property>
<property>
<property-name>baseURI</property-name>
<value>http://127.0.0.1:7101/Dashboard_workflow/myHelpset/%3c/value>
</property>
</help-provider>
I differentiated the help providers with the "prefix" attribute in the <help-provider> tag. So now confliction is not occuring between those.
I used this prefix in the "helpTopicId" property of the adf components like "input text box" . I got the result. :) -
Sending more than 1 file as attachments in FTP
Hi,
Seeking your inputs as how to send more than 1 file ( *.txt, *.jpg etc..)
as attachments using FTP adapter.
Thanks in advance,
Regards,
PavithraThe sender file adapter is configured to pick the normal payload which is specified in the File access parameters, and the additional image file that is to be sent as an attachment is configured under the Additional File(s).The file type will be binary.
<b>
Also refer</b>
http://sapient.xi.googlepages.com/xi-excellentintegration
<b>check this link</b>
how to send image through xi
JPEG Image
<b>refer this doc</b>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
<b>Configuring the sender FILE adapter</b>
The sender file adapter is configured to pick the normal payload (file1.xml), which is specified in the File
access parameters, and the additional image file (file1.jpg) that is to be sent as an attachment is configured
under the Additional File(s) as shown in the screenshot below. The file type would still remain binary.
Since, by default, XI sends payload and attachments in XML format, we need to call two beans, namely the
MessageTransformBean and the PayloadSwapBean to help us is transforming the content to jpeg format
and also change the file extension.
The PayloadSwapBean module is used to replace the application payload of the XI message that holds the
data with another payload which is appended to the message as an attachment. In our case, the payload
would be file1.xml whereas the attachment would be file1.jpg
The swap module is denoted in our scenario with the module key swap. It has two parameters from the
MIME header.
Thanks !!! -
Hi,
I am trying to read data from more than one file at once. The files are different types e.g. one is a text file one is an xml file like so, StudentInformation.txt, CollegeInformation.xml. The files are all stored in one place, in this case on the D drive of
a local computer. I am trying to locate any files in the D drive with a file extension of .txt or of .xml (there may be more than two of these files in the future, so I'm trying to allow for that). Then I want to open all of these files, extract the information
and output all the information in one display window. I want all the information from these two or more files to be displayed together in the display window.
Here is the code so far. It is throwing up errors.
//Load from txt or xml files
private void btnLoad_Click(object sender, RoutedEventArgs e)
IEnumerable<string> fileContents = Directory.EnumerateFiles("D:\\", "*.*", SearchOption.TopDirectoryOnly)
.Select(x => new FileInfo(x))
.Where(x => x.Extension == ".xml" || x.Extension == ".txt")
.Select(file => ParseFile(file));}
private string ParseFile(FileInfo file)
try
using (StreamReader sr = new StreamReader(file.FullName))
string line;
while ((line = sr.ReadLine()) != null)
//Logic here to determine if this is the correct file and append accordingly
lbDisplay.Items.Add(line);
return line;
catch (Exception ex)
// Let the user know what went wrong
MessageBox.Show("The file could not be read: ");
MessageBox.Show(ex.Message);
The error it throws up is:
Error 1
'BookList.MainWindow.ParseFile(System.IO.FileInfo)': not all code paths return a valueThis is the Small Basic programming language so moving to a C# forum.
But you need all paths to return a value, including if an exception is called and it jumps to the catch, perhaps just:
// Let the user know what went wrong
MessageBox.Show("The file could not be read: ");
MessageBox.Show(ex.Message);
return ""; -
CS3 Crashes When trying to open more than 1 file
Hi All,
My work copy of CS3, Photoshop in particular, is crashing every single time I try to open more than one file. I tried trashing the preferences when using WinXP. We couldn't get it to stop crashing upon opening more than 1 file regardless of the open method (Recent docs, File>Open, Drag & Drop, etc)
So then I actually got a new computer (bonus!) and there's Vista Ultimate on it. All was working great until this morning and now sure enough if I try to open more than one file, CRASH...
Does anybody have any ideas on how to fix this? It must not be my machine because I've tried two machines..
Any help is appreciated! Thank you!If your still running vista Click on control and switch to classic view. Look for folder options. On the View tab look for hidden files and folders and select "Show hidden files and folders". Same tab Uncheck " hide protected operating system files". Hit APPLY then ok and close out.This will now show all files on your system.
Right click on my computer and select properties. Click on advance system properties. Click on advance tab. Look for Performance and click on settings.
On the advance tab look for Virtual memory and select "Change" If you only have on hard drive you should see C drive. what you want to do is select "Custom size". Look for recommended file size (mine reads 12285 MB) What you want to do is put that number size in "Initial size" and Also "Maximum Size" and hit the "set" button. What this does is it lets Vista set a set amount of Virtual memory that can be used as RAM. This will help Vista from wanting the same Hard disk space for Virtual Memory and Adobe Scratch Disk Space doing the same thing. You will have to reboot.
Go to start and type in msconfig and hit enter. Go to Start up tabe and uncheck any start up items that do not need to start when you start your computer. While your in that area you can click on the boot tab. Click on Advance options. Look for number of processors and check the box. If you have more then one core processor click on the down arrow and look for the number of processors you have. (for example I have 4 so I selected 4. Hit ok. Then in the other main window hit apply then OK. A screen will pop up telling you to reboot. Selecting more then one processor (if you have more then one) will allow the computer to boot using all processors and maybe notice a faster boot time.
Did you patch CS3 after you installed it on Vista? Also did you defrag your hard drive? -
How can i transfer more than one file from server to client
Hi,
our requirement is transfer more than one files from server to client using the
webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
regards
matjust an idea ...
for this purpose let us put aside security concerns and other potential problems....
-- Get the content of a server directory with Filter and create zip file
1) create a class that implements java.io.FilenameFilter ...
2) define accept() method ...
3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
4) use java.util.Zip to create ZIP file on the server side
-- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
-- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
5) use webutil to transfer file on the client
6) use Java on client side to unzip transferred file
if you think this is not too complicated, you should try ...
Regards,
Vladimir -
Can I use more than one transition when creating a slideshow in IDVD
I want to use more than one transition in IDVD when creating a slideshow, is this possible?
Not so. Under Windows select Photos.
That will show the Media Browser in the lower right hand corner of iMovie.
Use the File ➙ New Project to create a new project. Select the photos from iPhoto you want to create a movie from and drag into the new project area.
From there add your transitions, music, etc. -
Can I use more than one version of Adobe Reader on an iPad, 8.1 touch and 11.1
Can I use more than one version of Adobe Reader on an iPad adobe Reader Touch and Reader 11.1 . . I use Acrobat XI Pro although I had some old files that were stored on adobe.com from a prior version of acrobat 9 student edition.
I guess the same question for my Surface Pro2 Computer might apply, although I gather from what I read that you shouldn't have two versions of reader on a computer.If I may add a qualification: on a device running full Windows 8, you may have both Adobe Reader Touch and Adobe Reader (normal desktop edition). This does not apply to the primitive devices which cannot run desktop apps (running "Windows RT"), and while I may be wrong, I believe that the Surface 2 is such a device.
-
How to burn more than one file on the same dvd?
I would like to burn more than one file in to the same dvd. It seems to me that using Finder I can burn only a file. There is some alternative command? Thank's
Select all the item to burn... right click...
Or
Place all items into a folder and burn the folder to the disc.
Or
Make a Burn Folder in the Finder (place items into the folder) and burn from there to a disc. -
Any way to transcode more than one file at a time?
I've noticed that Final Cut Pro X, when doing transcoding (for Optimizing or creative Proxy media) only processes a single file at a time (whereas it can handle processing up to 5 audio files at once), and is only using about 70% of my processor(s) -- I have a dual core, Core i5 processor, 8GB of RAM, about 500MB used by FCPX during the processing. So this thing should have PLENTY of processor and memory headroom to use, and it should certainly be able to transcode more than one file at a time. Yet it isn't nearly taking full advantage of the processors, or the RAM. Is there any solution to this problem?
--Andy H.Try the 'add folder to library' option under file on the main menu.
-
Html tag to upload more than one file at a time
hai sir this is surendra i need html tag to upload more than one file at a time .I am using
<input type="file" name="">
tag to upload single file at a time i need tag to upload more than one file at a time .
Waiting for your resultYou can add more than one input element of type file.
<input type="file" name="name1">
<input type="file" name="name2"> -
Hp laserjet pro 200 My won't print more than 1 file at a time
My hp laserjet pro 200 m251 won't print more than 1 file at a time. Any ideas?
Hi @nocastaway,
I see by your post that you can't print multiple copies. I can help you with this.
From the application your printing from, go to File, Print, Number of copies select 2. Uncheck Collate. You can now change the number of copies. Collate should now stay unchecked.
Try printing the multiple page document again.
You might have to disable all the startup items, to see if there is another program causing this issue.
How to use MSCONFIG. Click on the Startup tab and disable all.
Test the printer.
Then go back in and enable all from the Startup tab.
Download and run the Print and Scan Doctor if you are still having issues. It will diagnose the issue and might automatically resolve it. Find and fix common printer problems using HP diagnostic tools for Windows?
What applications have you tried?
How is the printer connected? (USB/Ethernet/Wireless)
What operating system are you using? How to Find the Windows Edition and Version on Your Computer.
What were the results when you ran the Print and Scan Doctor? (did it print or scan, any error messages)
If you need further assistance, just let me know.
Have a nice day!
Thank You.
Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
Gemini02
I work on behalf of HP -
How do I work on more than 1 file at a time?
I reloaded dreamweaver mx on a new computer. I used to be
able to move back and forth between more than 1 file viewing code -
or copying code back and forth. Now if I try to open another file -
it makes me close the file i am in first. How do I change that?
Thanks,
PetreaIn Dreamweaver CS3 for Mac users there is a check box that
allows you to view multiple documents in the same DW window with
tabs. Directory Path: Preferences/General/Document Options/Open
Documents in Tabs.
Using this option you can view any document that DW can open
including templates, HTML, CSS documents, and the like. Each is
fully editable as you tab among the open documents.
Maybe you are looking for
-
My Macbook displays ITVplayer with sound, but although I have made all the correct connections to my Panasonic mart TV and my Plusnet Internet works at a a sufficient speed I do not have sound or picture on TV screen, all help welcome
-
Variable weblinks in Flash web gallery title & caption fields
I know that one can put a fixed URL as custom text into a LR flash web gallery title or caption fields and simply click on that field in a gallery and go to that website. However, that URL is fixed and shows up for all images in the gallery. I would
-
Price control V and price determination 3
In the material master record 'price control is given as V and price determination indicator as 3 . With this combination , in the sale order pricing, which price would be picked up by VPRS condition ? Material ledger is activated for this materia
-
i am new to abap hr can anybody send u.s.a payroll material
-
Run-time error in S_ALR_87013611
Hi, Recently we have just upgraded to ECC6.0. One of the reports S_ALR_87013611 is giving run-time errors (unable to set linestyle property) when downloading to Excel using office integration option. We are using Excel 2003 SP3. Surprisingly, this re