Re: [Flashcoders] this['box_ratio'] works but this.box_ratio or just box_ratio does not

2006-09-12 Thread Alexander Farber
Hello John, On 9/12/06, John Axel Eriksson [EMAIL PROTECTED] wrote: You could look into Delegate or Proxy... makes these I've looked up the Delegate and it is for Components and I don't use them. And the Proxy is a bad keyword for searching - could you please give me an URL? I have put my

Re: [Flashcoders] this['box_ratio'] works but this.box_ratio or just box_ratio does not

2006-09-12 Thread Hans Wichman
Hi, Delegate is not only for components, it works for anycase where you wish to run functions in another scope. greetz JC On 9/12/06, Alexander Farber [EMAIL PROTECTED] wrote: Hello John, On 9/12/06, John Axel Eriksson [EMAIL PROTECTED] wrote: You could look into Delegate or Proxy... makes

Re: [Flashcoders] this['box_ratio'] works but this.box_ratio or just box_ratio does not

2006-09-12 Thread John Axel Eriksson
Yeah, exactly. You can use it for anything. You should also check this out: http://www.person13.com/articles/proxy/Proxy.htm A nicer version of Delegate. What a Delegate/Proxy does is to execute a callback in another scope. So instead you could do it like this(I'm using Proxy, but you can

Re: [Flashcoders] this['box_ratio'] works but this.box_ratio or just box_ratio does not

2006-09-12 Thread Alexander Farber
Thank you John, the Delegate has been just what I needed - I've just replaced the 2 lines and it works: listener.onLoadProgress = Delegate.create(this, display_progress); listener.onLoadInit = Delegate.create(this,

[Flashcoders] this['box_ratio'] works but this.box_ratio or just box_ratio does not

2006-09-11 Thread Alexander Farber
Hello, I have an mc which loads an external image file (a user avatar) using MovieClipLoader.loadClip and while doing so displays percentage of currently loaded bytes in a TextField loaded_txt: class User extends MovieClip { private var loaded_txt:TextField; private var

Re: [Flashcoders] this['box_ratio'] works but this.box_ratio or just box_ratio does not

2006-09-11 Thread John Axel Eriksson
Very simple. You have defined the method resize_clip in the User class which does have a loaded_txt var but doesn't have the box_width and box_height etc vars. The fact that you use that function in another context doesn't matter to the compiler. That's why you get those errors. You could