Re: [Flashcoders] Can you extend the _y and _height setters of a movie clip?

2006-02-08 Thread Ian Thomas
Have you tried using Object.watch? It certainly works for me with .enabled - might work with _x and _y, haven't tried it. Cheers, Ian On 2/8/06, Morten Barklund TBWAPlay <[EMAIL PROTECTED]> wrote: > > David Lochhead wrote: > > Hi, > > > > I've got a movieclip that can have it's _y and _height

Re: [Flashcoders] Can you extend the _y and _height setters of amovie clip?

2006-02-08 Thread Ian Thomas
Um - Tyler - as I said in an earlier post, Object.watch _does_ work with .enabled. Definitely. I use it all the time. MX2004. So it might be worth trying with _x and _y, too... Ian On 2/8/06, Tyler Wright <[EMAIL PROTECTED]> wrote: > > No, there is no way to do this by extending the MovieClip cl

Re: [Flashcoders] SWF and URL

2006-02-10 Thread Ian Thomas
You could create a container movie that loads in the .SWF banners, and put the click code in your container. You might have to worry about security policy files and the like, tho', if you're loading them from other websites. HTH, Ian On 2/10/06, Eduardo Barbosa <[EMAIL PROTECTED]> wrote: > > H

Re: [Flashcoders] No variables in Interfaces?

2006-02-13 Thread Ian Thomas
No, there isn't. Is there a reason why you can't roll your own accessor functions? e.g. getValue() setValue() ? Cheers, Ian On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there NO way to use variables in an interface? > > Code: > > var obj:ICanvas = new ClassThatImplemen

Re: [Flashcoders] No variables in Interfaces?

2006-02-13 Thread Ian Thomas
Excellent news... On 2/13/06, Johannes Nel <[EMAIL PROTECTED]> wrote: > > getters and setters are allowed in AS3! > > On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > > > Hadn't thought of that, I guess that would work. > > > > Thanks > > > > ___ F

Re: [Flashcoders] Resize MC within an MC

2006-02-15 Thread Ian Thomas
Um... Unless I'm totally misreading... the maths should be: parentMC._width=parentMC._width*4; ? (Except I'd probably use _xscale=400 instead) Ian On 2/15/06, Mendelsohn, Michael <[EMAIL PROTECTED]> wrote: > > Hi list... > > I have a MC of a rectangle with dimensions 1600 x 1200, registration >

Re: [Flashcoders] Resize MC within an MC

2006-02-15 Thread Ian Thomas
If it's a simple case of getting a shape of 400 pixels to be 1600 pixels, you need to get it 4 times bigger. It sounds like it's not that simple. You probably need to worry about any current scalings applied at the time. Does it help to do a getBounds(_root) on the inner shape - that should at le

Re: [Flashcoders] Platform Game Collision Detection

2006-02-20 Thread Ian Thomas
I was about to strongly suggest that book - but I see you already got there, Charles. *grin* Ian On 2/20/06, Charles Parcell <[EMAIL PROTECTED]> wrote: > > I would strongly suggest this book. > < > > http://www.amazon.com/gp/product/1584503300/sr=8-1/qid=1140455849/ref=sr_1_1/104-7609160-1088727?

Re: [Flashcoders] Re: When singletons go bad

2006-02-20 Thread Ian Thomas
If you use getInstance(), a constructor gets called - which is often handy if you need to run any kind of initialisation code for your singleton (that you couldn't just do with initial property values). If you just used statics, you might end up having to do something like: public static function

Re: [Flashcoders] Wrong width and height when using MovieClipLoader?

2006-02-20 Thread Ian Thomas
Lars, For a loaded clip, the stage size (from the settings dialog) is pretty much ignored. The _width and _height returned to the loading clip is the width and height of the objects in frame 1, as Eric says. As far as I know, there's no way to return the stage size that you set up when you publis

Re: [Flashcoders] Platform Game Collision Detection

2006-02-20 Thread Ian Thomas
Hi Rob, The book deals with exactly that sort of stuff, from fairly much first principles - then later goes on to talk about 3D. From what I understand, it was pretty much written to deal with exactly your situation... (Danny is on this list somewhere, so can no doubt speak for himself. :-) )

Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Ian Thomas
Paul, Just my two penn'orth... For my money, the best way to think about these things is more on a conceptual level rather than specifically at a code level. What is your child movieclip? What does it do? Best example I can think of is off the top of my head is, say, a requester dialog. Say a si

Re: [Flashcoders] Question regarding use of Delegate in a class

2006-02-21 Thread Ian Thomas
Hi Wouter, Delegate.create() doesn't _call_ a function, it just creates a Function variable for later use. Which is like a reference to a function. By calling: container_mc.onRelease = Delegate.create(this, startTimer); You're saying, in effect "when onRelease is called, trigger the code in star

Re: [Flashcoders] Question regarding use of Delegate in a class

2006-02-21 Thread Ian Thomas
Oops - would help if I read your code properly! The first bit of my reply made sense - you're not _calling_ the function, just creating a reference to it. Calling this.startTimer() won't work because you're in an inner function. startTimer() should do it. Ian ___

Re: [Flashcoders] only keynote?????

2006-02-22 Thread Ian Thomas
Did you miss the email pointing you at OpenOffice.org? http://www.openoffice.org It's not a toy. Ian On 3/23/06, Alfonso Florio <[EMAIL PROTECTED]> wrote: > > So PowerPoint has the monopoly into the windows world for > presentation software? > > i don't see nothing else than ppt2swf converters

Re: [Flashcoders] only keynote?????

2006-02-22 Thread Ian Thomas
Scripting - http://framework.openoffice.org/scripting/ You can certainly export from Impress to .swf I haven't tried either of these features yet, I'm afraid, so can't comment on how good they are. HTH, Ian On 2/22/06, Nick Weekes <[EMAIL PROTECTED]> wrote: > > Is this because its open source

Re: [Flashcoders] File Exists - a better way?

2006-03-17 Thread Ian Thomas
There's no Flash native hack as far as I know. The only obvious solution I can think of is to call a server script - for example in PHP something like: Then use LoadVars to call the script, passing in the parameter 'file' - which is a filename relative to the PHP script. Once LoadVars returns, i

Re: [Flashcoders] File Exists - a better way?

2006-03-18 Thread Ian Thomas
Bart, Firstly, I'm not sure why that's a reply to my posting - and secondly, why would you want to do that..? The original poster asked if there was a way of checking whether a file exists sooner than waiting for the whole file to load. Your solution loads the whole file via LoadVars - which w

Re: [Flashcoders] Cannot stop loaded movie

2006-03-18 Thread Ian Thomas
Is this a scoping issue? Are you sure that mcClip is defined and pointing at the right thing inside your function()? Try import mx.utils.Delegate; function onLoadedClip(clip:MovieClip) { clip.stop(); // or clip.gotoAndStop(1); } var mcl:MovieClipLoader=new MovieClipLoader(); mcl.onLoadInit=D

Re: [Flashcoders] Flash MX2004, Video CD with "auto-play" {Director v. Flash??}

2006-03-19 Thread Ian Thomas
On 3/19/06, Charles Parcell <[EMAIL PROTECTED]> wrote: > Something else to be specific about is your note of Full Screen. Do you mean > that the projector should stretch to fill the current monitor resolution or > do you mean that the app should resize the users screen resolution to the > size of t

Re: [Flashcoders] Drawing regular, filled shapes into BitmapData

2006-03-20 Thread Ian Thomas
Hi Adrian, I have no experience of doing this whatsoever - but - my immediate feeling is that you should go for your first idea. Create the shapes as vectors, then grab the BitmapData from. This is simply because the routines to draw the shapes are all native to the Flash Player, and they are the

[Flashcoders] More Text Embedding Woes

2006-03-20 Thread Ian Thomas
Okay, a new text embed issue for me today... Text embedding is working fine - that's not the problem. I'm trying to do some getTextExtent() calculations. The steps I take to do so are: - Dynamically create a text field and give it some text and an embedded font. This all works perfectly well. -

Re: [Flashcoders] More Text Embedding Woes

2006-03-20 Thread Ian Thomas
Hi Eric, Thanks for that - but it doesn't seem to solve my problem. :-) I can get getTextExtent() _working_ perfectly happily - I just can't get it to work using the actual metrics of the embedded font, only (apparently) of the system version of that font. (Or possibly what's happening is it's us

Re: [Flashcoders] Setting Cursor Location to a Textfield and Enabling Text Input

2006-03-20 Thread Ian Thomas
I think I did something like this immediately after the setFocus() Selection.setSelection(field.text.length,field.text.length); HTH, Ian On 3/20/06, Miles, Mathew <[EMAIL PROTECTED]> wrote: > I can set the cursor location to a textfield when it loads: > > Selection.setFocus("id_txt"); > > Howe

Re: [Flashcoders] Inconsistent Constant

2006-03-20 Thread Ian Thomas
Chris... Firstly - Flash doesn't have the concept of constants, so you couldn't enforce a constant even if you wanted to (except by a hack like defining a null set() function, but that's beside the point a bit)... you can only suggest that specific things should be constant by convention i.e. tell

Re: [Flashcoders] Inconsistent Constant

2006-03-20 Thread Ian Thomas
Steve, Fine. :-) My two-second thought works, then. Haven't tried that, but may well start using it - it only just occurred to me as a method as I was writing the post. :-) I stand corrected. :-) That doesn't gainsay the second part of the posting - there really isn't enough detail in that orig

Re: [Flashcoders] Flash MX2004, Video CD with "auto-play" {Director v. Flash??}

2006-03-20 Thread Ian Thomas
Michael, I use Flash for CD authoring all the time. The only caveat, really, is that I use Zinc as a wrapper for the main Flash application rather than just using Flash projectors, as I want extended functionality (Resolution changing, registry access, file access, that sort of thing). But other

[Flashcoders] Multiuser - which backend?

2006-03-22 Thread Ian Thomas
Hi folks, Partly as something of an experiment, but mainly as a testbed and proof-of-concept for something else entirely, I'm looking at throwing together a (non-commercial) multi-user game with a Flash interface. It should be fairly straightforward wise - a simple grid-based interface not too

Re: [Flashcoders] Multiuser - which backend?

2006-03-23 Thread Ian Thomas
Thanks all. I'll look a bit deeper into Electroserver, Red5 and Eric's version of Oregano, then. You're quite right that what I'm doing is experimental, Chris, so Red5 might well be suitable - besides, 'bleeding edge' always appeals. :-) Cheers, Ian _

Re: [Flashcoders] A lack of understanding re static methods

2006-03-24 Thread Ian Thomas
HI Dave, It's my understanding that that _should_ work. However, Const.portfolioPath isn't replaced at compile time - Flash has no native understanding of constants. But at runtime, Const.portfolioPath should certainly return your hardcoded path. The only immediate things I can think of which m

Re: [Flashcoders] System.Locale

2006-03-24 Thread Ian Thomas
What you want is System.capabilities.language: http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=2061.html Sorry for the long URL - that's livedocs for you! HTH, Ian On 3/24/06, Robert Chyko <[EMAIL PROTECTED]> wrote: > Regarding

Re: [Flashcoders] Actionscript 2 - suitable for designers?

2006-03-27 Thread Ian Thomas
I'd go for AS2. Mostly because that OOP flavour is the direction that almost all the commonly-used languages are heading in; the whole idea of objects and methods now pretty much applies to: - Javascript - Java - C++ - C# - Coding using XML - AS2 - Lingo - .NET - PHP And will apply to the XML scri

Re: [Flashcoders] FATAL Zinc issue

2006-03-27 Thread Ian Thomas
On 3/27/06, John Hattan <[EMAIL PROTECTED]> wrote: > Speaking as a registered user, Zinc is currently suffering from some serious > quality problems. Version 2.5 was rushed out the door, and they haven't done > a good job staying on top of things since then. Yes - I've had exactly the same proble

Re: [Flashcoders] createEmptyMovieClip for individual MovieClip-class

2006-03-27 Thread Ian Thomas
Hi Robert, The following FAQ entry should answer your question: http://www.osflash.org/flashcoders/as2#creating_a_class_instance_based_on_movieclip_without_a_symbol_in_the_library HTH, Ian On 3/27/06, Robert Clochard <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I've searched a while for t

Re: [Flashcoders] "+" simbol issue help

2006-03-29 Thread Ian Thomas
Are you using an embedded font? If so, have you remembered to add the + symbol to the list of embedded characters? HTH, Ian On 3/29/06, Alfredo Laguia <[EMAIL PROTECTED]> wrote: > hi there > what can i do to show "+" symbol in a dynamic textfield?? > > i take the data from a

Re: [Flashcoders] "+" simbol issue help

2006-03-29 Thread Ian Thomas
echa"+i] > container["consolaNoticias"+i].titulo_txt.text = misVars["titulo"+i] > container["consolaNoticias"+i].contenido = misVars["contenido"+i] > container["consolaNoticias"+i].info_btn.onPress = function(){ > noticias._visi

Re: [Flashcoders] "+" simbol issue help

2006-03-29 Thread Ian Thomas
Oh - just to point out - I'd imagine (again, untested - I never use LoadVars in it's normal form) that Flash takes care of converting the text back again so that you don't have to worry about it. All you should need to change is your ASP file, no Flash code. Ian On 3/29/06, Ian

Re: [Flashcoders] "+" simbol issue help

2006-03-29 Thread Ian Thomas
Hi Alfredo, Having just done a quick Google - instead of transforming each "+" symbol, just call this: Server.URLEncode(myString) where myString is the value you want to encode. For example: &titulo3=<%=Server.URLEncode("Here is my text with a + in it")%> Or something similar. Cheers, Ian

Re: [Flashcoders] allowing slow animation

2006-04-04 Thread Ian Thomas
Is this solely for text? In which case, is this something to do with the new "Anti-alias for Animation" or "Anti-alias for Readability" options in the properties dialog of the new IDE? Does switching that solve your problem? Cheers, Ian On 4/4/06, PR Durand <[EMAIL PROTECTED]> wrote: > Hi List!

Re: [Flashcoders] MovieClipLoader - Crash in player 7, fine in player 8

2006-04-04 Thread Ian Thomas
Roman, Yes, I've had this - but it seems to only be an issue when working with local files. I've never yet had an issue with online files, even when cached. The only workaround I've found is to queue the requests rather than issue them together - but in most cases that does slow things down...

Re: [Flashcoders] MovieClipLoader - Crash in player 7, fine in player 8

2006-04-04 Thread Ian Thomas
Thanks Roman - I'll try it next time I encounter another MCL situation which crashes FP7. Cheers, Ian On 4/4/06, Roman Blöth <[EMAIL PROTECTED]> wrote: > O.k., we've some sort of cure for strange loadClip-behaviors: > > Between onLoadInit and the next call to loadClip we set a delay of about >

Re: [Flashcoders] What's different between _alpha=0 and _visible =flase;

2006-04-06 Thread Ian Thomas
The other major difference is easily shown: Place a movieClip on stage. Give it an onRelease handler: clip.onRelease=function(){trace("Release!");} Test your movie - click on it, and Release! is traced. Set clip._alpha to 0 Test the movie - click on where the clip should be, and Release! is trac

Re: [Flashcoders] Instantiate a class by string - SOLVED

2006-04-12 Thread Ian Thomas
On 4/12/06, Julian 'Julik' Tarkhanov <[EMAIL PROTECTED]> wrote: > Funny though that imports do not do anything unless you use the > classes directly. I'd say this is broken. I disagree. All 'import' does is to tell the parser which particular class you are referring to. If we assume that the fil

Re: [Flashcoders] Instantiate a class by string - SOLVED

2006-04-13 Thread Ian Thomas
Sorry, that's what I meant when I said... "such as the declaration of a variable or the creation of an object" I should have provided a concrete example. :-) As Scott says, working with .swfs is more like working with .jars than you might think - particularly when you are working with MTASC/Swfmi

Re: [Flashcoders] Extending Array Question

2006-04-18 Thread Ian Thomas
Hi there (whoever you are!) Your problem is that the [1,2,3] initialiser syntax is actually a short cut for creating a new Array() object, not an ArrayExtension(). So you're replacing the object you just created with new(). What you need to do is to _modify_ your ArrayExtension() object, not repl

Re: [Flashcoders] Create an Empty MC and assign it to a class?

2006-04-19 Thread Ian Thomas
Take a look at the following FAQ entry: http://www.osflash.org/flashcoders/as2#creating_a_class_instance_based_on_movieclip_without_a_symbol_in_the_library HTH, Ian On 4/19/06, Rifled Cloaca <[EMAIL PROTECTED]> wrote: > Thanks for your response.. > > Actually, I want to assign a class to an emp

Re: [Flashcoders] greek/math chars

2006-04-21 Thread Ian Thomas
Hi Enrico, If you override the LoadVars method onData you can actually parse the raw text from the text file, without having everything split up by & and =. See the help file for LoadVars.onData() That might well help you. Cheers, Ian On 4/21/06, MetaArt <[EMAIL PROTECTED]> wrote: > I must l

Re: [Flashcoders] [POLL] getters & setters preference

2006-04-26 Thread Ian Thomas
The only other reason that I don't use built-in getters and setters is that, at present, they don't work with Interfaces, only with Classes. And we use Interfaces a lot. Ian On 4/26/06, Kevin Newman <[EMAIL PROTECTED]> wrote: > So in general, at this point I try to stay away from built in getter

Re: [Flashcoders] Flash Maths bug???

2006-04-28 Thread Ian Thomas
Here's a direct lift from something I posted on the OSFlash list... This is all to do with floating-point precision and that you can't represent all numbers exactly (0.1 is one culprit) in the IEE standard. There are plenty of sites about this - see here, for example: http://en.wikipedia.org/wiki

Re: [Flashcoders] Determine text overflow

2006-05-02 Thread Ian Thomas
Would TextFormat.getTextExtent() be of help..? (I know it says 'deprecated' in Flash 8 - that's a documentation error.) Ian On 5/2/06, Ash Warren <[EMAIL PROTECTED]> wrote: I have always found that setting the textfield to autosize = "left" and filling it one letter at a time checking the widt

Re: [Flashcoders] classes extending movie clip problem

2006-05-02 Thread Ian Thomas
Looks to me like your Object.registerClass is registering the wrong symbol ID - "menu_mc" instead of "videoPlayerEmpty_mc". Ian On 5/2/06, August Gresens <[EMAIL PROTECTED]> wrote: Hello I've got a class that extends movieclip. This class is being associated with a movieClip in the Libary usin

Re: [Flashcoders] quick question about buttons

2006-05-02 Thread Ian Thomas
Or even: var doStuff:Function=function (){ // code... } myButton_btn.onRelease = doStuff; myButton_btn.onPress = doStuff; myButton_btn.onRollOver = doStuff; or import mx.utils.Delegate; function doStuff(){ // code... } var delDoStuff:Function=Delegate.create(this,doStuff); myButton_btn.

Re: [Flashcoders] destructors...

2006-05-03 Thread Ian Thomas
Hi Andreas, To turn it on its head... What are you trying to achieve? In what circumstances do you need to destroy a class? Ian On 5/3/06, Andreas Rønning <[EMAIL PROTECTED]> wrote: has anyone got a good way for an as2 class to destroy itself? I know it's not "possible", but my heart tells m

Re: [Flashcoders] destructors...

2006-05-03 Thread Ian Thomas
Um - I'm not sure it is beside the point. :-) Given that you are at the mercy of the garbage collector, implementing a function like: class MyClass { function cleanup() { delete _someProp; delete _someOtherProp; } } is pointless anyway, because if you delete an object of MyClass (or rat

Re: [Flashcoders] destructors...

2006-05-04 Thread Ian Thomas
Good point. I assumed - Andreas - that you were talking about deleting _instances_ of a class; not actual classes. :-) Ian On 5/4/06, elibol <[EMAIL PROTECTED]> wrote: Wait though, isn't a class part of the swf compilation? Technically, you really cannot delete it unless you load the class in

Re: [Flashcoders] destructors...

2006-05-04 Thread Ian Thomas
Yep - that works perfectly well. But it's always better to avoid situations like this: Some of the developers used the same classes and slightly modified them for their needs. by assigning different package names to different modules, if you know they'll all be running in the same 'container' ap

Re: [Flashcoders] no rollovers when mousebutton is pressed

2006-05-08 Thread Ian Thomas
is onDragOut() useful to you? Ian On 5/8/06, Michael Stuhr <[EMAIL PROTECTED]> wrote: is this true ? while holding down the mouse, there's no rollover anymore, even the dragOver doesn't respond ? ___ Flashcoders@chattyfig.figleaf.com To change your

Re: [Flashcoders] Best SWF Wrapper

2006-05-10 Thread Ian Thomas
I personally would avoid Zinc. Although we've used it successfully, I've had two or three of their updates introduce bugs which break our products, and I've had to revert until a fix comes along. The quality control is just too shoddy. Ian On 5/9/06, eric dolecki <[EMAIL PROTECTED]> wrote: I'm

Re: [Flashcoders] Optimization techniques

2006-05-17 Thread Ian Thomas
Hi Marcelo, The obvious optimisation would be to cache the scaled images on the server - save them under a name dependent on the dimensions of the generated image. E.g. trees.jpg becomes cache/trees_400x300.jpg Then when you serve the image, just check to see if the file is in the cache - if it

Re: [Flashcoders] Optimization techniques

2006-05-18 Thread Ian Thomas
problem with my current architecture, but I guess I will just store many different versions of the image **on the disk** instead of using gd each time the users requests the image. See the topic at as.org: http://www.actionscript.org/forums/showthread.php3?t=106049 Thanks again! Marcelo. On 5/1

Re: [Flashcoders] PHP :: Dimensions of a SWF file?

2006-05-25 Thread Ian Thomas
Well, you learn something new every day... *throws away existing code*. Thanks, Steve! Ian On 5/25/06, Steve Webster <[EMAIL PROTECTED]> wrote: The built-in getimagesize() function supports SWF files: http://uk.php.net/getimagesize Enjoy! ___ Flas

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Ian Thomas
Errm - actually that's not such a good reason. The 'import' statement doesn't actually embed a class into the .swf. All it does is tell the compiler that when you type (for example) MyClass, you are actually referring to com.fred.MyClass. You could just type com.fred.MyClass throughout the body

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Ian Thomas
Yep - just to reiterate (and hopefully make it more clear): The line: import com.fred.MyClass; Is _not enough_ to get Flash to compile MyClass into your .swf file. You need to actually _reference_ MyClass for it to be included. e.g. var a:MyClass=new MyClass(); In fact, import is _nothing to d

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Ian Thomas
Hi Derek, That's really interesting - and goes against everything I'd expect. Particularly when your other results have kind of proved the opposite (and I've certainly proved the opposite before with ClassFinder situations). A couple of other tests might prove illuminating... - Is the same true

Re: [Flashcoders] Getting the class name?

2006-05-25 Thread Ian Thomas
Having googled to find your code - that's a really nice way of doing it. Well done! (Does anyone know if AS3 has a better reflection system than AS2..?) Ian On 5/25/06, eka <[EMAIL PROTECTED]> wrote: Hello :) i think it's more easy to use my class :) _

Re: [Flashcoders] Get Original Variable's Name in Function?

2006-05-30 Thread Ian Thomas
That won't work - for example: var foo:String = "ABC"; var moo:String = "ABC"; myFunct(foo); myFunct(moo); // Output foo: ABC foo: ABC On 5/30/06, Kenneth Kawamoto <[EMAIL PROTECTED]> wrote: >Is it possible to retrieve the name of the variable passed into a function? function myFunct(str:Str

Re: [Flashcoders] Get Original Variable's Name in Function?

2006-05-30 Thread Ian Thomas
Lee, Terribly sorry about that. I'll tell my email delivery system to be a bit faster next time, shall I..? If everyone were to wait to see whether someone else had already replied, nothing would ever get posted. Apologies if, for some reason, it's caused you a problem. Ian On 5/30/06, Lee Mc

Re: [Flashcoders] AS 2.0 and Casting to datatypes ...

2006-05-31 Thread Ian Thomas
Hi, As Mike says, casting is used to tell the compiler that you're sure about the type of an object - where the compiler would otherwise report an error, because it's unsure. This is commonly needed in situations such as when you're using an object designed for handling generic types to manage

Re: [Flashcoders] AS 2.0 and Casting to datatypes ...

2006-05-31 Thread Ian Thomas
Whoops - instead of this: var animal2:Animal=z.removeAnimal("fido"); if (animal2 instanceof Dog) { var myDog:Dog=Dog(animal2); animal2.fetchNewspaper(); } I meant: var animal2:Animal=z.removeAnimal("fido"); if (animal2 instanceof Dog) { var myDog:Dog=Dog(animal2); myDog.fetchNewspaper(

Re: [Flashcoders] create an object of type defined with a string

2006-06-01 Thread Ian Thomas
Hi Danny, mx.utils.ClassFinder.findClass("SomeClass") returns the constructor function for a class. e.g. var className:String = 'String'; var cls:Function = mx.utils.ClassFinder.findClass(className); var object:Object = new cls(); Hope that helps, Ian On 6/1/06, Danny Kodicek <[EMAIL PROTECTED

Re: [Flashcoders] Weird OOP ability... Need a description of why, or at least some documentation

2006-06-01 Thread Ian Thomas
Hi Drew, That's just type casting. See my email of a few days ago. It's actually redundant in the example you provided, because the compiler already knows that it's a MyTestClass object. You could replace it with: var myInst:MyTestClass = new MyTestClass(); myInst.runTest(); If, however, for

Re: [Flashcoders] How do real developers do key handling?

2006-06-07 Thread Ian Thomas
You don't need any special hash class for this; since you're using string keys, you can simply use the Object class, like so: class ChannelInput { private handlerMap:Object = null; function ChannelInput() { handlerMap = new Object(); } public function addKey(key:String, handler:KeyHandler):Vo

Re: [Flashcoders] The Delegate class ...

2006-06-14 Thread Ian Thomas
Delegate, sadly, is a necessity. I very rarely use components. I use Delegate all the time. (Or rather, my own hand-rolled version, which deals properly with arguments - there are a bunch of such replacement versions knocking around.) See here for more info on Delegate and its usage: http://www

Re: [Flashcoders] The Delegate class ...

2006-06-15 Thread Ian Thomas
On 6/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Alot of people complain that you can't pass parameters with delegate. Well you can, a multiple of ways, and if you structure your code with some forethought, you can have it pass params if you are delegating a function structured do so.

Re: [Flashcoders] Sharing fla over network

2006-06-15 Thread Ian Thomas
And if you're going to be working on a collection of different external .as files, it's always a good idea to look at using a versioning system such as Subversion/SVN - http://subversion.tigris.org Versioning systems aren't a great deal of help with binary files such as .flas, but are a great hel

Re: [Flashcoders] Accessing non-interface methods from an object ofan interface type

2006-06-15 Thread Ian Thomas
It's really all about the design. It very much depends on what you're trying to use the interfaces to achieve. If you're finding that you constantly need to downcast the interfaces to concrete objects then either your design isn't one that's suited to interfaces, or you're using them in the wrong

Re: [Flashcoders] Accessing non-interface methods from an object ofaninterface type

2006-06-15 Thread Ian Thomas
On 6/15/06, Mark Lapasa <[EMAIL PROTECTED]> wrote: Thx Ian, the only thing I can think of as an argument is Marker Interfaces. Then again, I think I might just be using using interfaces the wrong way as I am trying to establish some form of polymorphism in trying to access both foo() and bar() me

Re: [Flashcoders] Accepting 1 parameter with 2 possible types in a method?

2006-06-15 Thread Ian Thomas
Hi Adrian, I'd do it like this: private function myMethod(i:Object):Void { if (i instanceof String) { // do this } else if (i instanceof Number) { // do this } else { // report an error } } And, as you see, stick in an error condition - because by changing the input type to Obje

Re: [Flashcoders] Accepting 1 parameter with 2 possible types in a method?

2006-06-15 Thread Ian Thomas
Hi Adrian, Your i:Object declaration is a _compile-time_ declaration. All it's there for is to make the compiler happy. instanceof, which is what I'm using (typeof is an older construct which is more limited and less safe) is an operator which does a comparison at runtime on the underlying object

Re: [Flashcoders] Accepting 1 parameter with 2 possible types in amethod?

2006-06-15 Thread Ian Thomas
Yes - but - why bother omitting it? It's only a few characters you're saving - the word :Object. If later down the line you decide to change compilers and go with MTASC (or perhaps port your code to AS3) you'll have to trawl back through all the code putting those missing type definitions back in

Re: [Flashcoders] MDM Zinc, 2.5, minor 15, 16, exit() error?

2006-06-19 Thread Ian Thomas
Martin, I'd suggest thinking about rolling back to an earlier Zinc version. It may fix the problem. It seems to work okay in version 14, if that helps. We have terrible trouble with Zinc's new releases. Each new release seems to introduce a new bug, breaking old features which have been working

Re: [Flashcoders] Can't reach boolean?

2006-06-19 Thread Ian Thomas
Michael, When are you tracing this? Have you given everything enough time for the variables to be properly set up? Try leaving a frame at the beginning before doing so. HTH, Ian On 6/19/06, Mendelsohn, Michael <[EMAIL PROTECTED]> wrote: Hi Danny... Thanks for responding. The value is just a

Re: [Flashcoders] Junior Developer Flash/Flex Salary?

2006-06-20 Thread Ian Thomas
Dollars? Pounds? Lira? Deutschmarks? Yen? And in which country? And which part of that country? I'm pretty sure I can guess which currency and country - but there is more world out there than just the USA, you know. Ian On 6/20/06, Tristan <[EMAIL PROTECTED]> wrote: Does 30-55K a year sound r

[Flashcoders] Physics Engine?

2006-06-22 Thread Ian Thomas
Hi folks, Does anyone know if there's an Actionscript (preferably AS2) physics engine out there other than Flade? Thanks, Ian ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com

Re: [Flashcoders] Physics Engine?

2006-06-23 Thread Ian Thomas
Thanks Franto - my mistake for skipping that discussion. The other one mentioned is: http://www.harveycartel.org/metanet/tutorials.html However, the last discussion was about free physics engine, whereas I'll happily take a look at anything commercial out there as well - if anyone's got any comme

Re: [Flashcoders] Transparent background in projector (Screenweaver)

2006-06-26 Thread Ian Thomas
Hi Franto, That's the fourth time I've had your email... Gmail doesn't automatically tag your outgoing mail, and ignores it when it arrives back at your mailbox - so you won't necessarily see it against a Flashcoders tag. It _has_ been sent, tho' - just look at your Sent mailbox. HTH, Ian On

Re: [Flashcoders] Transparent background in projector (Screenweaver)

2006-06-26 Thread Ian Thomas
Hi Franto, I think it's just someone on the list whose email is now invalid - I'm getting the same error when I post. I'm afraid I can't help with the original problem! Ian On 6/26/06, franto <[EMAIL PROTECTED]> wrote: Hi Ian, thanks, i know, that i will not see my message, but after each

Re: [Flashcoders] optimizing an animation?

2006-06-26 Thread Ian Thomas
Another approach is to switch to a single bitmap for the whole MC, scale and tween, then switch back to your vector version once the tween has finished. Ian On 6/26/06, Mick G <[EMAIL PROTECTED]> wrote: I've seen this mostly when the MC being tweened either has a lot of vector information or la

Re: [Flashcoders] Sound markers

2006-06-27 Thread Ian Thomas
Hi Christophe, We've done similar using SoundForge simply by exporting the regions/markers file as a text file and loading it in alongside the SWF - parsing it, and triggering events based on the contents. HTH, Ian On 6/27/06, Christophe Herreman <[EMAIL PROTECTED]> wrote: Hey Tom, we don't

Re: [Flashcoders] Sound markers

2006-06-27 Thread Ian Thomas
Sorry, I meant loading it in alongside an external .mp3. Having a bad morning here... Ian On 6/27/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Christophe, We've done similar using SoundForge simply by exporting the regions/markers file as a text file and loading it in alongs

Re: [Flashcoders] Sound markers

2006-06-27 Thread Ian Thomas
Yes, Tom, they are - it's someone else registered on this list who's account is broken, not yours. I had the same thing yesterday. Ian On 6/27/06, Tom Jackson <[EMAIL PROTECTED]> wrote: are my messages getting through? every time I send a message I'm getting a email account not registered , mes

Re: [Flashcoders] Sound markers

2006-06-27 Thread Ian Thomas
Nice trick, Christophe - thanks for sharing that. You never know what might come in useful some day... Cheers, Ian On 6/27/06, Christophe Herreman <[EMAIL PROTECTED]> wrote: Hey guys, I found a little workaround using the scripting possibilities in SoundForge. You can find a little explanatio

Re: [Flashcoders] Flash MX 2004 Developer Exam - Actionscript versions

2006-06-28 Thread Ian Thomas
I use Object.registerClass all the time. It is very handy when programmatically controlling which class is associated with a symbol without having to specify a class in the Linkage dialog in the library, for example (which means you can associate different classes with the same symbol if you want

Re: [Flashcoders] Getting FLV file size server-side

2006-06-28 Thread Ian Thomas
Hi Janis, If you're just looking for the file size, you shouldn't need to go anywhere near the file header! Won't the following work? HTH, Ian On 6/28/06, Janis Radins <[EMAIL PROTECTED]> wrote: Hello people! I'm trying ot get size of FLV file server-side using php, searched list archive a

Re: [Flashcoders] Oregano forum/mailing list/etc

2006-06-29 Thread Ian Thomas
Hi Erix - your answers do reach Flashcoders - this is the second time I've seen your post this URL on this thread. :-) HTH, Ian On 6/27/06, erixtekila <[EMAIL PROTECTED]> wrote: Hep, http://forum.v-i-a.net You're welcome to register. Don't know why my answer never reach flashcorder ?

Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Ian Thomas
To the best of my knowledge, no, unfortunately. That's one of the reasons that I'm looking forward to AS3. :-) Ian On 6/29/06, Jason Lutes <[EMAIL PROTECTED]> wrote: Since this relates to some things that were brought up recently... Is it possible to have a class that extends MovieClip, but d

Re: [Flashcoders] weirdness passing string to text field

2006-07-05 Thread Ian Thomas
One possibility might be that you're using an embedded font, but haven't embedded all the characters in that font. HTH, Ian On 7/5/06, Rick Lecoat <[EMAIL PROTECTED]> wrote: Hi, I'm trying to pass a sting variable (var teamName:String) to a dynamic text field nested inside a couple of layers

Re: [Flashcoders] embedFonts vs. setTextFormat

2006-07-05 Thread Ian Thomas
That would affect all the text currently in the field. Ian On 7/5/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote: But couldn´t I just set a new TextFormat using the setTextFormat() method? On 7/5/06, Andreas Rønning <[EMAIL PROTECTED]> wrote: > > Because it allows you to use several dif

Re: [Flashcoders] AS2 and watch ...

2006-07-06 Thread Ian Thomas
I use 'watch' for exactly this purpose - drawing differences between an enabled and disabled MovieClip by watching the 'enabled' property. Cheers, Ian On 7/6/06, eka <[EMAIL PROTECTED]> wrote: Hello :) You can use watch with a MovieClip if you want create components with an event when you use

Re: [Flashcoders] Help for a Java Guy: Instantiating a MovieClip with a linked class and calling class methods

2006-07-06 Thread Ian Thomas
Hi Julian, You were nearly there with: Object.registerClass("mFooA", FooA); var aObject:FooA_Class = _root.attachMovie("FooA", "FooA", 1); Just change it to: Object.registerClass("mFooA", FooA); var aObject:FooA_Class = FooA_Class(_root.attachMovie("FooA", "FooA", 1)); (as Class(x) is the equiv

<    3   4   5   6   7   8   9   >