[flexcoders] Building to FP10 breaks code that works if I build to FP9...why?
Hello people, I hope someone here can point me in the right direction here. I have a class in my codebase that defines objects that contain functions eg (pseudocode): package com.my.package { import flash.events.EventDispatcher; public class Dohickey extends EventDispatcher { public var thingy:Whatsit; public function init():void { doThings.create(); } public var doThings:Object = { create: function():void { if ( ! thingy ) { thingy = new Whatsit(); } } }; } } Now, if I build to Flash Player 9, I can call init() on the above code and doThings.create() will run and create a new Whatsit into the thingy variable. If I build it to Flash Player 10, I get an error saying ReferenceError: Error #1069: Property com.my.package:Dohickey::thingy not found on Object and there is no default value. at anonymous()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:19] at com.my.package::Dohickey/create()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:11] Can someone explain why? Please? :-) Guy
Re: [flexcoders] Building to FP10 breaks code that works if I build to FP9...why?
Hello, I think your create function is not in class instance scope (because inline) : should be static or from an instance of Dohickey to work, I think. thomas parquier --- http://www.web-attitude.fr/realisations/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056 2010/1/18 Guy Morton g...@alchemy.com.au Hello people, I hope someone here can point me in the right direction here. I have a class in my codebase that defines objects that contain functions eg (pseudocode): package com.my.package { import flash.events.EventDispatcher; public class Dohickey extends EventDispatcher { public var thingy:Whatsit; public function init():void { doThings.create(); } public var doThings:Object = { create: function():void { if ( ! thingy ) { thingy = new Whatsit(); } } }; } } Now, if I build to Flash Player 9, I can call init() on the above code and doThings.create() will run and create a new Whatsit into the thingy variable. If I build it to Flash Player 10, I get an error saying ReferenceError: Error #1069: Property com.my.package:Dohickey::thingy not found on Object and there is no default value. at anonymous()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:19] at com.my.package::Dohickey/create()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:11] Can someone explain why? Please? :-) Guy
Re: [flexcoders] Building to FP10 breaks code that works if I build to FP9...why?
Yes, it looked like a scoping problem to me as well. Just curious as to why it works in 9 but not 10. I couldn't find any documentation that said there was a change in this area. On 18/01/2010, at 10:37 PM, thomas parquier wrote: Hello, I think your create function is not in class instance scope (because inline) : should be static or from an instance of Dohickey to work, I think. thomas parquier --- http://www.web-attitude.fr/realisations/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net téléphone portable : +33601 822 056 2010/1/18 Guy Morton g...@alchemy.com.au Hello people, I hope someone here can point me in the right direction here. I have a class in my codebase that defines objects that contain functions eg (pseudocode): package com.my.package { import flash.events.EventDispatcher; public class Dohickey extends EventDispatcher { public var thingy:Whatsit; public function init():void { doThings.create(); } public var doThings:Object = { create: function():void { if ( ! thingy ) { thingy = new Whatsit(); } } }; } } Now, if I build to Flash Player 9, I can call init() on the above code and doThings.create() will run and create a new Whatsit into the thingy variable. If I build it to Flash Player 10, I get an error saying ReferenceError: Error #1069: Property com.my.package:Dohickey::thingy not found on Object and there is no default value. at anonymous()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:19] at com.my.package::Dohickey/create()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:11] Can someone explain why? Please? :-) Guy