[Flashcoders] External Class & Casting
Hi, I have a external.swf set up with custom event firing after certain process. I tried to capture the event in the parent.swf but it fires "TypeError: Error #1034: Type Coercion failed: cannot convert". sample.events::[EMAIL PROTECTED] を sample.events.TestEvent. So I guessing, having same namespace/class name in parent and child swf will generate an error. I tried changing the ApplicationDomain but that didn't help either. Is there anyway to solve this or should i just simply give up casting it and set the listeners function's argument type to flash.events.Event.? Thanx in advance! Gen ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] calling public static methods on Class using getDefinitionByName
On Mon, Jun 23, 2008 at 11:45 PM, Patrick Matte | BLITZ < [EMAIL PROTECTED]> wrote: > Ok I've found a way to do it, but it's not really clean. Would there be any > way to make the code better? > > Oh, right, you already found that out... That slow mail server from mine... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] calling public static methods on Class using getDefinitionByName
Never really tried that, but an interesting question! Here's all I got so far: var c:Class = getDefinitionByName("MyClass") as Class; // or: var c:Class = MyClass; trace( c["parse"]("false") ); I'll keep trying, maybe I can find a cleaner way On Mon, Jun 23, 2008 at 11:16 PM, Patrick Matte | BLITZ < [EMAIL PROTECTED]> wrote: > Does anybody know if it's possible to call a static method of a reference > to a class created with getDefinitionByName without actually creating an > instance of the object? > > > Something like this simple example: > > var ClassReference:Class = getDefinitionByName("Test") as Class; > > var bool:Boolean = ClassReference.parse("false"); //would return false; > > ___ > 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
RE: [Flashcoders] calling public static methods on Class using getDefinitionByName
Ok I've found a way to do it, but it's not really clean. Would there be any way to make the code better? So writing this : var ClassReference:Class = getDefinitionByName("Test") as Class; var bool:Boolean = ClassReference["parse"]("false"); // returns false is the same as this : var bool:Boolean = Test.parse("false"); // returns false BLITZ | Patrick Matte - 310-551-0200 x214 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Matte|BLITZ Sent: Monday, June 23, 2008 7:17 PM To: Flash Coders List Subject: [Flashcoders] calling public static methods on Class using getDefinitionByName Does anybody know if it's possible to call a static method of a reference to a class created with getDefinitionByName without actually creating an instance of the object? Something like this simple example: var ClassReference:Class = getDefinitionByName("Test") as Class; var bool:Boolean = ClassReference.parse("false"); //would return false; ___ 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
Re: [Flashcoders] Flash player crashes
Aha! That seems highly likely. I shall continue with renewed vigour. Cheers. 2008/6/24 Kerry Thompson <[EMAIL PROTECTED]>: > Yes, those sporadic bugs can be the dickens to find and fix, usually because > the code that's causing the problems is far removed from the place where it > actually crashes. I remember spending a couple of days once on a crash bug. > I'd find a problem, only to find that it was being caused by something > earlier. I'd track that down, and find that it caused by something even > earlier. I had to write a flow chart on a white board to keep track of > everything that was going on. > > I finally tracked it down to an unlikely source--the programmer who worked > on the project before me was doing a Boolean comparison on a value that > could sometimes be void. Void is neither true nor false, so it was setting > off a chain reaction, culminating in a crash somewhere down the line. > > Those are the hardest, but can be the most satisfying. I convinced myself > about 10 times during the course of tracking down that bug that it was the > VM's fault, then I'd notice something, and I'd be off and running, chasing > that bug, slowly spiraling ever close to the true culprit. > > Good luck! > > Cordially, > > Kerry Thompson > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:flashcoders- >> [EMAIL PROTECTED] On Behalf Of Ashim D'Silva >> Sent: Monday, June 23, 2008 7:55 AM >> To: Flash Coders List >> Subject: Re: [Flashcoders] Flash player crashes >> >> Thanks for the response Kerry. Makes me appreciate even more the work >> that gets done in Flash. And although blaming the tool is easy enough >> I'm pretty sure its in my code somewhere. However, all the problems >> you mentioned I encounter often enough to spot. Plus Flash is helpful >> enough to tell you where these are. I use traces profusely in >> troublesome area's as well. But I'm just not being able to recreate my >> problem, which is ofcourse frustrating. So I was hoping I could count >> on some log somewhere so I know what was called; which class it was >> called from; anything to pin it close to the problem spot. I've used >> debugger (local and remote) but ofcourse, when it crashes, it crashes, >> and there's no bread crumb trail... >> If I could figure out what the problem was, there'd be the possibility >> of diagnosis, till then I guess its blind testing and lots of comment >> tags. >> >> Cheers again! >> >> Ash >> >> 2008/6/23 Kerry Thompson <[EMAIL PROTECTED]>: >> > Ashim D'Silva wrote: >> > >> >> I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is >> >> continually crashing erratically. Is there a way for me to figure out >> >> what's causing it? >> > >> > I've had similar problems, and it has always turned out to be an > infinite >> > loop, memory management, a null value, or something of the like. >> > >> > The first thing to do is figure out _where_ it is crashing, then figure > out >> > _why_ >> > >> > Some people prefer to use trace() statements. Personally, if it's not a >> > time-critical issue, I use the debugger. Since I started using Flash > (F4), I >> > have found that the issue is inevitably in my coding. I'm not > initializing a >> > variable; I'm using a class wrong; or I just plain had faulty logic. >> > >> > It's not always easy, but it is seldom Flash's fault, though I often > wish I >> > could blame the tool. Track your problem down to a specific code > segment. If >> > it's failing for a reason you don't understand, post that code, with a >> > description of the problem, and we'll be glad to help. I'm afraid that > you >> > have only given a very vague complaint, so we can only give vague > answers at >> > this point. >> > >> > Don't give up, though. Flash is a great tool--not perfect, but pretty > darn >> > good. It's biggest problem is that it does what you tell it to, not what > you >> > want it to. >> > >> > Cordially, >> > >> > Kerry Thompson >> > >> > ___ >> > Flashcoders mailing list >> > Flashcoders@chattyfig.figleaf.com >> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > >> >> >> >> -- >> Random Lines 3D >> My online portfolio >> www.therandomlines.com >> ___ >> 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 > -- Random Lines 3D My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] calling public static methods on Class using getDefinitionByName
Does anybody know if it's possible to call a static method of a reference to a class created with getDefinitionByName without actually creating an instance of the object? Something like this simple example: var ClassReference:Class = getDefinitionByName("Test") as Class; var bool:Boolean = ClassReference.parse("false"); //would return false; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
Also, I'm not sure what you are trying to do with 'this.clip = clip;', but you cannot instantiate or associate a MovieClip inside an Object (which Test is), and have successful access to its properties and methods. He's using composition, which is sometimes preferable to extending MovieClip in AS2. He's passing a reference to the MovieClip in the constructor. However, I generally avoid having MovieClips themselves instantiate their class on their own timeline, however, because then it's not explicit anywhere else what's going on and then you have to dig through the MovieClips to find out where code is (timeline code can be a major pain). In those cases, you should either have a controller class do that or extend MovieClip and assign the class to the clip in the libary. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
It's a "rare" bug that is unacknowledged by Macromedia/Adobe. If you name the package folder that contains your class the same as your class name (case doesn't matter), AS2 will behave like a dumbass. It does randomly buggy behavior, and it's impossible to track down what it is because there's nothing wrong with your code, it's AS2 being buggy. Once you rename your package or class, everything works as it should. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
Because of the way everything in AS2 is centred around the MovieClip class, in order to create any kind of MVC architecture, which I gather you are trying to do, it's all about the MovieClip. You can have your Model be an Object, but your View and Controller classes, and any other visual display class need to be MovieClips, as a general rule. Unless you use composition and pass a reference to a MovieClip in the constructor. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
My first though is that you would have your class structure as: /[ClassTest].fla /test/Test.as /test/Model.as But that would give you a compiler error, because you're not importing Model. So you must be using /[ClassTest].fla /test/Test.as /Model.as Here's the files I am using; /Test_class_scope.fla : (same as you described) --- import test.Test; var test:Test = new Test(this); test.init( ); /test/Test.as : (same as you described) --- class test.Test { private var m:Model; private var clip:MovieClip; function Test(clip:MovieClip) { this.clip = clip; trace ("test"); trace (this instanceof Test); } public function init():Void { trace (this instanceof Test); m = new Model(); trace ("m = " + m); } } /Model.as : class Model { function Model() { trace("Model instantiated"); } } And the trace I get is: test true false Model instantiated m = [object Object] ...but when I change your timeline code to this: import test.Test; var classTest:Test = new Test(this); classTest.init( ); ...the trace I get is: test true true Model instantiated m = [object Object] The reason for this is that in AS2, type checking occurs at compile-time, not at runtime, so when the code is run, there are a few things that can get potentially confused: - your instance name is 'test' - your package name is 'test' - your class name is 'Test' All of which may look to be all the same at runtime. I'm surprised this runs, frankly. If it were in a more complex application you would most likely get runtime errors which would be extremely hard to track down. In AS3 there is runtime type checking, and the runtime would not get confused, and know that 'test' and 'Test' are different, or throw an error. As it is the AS2 runtime has loose type checking, and does not detect anything amiss, but you get unpredictable results. My advice would be to use best practises, and keep package names, class names and instance names unique. Tracing (or type checking) a Model instance or any other custom class for that matter will always return a type of 'object' in AS2; you need to use 'instanceof' to determine the class. (m instanceof Model) will return true. In AS3 there are far better tools, such as parsing the describeType() XML output. Also, I'm not sure what you are trying to do with 'this.clip = clip;', but you cannot instantiate or associate a MovieClip inside an Object (which Test is), and have successful access to its properties and methods. MovieClips in AS2 are these weird hybridized creatures: not quite built-in objects, not quite OOP objects. You would have to declare 'class Test extends MovieClip', and associate the test class with a clip in the library and instantiate that symbol on the timeline at authortime, or at runtime with createEmptyMovieClip(). Other runtime-instantiated classes will need to be associated with an MC library symbol, instantiated from Test via createEmptyMovieClip(). Because of the way everything in AS2 is centred around the MovieClip class, in order to create any kind of MVC architecture, which I gather you are trying to do, it's all about the MovieClip. You can have your Model be an Object, but your View and Controller classes, and any other visual display class need to be MovieClips, as a general rule. ___ Joseph Balderson, Flash Platform Developer | http://joeflash.ca paul cunningham wrote: If I have this on the flash timeline, (CS3 or Flash 8) import test.Test; var test:Test = new Test(this); *test.init( );* -- and then the class code has this class test.Test { private var m:Model; private var clip:MovieClip; function Test(clip:MovieClip) { this.clip = clip; trace ("test"); trace (this instanceof Test); } public function init():Void { trace (this instanceof Test); m = new Model(); trace ("m = " + m); } -- it traces: test true false m = -- but if I the init call originates from the constructor, instead of from the main timeline, ie function Test(clip:MovieClip) { this.clip = clip; trace ("test"); trace (this instanceof Test); *init( );* } it traces: test true true m = [object Object] -- does anyone know why the "m" value disappears when the init method is called from the timeline? . Thanks in advance. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.co
RE: [Flashcoders] Flash player crashes
Yes, those sporadic bugs can be the dickens to find and fix, usually because the code that's causing the problems is far removed from the place where it actually crashes. I remember spending a couple of days once on a crash bug. I'd find a problem, only to find that it was being caused by something earlier. I'd track that down, and find that it caused by something even earlier. I had to write a flow chart on a white board to keep track of everything that was going on. I finally tracked it down to an unlikely source--the programmer who worked on the project before me was doing a Boolean comparison on a value that could sometimes be void. Void is neither true nor false, so it was setting off a chain reaction, culminating in a crash somewhere down the line. Those are the hardest, but can be the most satisfying. I convinced myself about 10 times during the course of tracking down that bug that it was the VM's fault, then I'd notice something, and I'd be off and running, chasing that bug, slowly spiraling ever close to the true culprit. Good luck! Cordially, Kerry Thompson > -Original Message- > From: [EMAIL PROTECTED] [mailto:flashcoders- > [EMAIL PROTECTED] On Behalf Of Ashim D'Silva > Sent: Monday, June 23, 2008 7:55 AM > To: Flash Coders List > Subject: Re: [Flashcoders] Flash player crashes > > Thanks for the response Kerry. Makes me appreciate even more the work > that gets done in Flash. And although blaming the tool is easy enough > I'm pretty sure its in my code somewhere. However, all the problems > you mentioned I encounter often enough to spot. Plus Flash is helpful > enough to tell you where these are. I use traces profusely in > troublesome area's as well. But I'm just not being able to recreate my > problem, which is ofcourse frustrating. So I was hoping I could count > on some log somewhere so I know what was called; which class it was > called from; anything to pin it close to the problem spot. I've used > debugger (local and remote) but ofcourse, when it crashes, it crashes, > and there's no bread crumb trail... > If I could figure out what the problem was, there'd be the possibility > of diagnosis, till then I guess its blind testing and lots of comment > tags. > > Cheers again! > > Ash > > 2008/6/23 Kerry Thompson <[EMAIL PROTECTED]>: > > Ashim D'Silva wrote: > > > >> I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is > >> continually crashing erratically. Is there a way for me to figure out > >> what's causing it? > > > > I've had similar problems, and it has always turned out to be an infinite > > loop, memory management, a null value, or something of the like. > > > > The first thing to do is figure out _where_ it is crashing, then figure out > > _why_ > > > > Some people prefer to use trace() statements. Personally, if it's not a > > time-critical issue, I use the debugger. Since I started using Flash (F4), I > > have found that the issue is inevitably in my coding. I'm not initializing a > > variable; I'm using a class wrong; or I just plain had faulty logic. > > > > It's not always easy, but it is seldom Flash's fault, though I often wish I > > could blame the tool. Track your problem down to a specific code segment. If > > it's failing for a reason you don't understand, post that code, with a > > description of the problem, and we'll be glad to help. I'm afraid that you > > have only given a very vague complaint, so we can only give vague answers at > > this point. > > > > Don't give up, though. Flash is a great tool--not perfect, but pretty darn > > good. It's biggest problem is that it does what you tell it to, not what you > > want it to. > > > > Cordially, > > > > Kerry Thompson > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > -- > Random Lines 3D > My online portfolio > www.therandomlines.com > ___ > 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
Re: [Flashcoders] as2 - method losing scope when called from timeline.
Tr ythis import test.Test; // old:var test:Test = new Test(this); var test:Test = new Test(); test.init( ); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Frameworks for Game Development
Hello :) - http://code.google.com/p/vegas/ EKA+ :) 2008/6/23 Pedro Taranto <[EMAIL PROTECTED]>: > - GameDataStructure: http://code.google.com/p/as3ds/ > - Lowra: http://code.google.com/p/lowra/ > > -- > Pedro Taranto > > > On Mon, Jun 23, 2008 at 1:59 PM, August Gresens < > [EMAIL PROTECTED]> wrote: > > > Hello > > > > Wondering what is out there as far as open source (or otherwise) AS3 > > frameworks for Game Development. > > > > Looking for something that works for desktop and web based apps. > > > > I'm looking for something like AS-HIVE (which doesn't seem too active > right > > now), with support for: > > > > * state/navigation management > > * asset management > > * IOC container for object initialization (ideally) > > * modality (dialogs) > > * patterns for event handling > > > > What are peeps using for this type of thing? I want to make sure nothing > > exists before I write my own thing. > > > > Note: PureMVC looks interesting but seems more geared toward a data > > driven/server integrated project - RIA. Am I right about that or do > people > > also use that for games? > > > > Thanks, > > > > August > > > > -- > > - > > > > > > August Gresens > > Technical Director > > Black Hammer Productions, NYC > > [EMAIL PROTECTED] > > > > - > > > > ___ > > 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
Re: [Flashcoders] AS3 Frameworks for Game Development
- GameDataStructure: http://code.google.com/p/as3ds/ - Lowra: http://code.google.com/p/lowra/ -- Pedro Taranto On Mon, Jun 23, 2008 at 1:59 PM, August Gresens < [EMAIL PROTECTED]> wrote: > Hello > > Wondering what is out there as far as open source (or otherwise) AS3 > frameworks for Game Development. > > Looking for something that works for desktop and web based apps. > > I'm looking for something like AS-HIVE (which doesn't seem too active right > now), with support for: > > * state/navigation management > * asset management > * IOC container for object initialization (ideally) > * modality (dialogs) > * patterns for event handling > > What are peeps using for this type of thing? I want to make sure nothing > exists before I write my own thing. > > Note: PureMVC looks interesting but seems more geared toward a data > driven/server integrated project - RIA. Am I right about that or do people > also use that for games? > > Thanks, > > August > > -- > - > > > August Gresens > Technical Director > Black Hammer Productions, NYC > [EMAIL PROTECTED] > > - > > ___ > 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
Re: [Flashcoders] Flash player crashes
___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3 Frameworks for Game Development
Hello Wondering what is out there as far as open source (or otherwise) AS3 frameworks for Game Development. Looking for something that works for desktop and web based apps. I'm looking for something like AS-HIVE (which doesn't seem too active right now), with support for: * state/navigation management * asset management * IOC container for object initialization (ideally) * modality (dialogs) * patterns for event handling What are peeps using for this type of thing? I want to make sure nothing exists before I write my own thing. Note: PureMVC looks interesting but seems more geared toward a data driven/server integrated project - RIA. Am I right about that or do people also use that for games? Thanks, August -- - August Gresens Technical Director Black Hammer Productions, NYC [EMAIL PROTECTED] - ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
you should get compiler errors over this but did you import Model? On Mon, Jun 23, 2008 at 8:24 AM, Paul Evans < [EMAIL PROTECTED]> wrote: > untested suggestion?!... > > On 23 Jun 2008, at 10:20, paul cunningham wrote: > >> If I have this on the flash timeline, (CS3 or Flash 8) >> import test.Test; >> var test:Test = new Test(this); >> *test.init( );* >> > > is test (the variable) being confused with test (the package) ? > > my next step would be to try this again using a different variable name. > > -- > Paul Evans > http://www.creative-cognition.co.uk/ > http://blog.creacog.co.uk/ > > > ___ > 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
RE: [Flashcoders] Flash player crashes
Is there a tutorial out there somewhere on how to use the debugger? I am fairly new to Flash and just use trace statements to find my problems... but would like to learn more about the debugger. gregb -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kerry Thompson Sent: Monday, June 23, 2008 5:05 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Flash player crashes Ashim D'Silva wrote: > I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is > continually crashing erratically. Is there a way for me to figure out > what's causing it? I've had similar problems, and it has always turned out to be an infinite loop, memory management, a null value, or something of the like. The first thing to do is figure out _where_ it is crashing, then figure out _why_ Some people prefer to use trace() statements. Personally, if it's not a time-critical issue, I use the debugger. Since I started using Flash (F4), I have found that the issue is inevitably in my coding. I'm not initializing a variable; I'm using a class wrong; or I just plain had faulty logic. It's not always easy, but it is seldom Flash's fault, though I often wish I could blame the tool. Track your problem down to a specific code segment. If it's failing for a reason you don't understand, post that code, with a description of the problem, and we'll be glad to help. I'm afraid that you have only given a very vague complaint, so we can only give vague answers at this point. Don't give up, though. Flash is a great tool--not perfect, but pretty darn good. It's biggest problem is that it does what you tell it to, not what you want it to. Cordially, Kerry Thompson ___ 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
Re: [Flashcoders] as2 - method losing scope when called from timeline.
untested suggestion?!... On 23 Jun 2008, at 10:20, paul cunningham wrote: If I have this on the flash timeline, (CS3 or Flash 8) import test.Test; var test:Test = new Test(this); *test.init( );* is test (the variable) being confused with test (the package) ? my next step would be to try this again using a different variable name. -- Paul Evans http://www.creative-cognition.co.uk/ http://blog.creacog.co.uk/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash player crashes
Thanks for the response Kerry. Makes me appreciate even more the work that gets done in Flash. And although blaming the tool is easy enough I'm pretty sure its in my code somewhere. However, all the problems you mentioned I encounter often enough to spot. Plus Flash is helpful enough to tell you where these are. I use traces profusely in troublesome area's as well. But I'm just not being able to recreate my problem, which is ofcourse frustrating. So I was hoping I could count on some log somewhere so I know what was called; which class it was called from; anything to pin it close to the problem spot. I've used debugger (local and remote) but ofcourse, when it crashes, it crashes, and there's no bread crumb trail... If I could figure out what the problem was, there'd be the possibility of diagnosis, till then I guess its blind testing and lots of comment tags. Cheers again! Ash 2008/6/23 Kerry Thompson <[EMAIL PROTECTED]>: > Ashim D'Silva wrote: > >> I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is >> continually crashing erratically. Is there a way for me to figure out >> what's causing it? > > I've had similar problems, and it has always turned out to be an infinite > loop, memory management, a null value, or something of the like. > > The first thing to do is figure out _where_ it is crashing, then figure out > _why_ > > Some people prefer to use trace() statements. Personally, if it's not a > time-critical issue, I use the debugger. Since I started using Flash (F4), I > have found that the issue is inevitably in my coding. I'm not initializing a > variable; I'm using a class wrong; or I just plain had faulty logic. > > It's not always easy, but it is seldom Flash's fault, though I often wish I > could blame the tool. Track your problem down to a specific code segment. If > it's failing for a reason you don't understand, post that code, with a > description of the problem, and we'll be glad to help. I'm afraid that you > have only given a very vague complaint, so we can only give vague answers at > this point. > > Don't give up, though. Flash is a great tool--not perfect, but pretty darn > good. It's biggest problem is that it does what you tell it to, not what you > want it to. > > Cordially, > > Kerry Thompson > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Random Lines 3D My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Flash player crashes
Ashim D'Silva wrote: > I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is > continually crashing erratically. Is there a way for me to figure out > what's causing it? I've had similar problems, and it has always turned out to be an infinite loop, memory management, a null value, or something of the like. The first thing to do is figure out _where_ it is crashing, then figure out _why_ Some people prefer to use trace() statements. Personally, if it's not a time-critical issue, I use the debugger. Since I started using Flash (F4), I have found that the issue is inevitably in my coding. I'm not initializing a variable; I'm using a class wrong; or I just plain had faulty logic. It's not always easy, but it is seldom Flash's fault, though I often wish I could blame the tool. Track your problem down to a specific code segment. If it's failing for a reason you don't understand, post that code, with a description of the problem, and we'll be glad to help. I'm afraid that you have only given a very vague complaint, so we can only give vague answers at this point. Don't give up, though. Flash is a great tool--not perfect, but pretty darn good. It's biggest problem is that it does what you tell it to, not what you want it to. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] BaseUI version 2 - Flash Layout
Hi everyone, I'm happy to tell you that you can use the second version of BaseUI. It will help you to handle the positions and sizes; it makes things easy when you want to manage backgrounds and assets behaviors in a liquid or fixed flash site. In this new version, I reproduce what the Flex Builder has in his interface. BaseUI will allow you to use properties on a DisplayObject like: top, bottom, left, right, horizontalCenter, width and height, also with percentage, etc... Be able to use easily percent width and height is opening new possibilities, I let you have a look at the demo: http://www.soundstep.com/blog/source/baseuiv2/demo/ little explanation here: http://www.soundstep.com/blog/2008/06/23/flash-liquid-layout-with-baseui-ver sion-2/ the BaseUI page: http://www.soundstep.com/blog/downloads/baseui/ This version is NOT an update, the code written for the previous version won't work with this one. I hope you'll enjoy it and let me know what you think about. Romu www.soundstep.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] as2 - method losing scope when called from timeline.
If I have this on the flash timeline, (CS3 or Flash 8) import test.Test; var test:Test = new Test(this); *test.init( );* -- and then the class code has this class test.Test { private var m:Model; private var clip:MovieClip; function Test(clip:MovieClip) { this.clip = clip; trace ("test"); trace (this instanceof Test); } public function init():Void { trace (this instanceof Test); m = new Model(); trace ("m = " + m); } -- it traces: test true false m = -- but if I the init call originates from the constructor, instead of from the main timeline, ie function Test(clip:MovieClip) { this.clip = clip; trace ("test"); trace (this instanceof Test); *init( );* } it traces: test true true m = [object Object] -- does anyone know why the "m" value disappears when the init method is called from the timeline? . Thanks in advance. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash player crashes
Oh, its very easily an issue with memory management because regrettably that's one of the parts of AS3 I continue to have trouble with. I try hard to pick up after myself (listeners, bitmapdata, cancel loaders, close connections), and run ActiveGraph to get an estimate. But how do you track it down once it's started! I with I could switch to Flash Develop, but I'm on Mac, and I haven't found an alternate IDE yet. Any ideas there maybe? By the way, this is also killing my browser sometimes. So I'm in quite a bit of trouble. The last time I had a similar problem, it was to do with Flash Player. Apparently masking a text field and then moving it under the mask (scrolling) is bad. So you stick it in a container and then mask and move that! I was hoping there was a limited amount of things that can actually crash Flash, but then again... 2008/6/23 Cedric Muller <[EMAIL PROTECTED]>: > Memory management not done right = garbage collector piling up > >> I noticed Flash crashes very quickly when memory management is not done >> right. I am NOT implying that you did something wrong. I am just adding my >> observations to the thread. >> Could it be memory management ? >> >> Cedric >> >>> I believe Flash Cs3 is not ready for serious projects. >>> Nowadays I am really having huge problems. It started with loading an >>> external swf, it begin to not to load the external swf all the times. >>> While >>> I am working on it, i noticed that it is a bug after over 100 trys. And >>> then >>> I am having problems casting objects. I can not cast my custom class >>> instance to its custom class. Flash gives me stupid errors. >>> Below is my bug report to Adobe. You can register and vote so that it can >>> be >>> "fixed" >>> http://bugs.adobe.com/jira/browse/ASC-3436 >>> >>> My advice is, like the big companies, game writers, DO NOT USER CS3 for >>> your >>> commercial projects. There are really big problems that need to be >>> solved, >>> but the worst is adobe engineers are not aware of that. >>> >>> -Original Message- >>> From: [EMAIL PROTECTED] >>> [mailto:[EMAIL PROTECTED] On Behalf Of mario >>> gonzalez >>> Sent: Monday, June 23, 2008 9:42 AM >>> To: Flash Coders List >>> Subject: Re: [Flashcoders] Flash player crashes >>> >>> I have that happen to me too ALL the time, once it starts on a project >>> it's very very hard to track down. >>> Usually related to garbage collection it only crashes in the IDE >>> right? >>> >>> I wish i had better advice, but one thing you can do is when you test >>> your movie, test using the debugger (control > debug movie (off my head) >>> ) instead... that way when it crashes it doesn't crash the whole flash >>> IDE, just the debugger projector.. >>> >>> >>> Ashim D'Silva wrote: Hey, I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is continually crashing erratically. Is there a way for me to figure out what's causing it? I can't seem to tie it to any action or recreate it, but it happens often enough to be a large problem. I would normally think there isn't much I can do with AS to actually crash the player, but it seems I have... Please help! Cheers, Ashim -- Random Lines 3D My online portfolio www.therandomlines.com ___ 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 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 > -- Random Lines 3D My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash player crashes
Memory management not done right = garbage collector piling up I noticed Flash crashes very quickly when memory management is not done right. I am NOT implying that you did something wrong. I am just adding my observations to the thread. Could it be memory management ? Cedric I believe Flash Cs3 is not ready for serious projects. Nowadays I am really having huge problems. It started with loading an external swf, it begin to not to load the external swf all the times. While I am working on it, i noticed that it is a bug after over 100 trys. And then I am having problems casting objects. I can not cast my custom class instance to its custom class. Flash gives me stupid errors. Below is my bug report to Adobe. You can register and vote so that it can be "fixed" http://bugs.adobe.com/jira/browse/ASC-3436 My advice is, like the big companies, game writers, DO NOT USER CS3 for your commercial projects. There are really big problems that need to be solved, but the worst is adobe engineers are not aware of that. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mario gonzalez Sent: Monday, June 23, 2008 9:42 AM To: Flash Coders List Subject: Re: [Flashcoders] Flash player crashes I have that happen to me too ALL the time, once it starts on a project it's very very hard to track down. Usually related to garbage collection it only crashes in the IDE right? I wish i had better advice, but one thing you can do is when you test your movie, test using the debugger (control > debug movie (off my head) ) instead... that way when it crashes it doesn't crash the whole flash IDE, just the debugger projector.. Ashim D'Silva wrote: Hey, I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is continually crashing erratically. Is there a way for me to figure out what's causing it? I can't seem to tie it to any action or recreate it, but it happens often enough to be a large problem. I would normally think there isn't much I can do with AS to actually crash the player, but it seems I have... Please help! Cheers, Ashim -- Random Lines 3D My online portfolio www.therandomlines.com ___ 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 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
Re: [Flashcoders] Flash player crashes
I noticed Flash crashes very quickly when memory management is not done right. I am NOT implying that you did something wrong. I am just adding my observations to the thread. Could it be memory management ? Cedric I believe Flash Cs3 is not ready for serious projects. Nowadays I am really having huge problems. It started with loading an external swf, it begin to not to load the external swf all the times. While I am working on it, i noticed that it is a bug after over 100 trys. And then I am having problems casting objects. I can not cast my custom class instance to its custom class. Flash gives me stupid errors. Below is my bug report to Adobe. You can register and vote so that it can be "fixed" http://bugs.adobe.com/jira/browse/ASC-3436 My advice is, like the big companies, game writers, DO NOT USER CS3 for your commercial projects. There are really big problems that need to be solved, but the worst is adobe engineers are not aware of that. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mario gonzalez Sent: Monday, June 23, 2008 9:42 AM To: Flash Coders List Subject: Re: [Flashcoders] Flash player crashes I have that happen to me too ALL the time, once it starts on a project it's very very hard to track down. Usually related to garbage collection it only crashes in the IDE right? I wish i had better advice, but one thing you can do is when you test your movie, test using the debugger (control > debug movie (off my head) ) instead... that way when it crashes it doesn't crash the whole flash IDE, just the debugger projector.. Ashim D'Silva wrote: Hey, I'm using the Flash IDE CS3 to produce a project in AS3, and Flash is continually crashing erratically. Is there a way for me to figure out what's causing it? I can't seem to tie it to any action or recreate it, but it happens often enough to be a large problem. I would normally think there isn't much I can do with AS to actually crash the player, but it seems I have... Please help! Cheers, Ashim -- Random Lines 3D My online portfolio www.therandomlines.com ___ 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 mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders