[Flashcoders] RE: Package problem in Flex
Ignore this message. I've just seen the error of my ways. I shouldn't be nesting the function inside the constructor function. Knew it must be something obvious. -Original Message----- From: Cheetham, Marcus Sent: 24 July 2009 11:17 To: 'Flash Coders List' Subject: Package problem in Flex I'm importing an AS3 class into my Flex app. It imports fine and the trace message in the constructor works ok. However, when I try to create additional functions (Hello) I get the message : "1114: The public attribute can only be used inside a package." This is despite the fact that I have created a package. Any idea what I'm doing wrong? Here's the class code: - package com.pearson.utils { public class PlaceItemsInSeries { public function PlaceItemsInSeries() { trace("Place Items in Series Class"); public function Hello():void { trace("Hello"); } } } } - In the Flex module I'm importing the class using this code: import com.pearson.utils.PlaceItemsInSeries; I'm calling the function later on using this code: PlaceItemsInSeries.Hello(); It doesn't work due to the package error This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Package problem in Flex
I'm importing an AS3 class into my Flex app. It imports fine and the trace message in the constructor works ok. However, when I try to create additional functions (Hello) I get the message : "1114: The public attribute can only be used inside a package." This is despite the fact that I have created a package. Any idea what I'm doing wrong? Here's the class code: - package com.pearson.utils { public class PlaceItemsInSeries { public function PlaceItemsInSeries() { trace("Place Items in Series Class"); public function Hello():void { trace("Hello"); } } } } - In the Flex module I'm importing the class using this code: import com.pearson.utils.PlaceItemsInSeries; I'm calling the function later on using this code: PlaceItemsInSeries.Hello(); It doesn't work due to the package error This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Strange characters added to file when savingfromFlex/AIR using fileStream
writeUTFBytes works perfectly. thanks for the help. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak Sent: 03 July 2009 13:48 To: Flash Coders List Subject: Re: [Flashcoders] Strange characters added to file when savingfromFlex/AIR using fileStream Use FileStream.writeUTFBytes() var xml:XML = burger 3.95 fries 1.45 ; var str:String = '' + File.lineEnding; str += xml.toXMLString(); var fs:FileStream = new FileStream(); fs.open(outputFile, FileMode.WRITE); fs.writeUTFBytes(str); fs.close(); regards, Muzak - Original Message ----- From: "Cheetham, Marcus" To: "Flash Coders List" Sent: Friday, July 03, 2009 12:39 PM Subject: [Flashcoders] Strange characters added to file when saving fromFlex/AIR using fileStream > I'm using fileStream to save a text file. This works OK, but introduces > some strange characters at the beginning of the saved text. > I'm saving XML data. I've kept this as an XML object and also converted > it to string first -- same thing always happens. > > Any idea how I can get rid of these characters? > > Thanks, Marcus. > > This is what I end up with (note the 'g at the beginning) : > > 'g > >burger >3.95 > > >fries >1.45 > > > > This is the Flex 3 code: > > http://www.adobe.com/2006/mxml"; > layout="absolute" activate="createXML()"> > > > > > > > > > > > > > > > This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. > Registered in England and Wales with company number 53723 > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Strange characters added to file when saving from Flex/AIR using fileStream
I'm using fileStream to save a text file. This works OK, but introduces some strange characters at the beginning of the saved text. I'm saving XML data. I've kept this as an XML object and also converted it to string first -- same thing always happens. Any idea how I can get rid of these characters? Thanks, Marcus. This is what I end up with (note the 'g at the beginning) : 'g burger 3.95 fries 1.45 This is the Flex 3 code: http://www.adobe.com/2006/mxml"; layout="absolute" activate="createXML()"> This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Strange characters added to file when saving from AIR using fileStream
I'm using fileStream to save a text file. This works OK, but introduces some strange characters at the beginning of the saved text. I'm saving XML data. I've kept this as an XML object and also converted it to string -- same thing always happens. Any idea how I can get rid of these characters? Thanks, This is what I end up with (note the 'g at the beginning) : 'g burger 3.95 fries 1.45 This is the Flex 3 code: http://www.adobe.com/2006/mxml"; layout="absolute" activate="createXML()"> This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders