Re: [Flashcoders] Some feedback on a coding design question

2008-04-02 Thread Jiri Heitlager
Thank you for the reply. I will take a look at the state Pattern. Reading your post, I does look a bit like what I proposed. In the state pattern, I would probably create the layout and the types of buttonsets for the panel create in a object. The state of the panel then determines wich state

Re: [Flashcoders] Multiple SWFs (50) in one html page dramaticly increase memory ?

2008-04-02 Thread Flap Flap
2008/4/1, Bob Wohl [EMAIL PROTECTED]: Are you saying that you are loading 50 images into 1 swf? OR 50 images into 50 swfs and loading those into 1 swf? OR 50 swfs embeded into a browser? We have the same swf embed 50 time in a php page Each of them load a different image. Thanks --

Re: [Flashcoders] An error I cant iron out...

2008-04-02 Thread Rich Shupe
It's hard to guess at this without seeing the code. Typically, this happens when you're trying to instantiate something that isn't a class or is a circular or conflicting reference. Something like var myJunk:NotAClass = new NotAClass(); or var mc:MovieClip = new MovieClip(); mc = new

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread Meinte van't Kruis
so how does it work internally for displayObjects? Can a developer emulate this behaviours somehow?(cant imagine it since target and currentTarget are readonly) On Tue, Apr 1, 2008 at 10:01 PM, Merrill, Jason [EMAIL PROTECTED] wrote: Well, you still haven't convinced me it isn't kludy, but no

Re: [Flashcoders] Multiple SWFs (50) in one html page dramaticly increase memory ?

2008-04-02 Thread Glen Pike
Is this happening on Firefox??? Have you tried running on a couple of other browsers to compare? Have you tried showing 25 SWF's to see if memory usage is approx half? Flap Flap wrote: 2008/4/1, Bob Wohl [EMAIL PROTECTED]: Are you saying that you are loading 50 images into 1 swf? OR 50

[Flashcoders] Access

2008-04-02 Thread Stuart (FunkDaWeb)
Hello, I'm having some trouble with AS3, basically if I create a movieclip using the Flash IDE and give it an instance name of mc_one, I'm unsure how to access it from an external actionscript class. Currently on the root timeline I have... var _mainClass:mainClass = new mainClass(); Which

Re: [Flashcoders] Multiple SWFs (50) in one html page dramaticly increase memory ?

2008-04-02 Thread Kenneth Kawamoto
To me, having 50 Flash Player instances running concurrently does not sound like the best solution. Can it be just one SWF with 50 display objects instead? Kenneth Kawamoto http://www.materiaprima.co.uk/ Flap Flap wrote: 2008/4/1, Bob Wohl [EMAIL PROTECTED]: Are you saying that you are

Re: [Flashcoders] Access

2008-04-02 Thread Kenneth Kawamoto
Why don't you set your MainClass as document class? Kenneth Kawamoto http://www.materiaprima.co.uk/ Stuart (FunkDaWeb) wrote: Hello, I'm having some trouble with AS3, basically if I create a movieclip using the Flash IDE and give it an instance name of mc_one, I'm unsure how to access it

Re: [Flashcoders] Access

2008-04-02 Thread Glen Pike
Hi, Try tracing in the onLoad function: public class mainClass { public var mc_one:MovieClip; public function mainClass() { trace(mc_one); // Outputs null } private function onLoad():void { trace(mc_one); } } Glen Stuart (FunkDaWeb)

Re: [Flashcoders] Access

2008-04-02 Thread Stuart (FunkDaWeb)
Hi tried this but didn't work! here is my code in its most simple form... package { import flash.display.MovieClip; public class mainClass extends MovieClip { // Instantiate our classes public var banner:imageLib = new imageLib(); public function mainClass() {

Re: [Flashcoders] Access

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)
have you tried without the line public var mc_one:MovieClip;? it's my understanding that instantiating it by physically dragging it out of the library and giving it an instance name is the declaration - the way you're doing it would give a local variable the name with no value, hence

Re: [Flashcoders] Access

2008-04-02 Thread Glen Pike
You may have to wait until your MovieClip is initialised / on the stage before you do things with child clips. http://www.senocular.com/pub/kirupa/as3tips_p6.html There is a tip in there about the DocumentClass and listening for the ADDED event. There is also an ADDED_TO_STAGE event for

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread EECOLOR
which is mouseChildren = false. In my humble opinion I do not think this is what he needs. He should not be referencing target, but instead he should reference currentTarget. If you are adding a listener, the handlers e.currentTarget will point to the object that you added the listener to,

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread EECOLOR
This behaviour can not emulated precisely because there is no way for us to set the target and currentTarget properties. This is done by internal EventDispatcher code. The EventDispatcher code works something like this: - check if the target property of the event has been set, if not set it -

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread Muzak
So in general, where you in AS2 were using e.target you should now use e.currentTarget. +1 ;-) Must read: Event propagation http://livedocs.adobe.com/flex/3/html/events_08.html regards, Muzak - Original Message - From: EECOLOR [EMAIL PROTECTED] To: Flash Coders List

Re: [Flashcoders] some dying logic ...

2008-04-02 Thread EECOLOR
*if (this.basicNews != null) { this.basicNews.removeEventListener(RepeaterEvent.CLICK, this.onNewsClicked); this.removeChild(this.basicNews); this.basicNews.die(); this.basicNews = null; }* In the above code I do not see why you would need any more then the following lines:

Re: [Flashcoders] some dying logic ...

2008-04-02 Thread Meinte van't Kruis
granted that the eventListener was added with a weak reference On Wed, Apr 2, 2008 at 3:35 PM, EECOLOR [EMAIL PROTECTED] wrote: *if (this.basicNews != null) { this.basicNews.removeEventListener(RepeaterEvent.CLICK, this.onNewsClicked); this.removeChild(this.basicNews);

[Flashcoders] how to check if child exists

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)
hmmm - i'm a little stuck on this i'm trying to create a pop-up (will tween but i want to get it working first) but i want it to kill any previous one that's up - how would i go about this please? here's my current code: CODE private function

Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Kenneth Kawamoto
Place outside of the function - private var eventList:Sprite; Kenneth Kawamoto http://www.materiaprima.co.uk/ Allandt Bik-Elliott (Receptacle) wrote: hmmm - i'm a little stuck on this i'm trying to create a pop-up (will tween but i want to get it working first) but i want it to kill any

Re: [Flashcoders] some dying logic ...

2008-04-02 Thread Cedric Muller
this is how the eventListener is added: this.basicNews.addEventListener(RepeaterEvent.CLICK, this.onNewsClicked, false, 0, true); granted that the eventListener was added with a weak reference On Wed, Apr 2, 2008 at 3:35 PM, EECOLOR [EMAIL PROTECTED] wrote: *if (this.basicNews != null) {

Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)
that's actually helped me implement a movieActive variable so i've decided to go down that route instead - thanks for the input On 2 Apr 2008, at 16:35, Kenneth Kawamoto wrote: Place outside of the function - private var eventList:Sprite; Kenneth Kawamoto http://www.materiaprima.co.uk/

Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)
that said, i'd still like to know how to determine if a display object is in the current display list? thanks a On 2 Apr 2008, at 16:35, Kenneth Kawamoto wrote: Place outside of the function - private var eventList:Sprite; Kenneth Kawamoto http://www.materiaprima.co.uk/ Allandt

Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Jiri Heitlager
From the help files and modified a bit. It is probably more efficient to keep track of names and the do a getChildByName(string) function traceDisplayList(container:DisplayObjectContainer, DispObjToCheck:DisplayObject) : Boolean { var child:DisplayObject; for (var i:uint=0; i

Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Ketan Anjaria
displayObjectContainer.contains(child) On Wed, Apr 2, 2008 at 9:36 AM, Allandt Bik-Elliott (Receptacle) [EMAIL PROTECTED] wrote: that said, i'd still like to know how to determine if a display object is in the current display list? thanks a On 2 Apr 2008, at 16:35, Kenneth Kawamoto

Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Steven Sacks
If the display object is checking itself, all you have to do is check to see if stage == null. Otherwise, you can see if its parent contains it. parentClip.contains(dispObj); that said, i'd still like to know how to determine if a display object is in the current display list?

Re: [Flashcoders] some dying logic ...

2008-04-02 Thread EECOLOR
granted that the eventListener was added with a weak reference This seems to be one of the biggest mis-understandings these days. The listener does *not*add a reference to the object that you are listening too. For extensive discussion and proof of this issue you can read the following thread:

Re: [Flashcoders] Interfaces

2008-04-02 Thread Omar Fouad
ah yeah!! How could I forget something like this :D I've been using listeners for similar tasks in this application. Woah. Keeping coding for more than 14 hours daily really comsumes the brain !!! On Wed, Apr 2, 2008 at 3:09 AM, Muzak [EMAIL PROTECTED] wrote: Have the panel with the button

Re: [Flashcoders] books for flash programming

2008-04-02 Thread Cory Petosky
A native English speaker, when learning German, will generally remark Wow! Because of this feature in German, I now understand English a little better. Programming languages are the same way. Learning another object-oriented language will help you identify how features in ActionScript work (or

[Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Patrick Matte | BLITZ
I'm saving an xml file with AIR, it works but how can I add ?xml version=1.0 encoding=UTF-8? at the top of the file? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Steven Sacks
Can't you inject that into your xml string? myXml = ?xml version=1.0 encoding=UTF-8? + myXml; Patrick Matte | BLITZ wrote: I'm saving an xml file with AIR, it works but how can I add ?xml version=1.0 encoding=UTF-8? at the top of the file? ___

Re: [Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Wagner Amaral
You can set the xmlDecl property: AS3: XMLDocument().xmlDecl = ?xml version=1.0 encoding=utf-8?; AS2: XML().xmlDecl = ?xml version=1.0 encoding=utf-8?; On Wed, Apr 2, 2008 at 7:06 PM, Patrick Matte | BLITZ [EMAIL PROTECTED] wrote: I'm saving an xml file with AIR, it works but how can I add

Re: [Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Wagner Amaral
Well, if you just use quotes properly, that is ;) '?xml version=1.0 encoding=utf-8?'; On Wed, Apr 2, 2008 at 7:45 PM, Wagner Amaral [EMAIL PROTECTED] wrote: You can set the xmlDecl property: AS3: XMLDocument().xmlDecl = ?xml version=1.0 encoding=utf-8?; AS2: XML().xmlDecl = ?xml

RE: [Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Patrick Matte | BLITZ
I was looking for a method like that under the XML class. Flash's help file is suggesting to use XML instead of XMLDocument which is AS2's xml legacy. But there doesn't seem to be anything like that method under the XML class... BLITZ | Patrick Matte - 310-551-0200 x214 -Original

Re: [Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Steven Sacks
myString:String = yourXML.toString(); myString += ?xml delcaration here?; save(myString, myString.xml); An XML file is just a text file with a .xml extension. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] AIR - Insert header in XML file

2008-04-02 Thread Patrick Matte | BLITZ
No that didn't work, I got a weird error like wrong startendtag or something. BLITZ | Patrick Matte - 310-551-0200 x214 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks Sent: Wednesday, April 02, 2008 3:36 PM To: Flash Coders List Subject:

Re: [Flashcoders] books for flash programming

2008-04-02 Thread Muzak
Not to mention that a programmer who knows AS3, Java, and Lisp is immensely more valuable than one who just knows AS3. It proves you have the capacity to learn, which is a very marketable trait. BS.. Doesn't prove a thing.. Someone who *just* knows AS3 may have - scratch that - *has* the