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 width at each loop works.  Then
when it goes over the max width, trim it by one letter and display the
field.

Just set the alpha to 0 or something to hide it while you do the loop then
set it back to 100 when it is done.  This way you can also dynamically
control when to show more links based on if there is still text left in
the buffer or original text string that hasn't been sliced and thrown in
the field.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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.onRelease = delDoStuff;
myButton_btn.onPress = delDoStuff;
myButton_btn.onRollOver = delDoStuff;

Ian

On 5/2/06, ryanm [EMAIL PROTECTED] wrote:

 You can do this:

 myButton_btn.onRelease = myButton_btn.onPress = myButton_btn.onRollOver =
 function(){
 doStuff();
 }

In my experience that doesn't work. It *should*, but for some reason,
the function never gets assigned to most or all of the events. Better is to
use Delegate.

import mx.utils.Delegate;

function doStuff(){
// code...
}
myButton_btn.onRelease = Delegate.create(this,doStuff);
myButton_btn.onPress = Delegate.create(this,doStuff);
myButton_btn.onRollOver = Delegate.create(this,doStuff);

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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/Floating_point#Problems_with_floating-point

You are almost certainly better off working with integers; or perhaps
multiplying up your numbers by 100 before working with them, then
reducing as a final step, or something similar.

This is not just limited to Flash/AS2 as an issue.

Ian

On 4/28/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Apologies if this is common knowledge, but I've just come across a huge maths 
problem in Flash... as I've mentioned before I'm working on an online trading 
system where real people make or lose real money, sometimes a huge amount of 
it, so this isn't funny...

Here's some simple arithmetic..

var a:Number = 171.9;
var b:Number = 172.2;
var c:Number;
c = b - a;

Now an elementary school kid would probably give the answer 0.3
Unfortunately Flash has other ideas...

trace(c);
0.283

I'm a bit shocked to be honest. Am I imagining it?

I'm aware that AS3 introduces proper integers and floats for arithmetic, but 
that doesnt address my problem now.

What says the wise Chattyfig community??

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 getters
 and setters, and just use normal functions. It seems that if when you
 set or get a property, if it is more than just getting or retrieving a
 value, then there is no reason to hide those computations from the
 programmer using the class.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 load some text from a .txt file into a dynamic textfield, but inside
 the text there are some greek/math chars, like alpha, beta, delta...
 I can't use the usual chracter entities, neither decimal chars nor hex
 chars, because they use always the char ''.
 How can I solve this? There isn't any other solution, out of fold in the
 chars set in Flash?

  Enrico Tomaselli
   + web designer +
   [EMAIL PROTECTED]
 http://www.metatad.it
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 empty MovieClip created with the
 createEmptyMovieClip method, not a MovieClip in the Library.

 Thoughts?
 -g
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 replace it.

If you try:

var myArray:ArrayExtension = new ArrayExtension();

myArray.push(Hello);
myArray.push(Goodbye);
myArray.push(World);

That should sort your problem.

HTH,
  Ian

On 4/18/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I have created a Class that extends Array, called ArrayExtension. The only 
 way that I have found to add
 values to this is array is in the following manner:

 ---
 // CODE
 import com.ArrayExtension

 var myArray:ArrayExtension = new ArrayExtension(Hello,GoodBye,World)


 //CLASS
 class com.ArrayExtension extends Array
 {

 public function ArrayExtension()
 {
 super()
 for(var i=0; i arguments.length; i++)
 push(arguments[i])

 }

 }
 ---

 The problem I am running into is if I want to add values to the array after 
 initializing it, I get an error message.
 Here is an example:

 ---

 var myArray:ArrayExtension = new ArrayExtension;

 myArray = [Hello,GoodBye,World]

 ---

 How can I add values to the array without generating an error?

 Thanks for any and all replies.

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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/Swfmill
rather than the IDE. You can pick and choose which classes get built
into a given .swf in much the same way as you can with Java - if
you're so inclined.

Ian

On 4/12/06, Julian 'Julik' Tarkhanov [EMAIL PROTECTED] wrote:

 On 12-apr-2006, at 19:59, JesterXL wrote:

  To force a class to be imported even if no one uses it:
 
  import com.company.project.YourClass;
 
  static private var depend:YourClass;

 Ok, now this looks classy! Forces the class to be burned in and yet
 shows why it's there.

 Thanks a bunch!
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 traced.

Set clip._visible=false
Test the movie - click on where the clip should be, and nothing
happens. The clip has effectively been removed from the drawing
heirarchy completely.

Cheers,
  Ian


On 4/6/06, zikey Han [EMAIL PROTECTED] wrote:
 I kown that one different between _alpha=0 and _visible =flase.

 when we load a picture or swf ,like this:

 this.createEmptyMovieClip(container_mc,0);
 container_mc.loadMovie(test.jpg);
 container_mc._alpha =0 ;
 you can see nothing in the scene.because of ._alpha =0;
 but if you
 container_mc_visible=false ;
 you can see the test.jpg on the scene._visible = false
 do nothing.

 i want to kown ,what the other different between them.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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!
 There's something that I really can't understand in Flash 8
 Before ('till Flash 7), if you made a 100 pixels object animation in 10
 frames, flash knew how to display a 1/10 pixel and the animation was
 quite smooth.
 That was sometimes a problem because when we wanted a aliased display,
 we had to enter entire coordinates for the object...
 Now, by default, flash displays the object in animations only on entire
 pixels, but only for animation  so the choice doesn't seem to be
 really good... when we want a aliased text, we still have to enter
 manually entire coords, but in the animation we can't avoid those entire
 coords... it shall be the contrary, isn't it?

 is there an option, checkbox or something else to be able again to have
 smoothed 100 pixels in 10 frames animation instead of a pixel each second?

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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...

   It'd be great to find the root cause of this. It only seems to be
in certain circumstances - most of the time it all works fine, but
some particular loading sequences just break things and cause FP7 to
crash, and I have to revert to queuing for that particular load
sequence to work.

Ian

On 4/4/06, Roman Blöth [EMAIL PROTECTED] wrote:
 Hello folks,


 once again flash strikes my mind:

 I've made a small test movie to test my ClipLoader-class, which stores
 and handles loading queues using a MovieClipLoader.

 To make a stress test I queue 5 larger swf files for loading on button
 press (made another button for testing a stop-function).

 When trying it out using flash player 8 everithing works just fine, when
 I try the same using player 7 (as browser plugin, that is), then the
 whole thing crashes.

 When using my ClipLoader-class in an actual project, everithing works
 fine when only one file is added to the queue, but even the Flash IDE
 crashes completely when adding several files for loading.

 We've been through all of the code and debugging output for two days
 with two programmers now, but we can not find any clue on about what the
 problem is.

 Anyone out there ever has made experience like this?
 MovieClipLoader.loadClip crashing flash ide/flash plugin under certain
 conditions?!


 Any comment welcome,
 regards,
 roman.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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
 500ms (using a setInterval which then invoces the next loadClip) and now
 we have no crashes any more.

 That is: When (pre-) loading several external files in queue put a delay
 of about 500ms between onLoadInit and loadClip to prevent flash from
 crashing.


 Best regards,
 Roman.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] + simbol issue help

2006-03-29 Thread Ian Thomas
My guess (and it is only a guess) is that Flash is treating the
contents of LoadVars like a url-encoded string. e.g.
thing1=Something+something+elsething2=Another+thing

Which would mean that it probably replaces your '+' symbol with a space.

I'd try urlencoding your vars before you output them (in your ASP file
- I'm not sure what the  urlencode() function is in ASP but I'm sure
there is one). That way, the characters should get through okay.

For example:
thing1=A bucket of frogs+toads

would become:
thing1=A+bucket+of+frogs%2Btoads

See? It's encoded the + symbol as %2B.

This will also take care of any '' or '=' signs that might cause you problems.

Hope that's helpful,
  Ian

On 3/29/06, Alfredo Laguia [EMAIL PROTECTED] wrote:
 yes i added the symbol in the list
 and i did everything that i do allways

 the code is simple:
 *
 misVars = new LoadVars()
 var cantidad:Number
 misVars.onLoad = function(success){
   if(success){
//trace(misVars)
cantidad = misVars.cant
montoDatos()
trace(misVars[titulo+3])
   }
   else{
trace(error al cargar los datos)
   }
  }


 misVars.load(http://www.inaltia.es/demo/loadInfoNoticias.asp;, GET)



 var posY = 60
 montoDatos = function(){
  for(var i= 0; icantidad; i++){
   container = menu.grupoNOTICIAS.NOTICIASMC
   container.attachMovie(moduloNOTICIA, consolaNoticias+i, 100+i)
   container[consolaNoticias+i]._y = posY
   container[consolaNoticias+i].fecha_txt.text = misVars[fecha+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._visible = 100;
   noticias.noticiasEXTENDIDAS.noticias_txt = this._parent.contenido

   }
   posY = posY +60



  }


 }

 


 - Original Message -
 From: Ian Thomas [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Wednesday, March 29, 2006 3:52 PM
 Subject: Re: [Flashcoders] + simbol issue help


  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 an asp and calling the asp throw the explorer
  i can see the content data without issue.
 
 
thx for help!
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 scripting for Vista and almost certainly
many other things out there.

There's been a sort of convergent evolution thing going on for the
last few years. Granted, OOP is not _required_ in some of those
languages, but their code libraries are all evolving that way and each
new release of the language seems to be firming up their OOP model. If
you can get at least one OOP language under your belt it'll get you
halfway towards learning any of those other languages - it's gaining
the 'how it works' mental model that can apply to most high-level
modern programming or scripting.

So go for AS2.

HTH,
  Ian

On 3/27/06, Kevin Cannon [EMAIL PROTECTED] wrote:
 Hi,

 I hope this isn't off-topic but I've been struggling to find the answer, and
 this list has been a great help to me over the years.

 I'm a designer, but often code in Flash. I'm not building huge RIAs, usually
 just adding small little bits of interactivity to sites, and building some
 multimedia interfaces and gathering data from XML etc...  Nothing hardcore,
 but a bit more that just tinkering with AS.

 Up until now I've always used AS1, and though I've bought Colin Moock's AS2
 book, it seems like a bit leap to make, and from what I've read it seems like
 many of the advantages of AS2 are in having proper OO, and more manageable
 code for large projects.

 I'm wondering if AS2 offers any advantages to me, or if sticking with AS1
 would be better. Is AS2 (and now 3) the natural progression of Flash coding,
 is there even a future for AS1, all the useful libraries seem to be AS2 only
 these days too, perhaps that alone is a reason to switch. I'm unsure as to
 what path I'm supposed to be on.

 Any advice you could give me would be appreciated,

 - Kevin
 _
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 problem. For example, a key bit of
functionality (for me) broke in a new version. I raised it as an issue
- it was acknowledged and assigned a bug id - and reverted to an older
version. No announcement of the functionality being fixed was ever
made. A couple of months later I downloaded a newer version and, lo
and behold, it was fixed, but that fix wasn't mentioned in any release
note. And something else was broken.

Bit of a quality issue going on there...

Ian
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 the following problem but didn't get an answer.

 I'd like to create a movieclip with my individual mc-class, that is to
 say, a createEmptyMovieClip() function but with getting my individal MC
 - createEmptyMyIndividualMC().

 I tried the following, but like you guess, myIndMC is a MovieClip so I
 get type-problems..

 Is there a way to get this working, to register a Class to a MC
 (registerClass() hasn't done it, too) and maybe call its constructor?

 private function createEmptyMyIndividualMC():MyIndividualMC

var myIndMC:MovieClip =
  this.createEmptyMovieClip(example_mc,4);

myIndMC.__proto__ = MyIndividualMC.prototype;

return myIndMC;
 }

 class MyIndividualMC extends MovieClip
 {

 }


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 might throw this off are:
  - The loader movie (not resources.swf) contains a different verstion
of the Const class. The first version of any class loaded by Flash is
the one that is used throughout the app, regardless of what's compiled
into movies loaded later on.
  - The loader movie is compiled for a different version of Flash
Player from the resources movie. From memory, a Flash 7 movie has a
_different_ global variable space from a Flash 8 movie (or is it 6 and
7? Can't remember offhand), even if they're both running in the same
player.

HTH,
  Ian

On 3/23/06, Dave Mennenoh [EMAIL PROTECTED] wrote:
 Can someone kindly point out my lack of understanding here - so that I don't
 need to use any globals I created some static getter and setter methods in a
 class I call Const - for constants. Here's a short version, but enough to
 illustrate with:

 class Const {
 static function get portfolioPath():String {
 return hardCoded path to my images folder;
 }
 }

 Within my resources movie I say something like:

 myLoader.loadClip(Const.portfolioPath + imageName.jpg, picHolder);

 This works great. But, when I load resources.swf into my navigation movie,
 Const.portfolioPath is showing undefined. This has me baffled. I thought the
 reference to Const.portfolioPath would be replaced with the hardCoded path
 to my images folder when the resources.swf was compiled... Evidently it's
 not though?

 To get around this I created a portfolioPath timeline variable within
 navigation and then reference it from resources using _root.portfolioPath,
 but this isn't how I'd prefer to do it.

 Thanks.



 Dave -

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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_Partsfile=2061.html

Sorry for the long URL - that's livedocs for you!

HTH,
  Ian

On 3/24/06, Robert Chyko [EMAIL PROTECTED] wrote:
 Regarding Internationalization - does the Flash Player have access to
 the language code or is it something that needs to be passed in to your
 movie?



 Bob
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[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 far removed from a simplified Habbo Hotel or
similar. And won't require blistering speed, but will need to keep up
with player movements (on a grid) and simple textual messages
player-to-player.

  I've been doing a bit of reading on various backends. I'm looking at
running a Java backend (unless there's an extendable C++ or C#
solution out there) and was wondering if anyone had any good/bad
experiences to report on the following - and if there's anything I've
missed that would suit the task better:
  - Oregano (http://www.oregano-server.org/) (I'd prefer AS2, it
appears to be AS1)
  - Red5 (http://www.osflash.org/red5) (Not sure it's got the features
I need yet?)
  - Unity2 (http://www.moock.org/unity/) (Eeep! $140 to get started)
  - Sushi (http://www.rawfish-software.com/)
  - ElectroServer (http://www.electrotank.com/ElectroServer/)

I need something which is expandable at the backend (you know, so I
can put the bulk of the game engine server-side). The comms needs only
to be very straightforward object/data exchange, nothing fancy - I
don't need lobbies and things, for example.
I'd prefer an AS2.0 API client-side rather than AS1.0.

I'd also prefer it to be free - at least for enough connections for my
proof of concept (10 users, I'd guess). I'd _actually_ prefer it to
be Open Source, but that may not be possible.

My feeling (from a speed perspective) is that I'd be better looking at
something which does binary send/recv rather than XML/SOAP - but I'd
be happy to be proved wrong (debugging XML is so much easier than
binary...)

Anyone got anything to recommend/any comments on the above/experiences
to share..?

Many thanks,
  Ian
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 therefore going to be a _lot_ faster than anything you can
come up with in ActionScript.

HTH,
  Ian

On 3/20/06, Adrian Park [EMAIL PROTECTED] wrote:
 I want draw regular shapes with antialiased edges into a blank BitmapData
 object. A rectangle is simple (if it isn't rotated at all) but how would I
 go about drawing something like a filled circle at a specified position with
 a radius r?

 I figure I could easily draw what I want using vectors and then create a
 BitmapData instance from this but this seems a little convoluted and
 inefficient to me. I've also thought about writing some code to work out
 which pixels are completely encompassed within the circle and giving these
 solid colour and then manually calculating the amount to tint pixels at the
 edge of the circle to create the antialiasing but the routines I have in my
 head would be even more inefficient than the vector method.

 Anybody done this, know of any examples/code or have any bright ideas?

 Thanks, Adrian P
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[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.
- retrieve a TextFormat object from the textfield
- do some calculations using getTextExtent() on that TextFormat

Unfortunately, it looks very much like getTextExtent is performing
calculations using the system version of the font, rather than the
embedded version.

A specific example is:
- I calculate the width of a piece of text, making sure it fits
exactly on to two lines. The calculations all look right, but once I
set up the field size to the values returned from getTextExtent(), the
text wraps on to _three_ lines. If I turn _off_ the font embedding on
the field, it all works as expected. This indicates, to me, that
getTextExtent isn't using the embedded font.

Has anyone got any experience of this or any thoughts?

So far, I've tried setting embedFonts=true on my TextFormat object
(undocumented but apparently a hack used by some people to get font
embedding working). Otherwise I'm a bit stumped - I don't really want
to turn off the nice smooth outlines!

Oh, for reference Flash 8, but publishing to FP7.

Ta,
  Ian
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 using the metrics of the embedded font but isn't
taking antialiasing into account - or something like that.)

If I turn font embedding off then the field lays text out in exactly
the way that getTextExtent() predicts that it should - if I turn font
embedding on, then the text in the field is slightly wider than
getTextExtent thinks it should be.

What it looks like I need to do is to make getTextExtent() use the
embedded version of the font for it's calculations. And that's where
I'm stumped - I'm using getTextFormat() on the field which has the
font embedded in it, but it looks like that isn't getting through to
getTextExtent().

Cheers,
  Ian

On 3/20/06, Éric Thibault [EMAIL PROTECTED] wrote:
 Hi! Here is some code I've used... maybe could help... It was working!

 //The last time I used getTextExtent...

 var txt_fmt = new TextFormat();
 with(txt_fmt) {
 font = Arial;
 size = 12;
 bold = true;
 color = 0xBEA875;
 }

 var metrics = txt_fmt.getTextExtent(here is my text...);


 this.createTextField(dynamicText,10,0,0,metrics.textFieldWidth,metrics.textFieldHeight);
 dynamicText._visible = 0;
 dynamicText.multiline = false;
 dynamicText.wordWrap = false;
 dynamicText.selectable = false;
 dynamicText.text = MonTexte;
 dynamicText.setTextFormat(txt_fmt);

 Éric.


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 all your coders to treat variables in capitals as
constant and not to change their values.

Secondly - who knows? Those variables aren't actually referred to in
the code except for on their defining lines. They could be used for
absolutely anything at all. You'd need to be much clearer on the
purpose of those variables before anyone could tell you if they
'should' be constant. But see my first paragraph.

I could answer more fully if I knew why you were asking, and what the
values were actually supposed to be...

Ian

On 3/20/06, Chris [EMAIL PROTECTED] wrote:
 In the following example should maxHeight and maxWidth be constants?
 If not, why?

 class Box {
 //accessing a static property through a method.
 //The box class, with methods to set and retreive the
 //value of the class property, numSides.
 //
 //The class property numSides
 private static var numSides:Number = 4;
 //
 private var width:Number;
 private var height:Number;
 private var area:Number;
 //
 //all CAPS denotes constants, values that never change.
 private static var DEFAULT_WIDTH:Number = 30;
 private static var DEFAULT_HEIGHT:Number = 20;

 //SHOULD THESE BE CONSTANT
 public static var maxWidth = 250;
 public static var maxHeight = 250;
 //
 //The constructor function.
 public function Box(w:Number, h:Number) {
 if (w == undefined) {
 w = DEFAULT_WIDTH;
 }
 if (h == undefined) {
 h = DEFAULT_HEIGHT;
 }
 width = w;
 height = h;
 //initialize area. This is perfectly legal within a 
 constructor
 area = width*height;
 }
 //Method for setting numSides.
 public function setNumSides(newNumSides:Number):Void {
 numSides = newNumSides;
 }
 //Method for getting numSides.
 public function getNumSides():Number {
 return numSides;
 }
 }

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 original post to answer the poster's
question.

Ian

On 3/20/06, Steve Webster [EMAIL PROTECTED] wrote:
 Ian,

  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

 It's not really beside the point. We define constants in this way...

 class Test {
 public static function get SOME_CONSTANT():String {
 return value;
 }
 }

 ...which works perfectly.


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 than that I've never had any issues relating to
running Flash off the CD at all - works well for me.

Cheers,
  Ian

On 3/20/06, Michael Hulse [EMAIL PROTECTED] wrote:
 On Mar 20, 2006, at 2:04 AM, Jim Tann wrote:
  I reguarly use flash for projects like this. I don't like director,
  just
  a personal thing. I never feel my assets are organized when using it 
  I
  hate Lingo. But I guess what it comes down to is what you are used to.
  I
  love flash  hate director.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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=Delegate.create(this,onLoadedClip);
mcl.load(url,myClip);

... from memory, that ought to work (as long as myClip is the clip
you're loading into)

(Delegate makes the calling of anonymous functions much clearer - see
http://www.osflash.org/flashcoders/as2#handling_scope_in_event_handlers
for more details on that one.
)

HTH,
  Ian

On 3/18/06, Marco Tabini [EMAIL PROTECTED] wrote:
 Thanks Helen--

 Still having the same problem though. Here's my code now:

 ld = new MovieClipLoader();
 url =

 ld.onLoadInit = function()
 {
 mcClip.gotoAndStop (1);
 }

 ld.loadClip(url, mcClip);


 This only works if I publish in Flash 7 compatibility mode with local
 access only. If I set it to publish in Flash 8 mode, I have to switch to
 network access only and, when I run the movie from the player the movie
 loads but it doesn't stop.

 Any more thoughts? Can anyone try and reproduce this to see if it also
 happens to them? Any remote SWF move should do.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 and some toys

 yes, tons of softwares to record screen, but nothing that have
 drawing tools, templates, charts etc. like PowerPoint.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 (and free), or is actually better
 functionality-wise than ppt?  Are there any scripting tools, like vba with
 ppt?  And what sort of swf exporting support is there?

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 simple dialog that just asks the user to confirm Yes or No in
answer to a question. Let's call this ConfirmDialog.

From a top-level point of view, all your top-level movie clip really cares
about is saying to ConfirmDialog please pop up, ask a specific question,
and tell me what the user answered. Your movie doesn't care _how_
ConfirmDialog actually achieves that, it just wants to know the answer. So
that gives you a pretty clear indication of the division of responsibilities
- your top-level movie doesn't care whether ConfirmDialog uses buttons,
MovieClips, or a text entry box. It also doesn't care what those things are
called.

That might point you to this sort of implementation (just an example - there
are an infinite number of ways of doing this):
- Parent creates a ConfirmDialog
e.g. var myConfirmDialog:ConfirmDialog=ConfirmDialog(attachMovie(blah));
- Parent tells the ConfirmDialog what question to ask, and what function to
call when the question is answered:
e.g myConfirmDialog.setQuestion(Are you really sure about that?);
 myConfirmDialog.setCallback(Delegate.create(this,onQuestionAnswered));
- Parent hands control over to the dialog:
myConfirmDialog.show();
- Then ConfirmDialog does whatever it wants to internally - creates its own
buttons. It could set event listeners on buttons, could set onRelease etc.
These event listeners will call back into ConfirmDialog's own code. Then
ConfirmDialog will call the parent back with the answer - using
onQuestionAnswered(true) or onQuestionAnswered(false)

Does that make any sort of sense?

Like I said, that's one way of doing it - you could do it with event
listeners, you could do it any old how. The important thing to think about
is the division of responsibilities. It's back to that old black box
metaphor - the containing movie really shouldn't care about the inside of
ConfirmDialog, only that it's putting in specific inputs (the question, the
callback) and getting specific things back out again. Likewise,
ConfirmDialog shouldn't care who's calling it - just that it's getting
particular inputs, doing its own thing, then spitting out an output.

This sort of strategy is the basis of componentisation, and is handy for all
sorts of reasons. It means you could re-use that ConfirmDialog code in any
number of different places. It also means that you could replace the
ConfirmDialog code with some completely different input method (say a
Switch-enabled dialog of some sort) and the parent code wouldn't care that
it had changed.

Of course, one step better is if the parent code doesn't even know it's
calling/attaching a movie clip. If you had a whole ConfirmDialogHandler
class that your parent knows about - the parent just goes:
var myHandler:ConfirmDialogHandler=new ConfirmDialogHandler();
myHandler.ask(Are you sure you want to do this?,Delegate.create
(this,onQuestionAnswered));

Then it's up to ConfirmDialogHandler how it does it - it could pop up a
movie clip, it could read out some text, it could 'phone the user up and
squawk in Morse code at him... err...

Well, you get the idea.

Hope that clarifies it a bit,
  Ian


On 2/21/06, Martin Wood [EMAIL PROTECTED] wrote:



 [EMAIL PROTECTED] wrote:
  This is my first experience use the mailing List so I hope this makes
 sense!
  My question is more of a conceptual one regarding oop best practises. If
  I have a class which attaches a clip to the stage how can I attach
 functions
  to clips nested inside this clip. Putting code on the attached clip?s
 timeline
  is wrong, I can use;
 
  myClip.MyChildClip.onRelease = function() { stuff };
 
  It works, but seems fundamentally wrong, as I understood it was bad
 practise
  to add methods to an object dynamically. Should I make the class listen
 for
  clicks on the nested clip or is there another solution?

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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
startTimer.

By saying:
Delegate.create(this, startTimer);

in your doFade() function, you're just creating a function reference and not
storing the value anywhere - not doing anything with it.

What you actually want to do is to call the function, which you should be
able to do with:

this.startTimer();

or even

startTimer();

HTH,
  Ian

On 2/21/06, Wouter Steidl [EMAIL PROTECTED] wrote:


 Good evening people,

 I asked this on the newbie list since I suspect it to be a newbie
 question,,
 but didn't get an answerso I hope to find the answer here:

 I have some code in a class that needs to fire a fuction (startTimer) from
 an onEnterFrame eventi can fire it from an onrelease usung Delegate,
 but
 not from the onEnterFrame..what am I missing here?

 code

 private function doFade():Void{
 container_mc.onEnterFrame = function(){
 this.fader_mc._alpha-=faderSpeed;
 if(this.fader_mc._alpha = 0){
 this.fader_mc._alpha=0;
 Delegate.create(this, startTimer); -- DOESN'T
 WORK
 delete this.onEnterFrame;
 }
 }
 container_mc.onRelease = Delegate.create(this, startTimer); --
 WORKS AND FIRES THE FUNCTION WHEN I CLICK THE MOVIECLIP }

 /code

 Thx for your help,

 Wout

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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?%5Fencoding=UTF8
 


 Charles P.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 doSomething()
{
   if (!_initialised)
   {
  _initialiseMe();
   }
   // Do whatever this function is supposed to.
}

for every function that cared about the initialisation. Which is a pain.

I often pre-emptively use getInstance in case I need to go back and add any
sort of initialisation to a class later on. If it's clearly a utility only
class (for example, string utilities, math utilities - just a collection of
helper functions in a class) then I tend to use purely statics.

Cheers,
   Ian

On 2/20/06, JesterXL [EMAIL PROTECTED] wrote:

 He can, but every other progammer (well, ok, mainly Java developers) are
 familiar with the getInstance convention.  It clearly illustrates that the
 class is a Singleton.

 I only use it when my boss says to; otherwise, static all the way baby.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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. :-) )

Cheers,
  Ian

On 2/20/06, Hairy Dog Digital [EMAIL PROTECTED] wrote:

 This is the second time (and maybe there were others) that I saw this book
 recommended on Flashcoders. Holding aside game programming, how good of a
 job does this book with general geometry, trig, calculus, and physics?
 I've
 had several occasions where I am handling animations programmatically via
 ActionScript and have gone scrambling to old college texts (really old) or
 online sites to dig up stuff that I've long forgotten. Does this text
 handle
 those core parts, or does it assume a certain knowledge level, then jump
 right into 3D physics?

 ...Rob


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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
least give you the width that the embedded Flash movie currently considers
the clip to be. Then divide 1600 by that width value, and that'll give you
the number of times you need to scale up the _root clip to get an inner clip
that's 1600 pixels wide - as far as Flash is concerned.

Then you'll need to worry about the scaling Director is applying to your
movie - and it's been a couple of years since I've paid any attention to
Director at all, I'm afraid. But I'd think all you need to do is compare the
width of the embedded Flash object to its original published width, and
apply that factor on top of any other scaling factors you've already
applied...

Sorry I can't be of more immediate help.

Ian

On 2/15/06, Mendelsohn, Michael [EMAIL PROTECTED] wrote:

 It's actually a lot more complicated than that because the swf is
 sitting inside Director, and I'm aligning the swf to point(0,0) of the
 stage and I've stretched out the stage to the dimensions of the monitor.
 Then, I'm zooming in on a video by way of increasing Directors drawRect.
 I'm suspecting that the multiplier for stretching out the drawRect
 boundaries is different from the multiplier of the smaller rectangles
 within it.  I simply cannot figure out the formula to do this.   Ugh.

 - MM



 Unless I'm totally misreading... the maths should be:
 parentMC._width=parentMC._width*4; ?


 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 ClassThatImplementsICanvas();
 trace(obj.value); // Error: Line 342: There is no property with the name
 'value'.

 
 So, then I add this line to ICanvas.as

 var value:Number;

 Recompile:

 Error: ICanvas.as: Line 41: Variable declarations are not permitted in
 interfaces.

 ---

 What is the solution? Is there any type-safe way of doing this? Or do I
 have
 to do:

 var obj:ICanvas = new ClassThatImplementsICanvas();
 var obj2 = obj;
 trace(obj2.value); // Compiles and works, but lose type checking.


 thanks,
 David R
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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
 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 properties
  altered by various scripts. Is there a way I can extend the movieclip
  class so that the setter for these properties can be extended so I can
  act when the clip gets updated?
 
  Any advice appreciated.

 I've tried extending the enabled-property without luck. super.enabled
 = my_enabled doesn't really work. It would expect the same from _x and _y.

 I do hope someone can give other advice, but until then, I believe it is
 undoable. :(

 --
 Morten Barklund - Information Architect - TBWA\Play
 Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark
 Phone: +45 7027 2227 - Fax: +45 3369 1174
 ___
 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] 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 class.
 Unfortunately the _x and _y are unique beasts, along with all the other
 MovieClip properties from the Flash 4 days (such as enabled). You can't
 watch them, create getters/setters for them, or even over-ride them. You
 have to have a getter/setter x and y and inside those set the _x and _y.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] EventDispatcher.removeEventListener

2006-02-06 Thread Ian Thomas
Or perhaps a bit simpler and safer:

var myFunction:Function=Delegate.create(this,somefunction);

cancel_btn.addEventListener(click,myFunction);

and later:
cancel_btn.removeEventListener(click,myFunction);

You could always store myFunction as a property...

Ian

On 2/6/06, blists [EMAIL PROTECTED] wrote:

 You can also remove a listener from an object using the __q_click array of
 the object the listener is on.

 Add a listener like this:
 cancel_btn.addEventListener(click, Delegate.create(this,
 this.somefunction));

 And remove that listener like this:
 cancel_btn.removeEventListener(click, cancel_btn.__q_click[0]);

 If you had multiple listeners, you might be able to loop over the
 __q_click
 array and do a comparison but I'm not sure how.

 Brookd


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] International Address to Map position

2006-02-03 Thread Ian Thomas
Quick sideways thought - does it have to be Flash? You can embed the Google
Maps code on your own site, and the API allows you to layer your own data
over the world map, or even substitute your own map. All the
zooming/latitude/longitude/place marker on map location code is already
built in.

Cheers,
  Ian

On 2/3/06, clark slater [EMAIL PROTECTED] wrote:

 Hey Folks,

 I'm working on an application that has a requirement for generating a
 world
 map showing outlets for a particular product. There are *lots* of outlets
 and they are updated very frequently so the spec is that the map should be
 able to render a new outlet in the correct location on the world map based
 on address only.

 Anyone done this before and care to offer any suggestions? Right now I am
 thinking I will need to acquire a db of city/long/lat or else find a
 public
 webservice that accepts an international address and returns long/lat
 info.
 Then I'm thinking I'll just need a scale map in my swf that approximates
 to
 the long/lat grid so can place the new outlet in the right position.

 Any advice or tales of woe appreciated.

 Clark
 ___
 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] Seeking a bit of drawing API inspiration..

2006-02-03 Thread Ian Thomas
Thanks Fumio - I already had an 8-segment circle-drawing function, I was
looking for a 4-segment. It turned out to be pretty trivial - not accurate,
but close enough for what I needed. So my problem is solved.

Thanks anyway!

Cheers,
  Ian

On 2/3/06, Fumio Nonaka [EMAIL PROTECTED] wrote:

 function xDrawCircle(target_mc:MovieClip, nX:Number, nY:Number,
 nR:Number, nSegments:Number):Void {
 if (nSegments == undefined) {
 nSegments = 8;
 }
 var nAngle:Number = 2*Math.PI/nSegments;
 target_mc.moveTo(nX+nR, nY);
 for (var i = 1; i=nSegments; ++i) {
 var nTheta:Number = i*nAngle;
 var nAnchorX:Number = nR*Math.cos(nTheta);
 var nAnchorY:Number = nR*Math.sin(nTheta);
 var nControlX:Number =
 nAnchorX+nR*Math.tan(nAngle/2)*Math.cos(nTheta-Math.PI/2);
 var nControlY:Number =
 nAnchorY+nR*Math.tan(nAngle/2)*Math.sin(nTheta-Math.PI/2);
 target_mc.curveTo(nControlX+nX, nControlY+nY, nAnchorX+nX,
 nAnchorY+nY);
 }
 }
 // Test
 var _mc:MovieClip = this.createEmptyMovieClip(target_mc, 1);
 _mc.beginFill(0x00);
 _mc.lineStyle(2, 0xFF);
 xDrawCircle(_mc, Stage.width/2, Stage.height/2, 100, 8);
 _mc.endFill();
 _
 Ian Thomas wrote:
Thanks for that - I've come up with an approximation based on very
 similar
  code. Not ideal, but it's close enough for the purpose I needed it for.
 That
  combined with a quick hash table to make sure I'm not plotting circles
 near
  other circles has given me the performance I need.

 Good luck,

 Fumio Nonaka
 mailto:[EMAIL PROTECTED]
 http://www.FumioNonaka.com/
 My bookshttp://www.FumioNonaka.com/Books/index.html
 Flash communityhttp://F-site.org/

 ___
 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] Seeking a bit of drawing API inspiration..

2006-02-03 Thread Ian Thomas
Whoops, replied too fast without reading carefully - I hadn't spotted the
nSegments parameter. That might come in handy, thank you!

Ian

On 2/3/06, Ian Thomas [EMAIL PROTECTED] wrote:

 Thanks Fumio - I already had an 8-segment circle-drawing function, I was
 looking for a 4-segment. It turned out to be pretty trivial - not accurate,
 but close enough for what I needed. So my problem is solved.

 Thanks anyway!

 Cheers,
   Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Naming conventions for AS2.0 ...

2006-02-02 Thread Ian Thomas
In the days of old compilers and IDEs I used to use complicated naming
conventions - including the (horrible) Hungarian notation mentioned above
(But it did help at the time. I think. When wading through piles of someone
else's mangled C code.).

Now with more sensible IDEs that can do autocompletion (For AS2 I'm using
FlashDevelop at the moment, which is really nice) I don't really bother
doing more than Mark does - I use:
- An underscore for class private variables (_myVar)
- Sensible/readable names for other variables (isFinished, appFolder,
configWindow, lastClip)

It used to be a real issue. Now it's far less of one. As long as you're
readable and understandable and above all _consistent_ throughout your code,
it doesn't really matter.

HTH,
  Ian

On 2/2/06, Mark Walters [EMAIL PROTECTED] wrote:

 The extensions _mc, _txt, etc, were originally recommended by
 Macromedia to trigger the context sensitive autocompletion in Flash
 MX. With strict datatyping it's no longer required and is really just
 preference. Personally, I add a $ in front of my private variables and
 just make everything else named well enough to be understood by anyone
 reading my code.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
Hi Gregory,
  Thanks for that.

  I am basically plotting/drawing a circle at each point the mouse moves to
while clicked. (This isn't a paint package, it's for something else entirely
- which is why I'm not drawing lines...)

  I had already got as far as trying rectangles - they are indeed a lot
faster, just not as pretty. :-) They are my fallback position if I can't get
anything better to work.

  I can't quite see why the MovieClip option would work - but I'm willing to
have a go. I'll let you know how it works out.

Many thanks,
  Ian

On 2/2/06, GregoryN [EMAIL PROTECTED] wrote:

 Ian,

 If I understand you right, you're drawing a chain_of_circles instead
 of just drawing a line?
 This approach seems quite strange, but it's your choice anyway :-)

 I don't think the math to redraw all circles will heal the
 performance - rather opposite.
 Instead, I can suggest use one of the following:
 1) Try to use rectangles (or diamonds) in place of circles, as the are
 supposed to be drawn easily
 2) Draw the circle ONCE into a movieclip and then just duplicate this
 mc.

 Hope both can be helpful.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] mx.utils.ClassFinder.findClass problem

2006-02-02 Thread Ian Thomas
Hi Franto,

As far as I understand it, 'import' isn't enough to get a class compiled
into your .swf.

The line:
import sk.sowhat.linuxPlayer.play4dogs.Test;
just tells the compiler that any mention of the word Test in your code will
refer to that class.

If the class isn't compiled into the SWF, ClassFinder won't find it. You
actually need to access  or instantiate the class somewhere in the code to
make Flash include it. From memory I think just referring to the class
constructor is enough e.g.

import sk.sowhat.linuxPlayer.play4dogs.Test;

var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere
later in the code

I also have a vague memory that you might be able to force MTASC to include
classes, but not being a user of MTASC (yet!) I'm not certain on that one.

HTH,
  Ian

P.S.
You may just get away with
import sk.sowhat.linuxPlayer.play4dogs.Test;

sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash
includes the code

I seem to remember reading that somewhere... although syntactically it's
odd.

On 2/2/06, franto [EMAIL PROTECTED] wrote:

 Can someone explain me this?
 Im using mx.utils.ClassFinder.findClass to find class and make instance
 from it
 but some classes it cant find, it's not just problem of
 mx.utils.ClassFinder.findClass im using another way to create
 dynamic class (as I wrote yesterday to the list)
 but same classes are not found e.g

 sk.sowhat.linuxPlayer.play4dogs.Test

 but when I create instance in this way

 new sk.sowhat.linuxPlayer.play4dogs.Test()

 it is created!!! Can someone tell me why? I try all I know, add
 imports and such but nothing
 help me. Im stuck on this for 8 hours now :( and i have to find solution

 Please help :)

 Maybe you can try it on your own projects, if it will find your classes

 Thank you



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Naming conventions for AS2.0 ...

2006-02-02 Thread Ian Thomas
On 2/2/06, Adrian Lynch [EMAIL PROTECTED] wrote:

 Also, if you're working on a project with others, be consistent with each
 other. If it's a fresh project, have a chat about what to use. If you're
 coming on board you might be more inclined to follow what's already there.



Amen.

If you're working with others - _particularly_ if you're growing a business
- it's a good idea to agree with each other what you're doing, then throw a
quick naming conventions/house style document together so that you can point
any newcomers at it. Saves you remembering it all/explaining it
all/renegotiating it all each time you add a member of staff...

Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
I was being silly. A night's sleep has cleared things up.
All I needed to do was draw less circles. In other words, check whether I'd
already drawn a circle anywhere near the current drawing position, and if I
had, don't draw a new circle.
Gave me a blistering speed increase.

Thanks!
  Ian

On 2/2/06, Ian Thomas [EMAIL PROTECTED] wrote:

 Hi Gregory,
   Thanks for that.

   I am basically plotting/drawing a circle at each point the mouse moves
 to while clicked. (This isn't a paint package, it's for something else
 entirely - which is why I'm not drawing lines...)

   I had already got as far as trying rectangles - they are indeed a lot
 faster, just not as pretty. :-) They are my fallback position if I can't get
 anything better to work.

   I can't quite see why the MovieClip option would work - but I'm willing
 to have a go. I'll let you know how it works out.

 Many thanks,
   Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] mx.utils.ClassFinder.findClass problem

2006-02-02 Thread Ian Thomas
Whoops - I'm being dim. These will work just as well:

import sk.sowhat.linuxPlayer.play4dogs.Test;
var dummyVar:Function=Test;

or

var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import)

Ian

On 2/2/06, Ian Thomas [EMAIL PROTECTED] wrote:

 Hi Franto,

 As far as I understand it, 'import' isn't enough to get a class compiled
 into your .swf.

 The line:
 import sk.sowhat.linuxPlayer.play4dogs.Test;
 just tells the compiler that any mention of the word Test in your code
 will refer to that class.

 If the class isn't compiled into the SWF, ClassFinder won't find it. You
 actually need to access  or instantiate the class somewhere in the code to
 make Flash include it. From memory I think just referring to the class
 constructor is enough e.g.

 import sk.sowhat.linuxPlayer.play4dogs.Test;

 var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere
 later in the code

 I also have a vague memory that you might be able to force MTASC to
 include classes, but not being a user of MTASC (yet!) I'm not certain on
 that one.

 HTH,
   Ian

 P.S.
 You may just get away with
 import sk.sowhat.linuxPlayer.play4dogs.Test;

 sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so
 Flash includes the code

 I seem to remember reading that somewhere... although syntactically it's
 odd.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
I'm using an 8-arc method - I'd prefer to find 4-arc (i.e. the quadratic
bezier) but haven't been able to find/work out suitable code. Could you
point me in the right direction?

Many thanks,
  Ian

On 2/2/06, GregoryN [EMAIL PROTECTED] wrote:


 Also, what code do you use to draw circles?

 Even in the MM docs, there are 2 methods, using 2 types of bezier
 curves: quadratic and cubic.
 Quadratic bezier method (of drawing circle) works fast and uses just 4
 calls to curveTo(). But the result is squared.
 Cubic bezier method uses Math class (sin and tan), draws perfect
 circles, but mu-u-uch slower.

 Try to find the fastest method.

 And, of course, the less circles you draw, the better :-).


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
Hi Hans,
  Thanks for that - unfortunately it doesn't work in my case. I'd already
thought of it, but I'm actually drawing a mask layer - and line thickness
has no effect on a mask.

Cheers,
  Ian

On 2/2/06, j.c.wichman [EMAIL PROTECTED] wrote:

 Hi,
 This probably isnt of any use to you, but for the filled circles, you can
 only simply draw a linepiece with a length of say 0.0001 and a high
 linethickness (50px for example results in a circle with a diameter of
 50px). Like I said only of use if you draw filled circles.

 Greetz
 Hans

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
Hi Mike,
  Yes, not flash 8. :-) Otherwise that would have been my first stop. :-)

Although come to think of it I've no idea whether/how bitmap masks work -
does Flash take into account the alpha channels of a bitmap used as a mask?
Anyway - that's irrelevant to me at the moment and and experiment for
another day...

Thanks anyway,
  Ian

On 2/2/06, Mike Mountain [EMAIL PROTECTED] wrote:

 I missed the very first post - but is there a reaosn you're not using
 bitmap data to achieve this? (ie. Not flash 8?)

 M

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Ian Thomas
  Sent: 02 February 2006 13:16
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] Seeking a bit of drawing API inspiration..
 
  Hi Hans,
Thanks for that - unfortunately it doesn't work in my case.
  I'd already thought of it, but I'm actually drawing a mask
  layer - and line thickness has no effect on a mask.
 
  Cheers,
Ian
 
  On 2/2/06, j.c.wichman [EMAIL PROTECTED] wrote:
  
   Hi,
   This probably isnt of any use to you, but for the filled
  circles, you
   can only simply draw a linepiece with a length of say
  0.0001 and a
   high linethickness (50px for example results in a circle with a
   diameter of 50px). Like I said only of use if you draw
  filled circles.
  
   Greetz
   Hans
  
  ___
  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] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
Oh, now that is extremely pretty. :-)

I'm looking forward to getting my hands on version 8 - must get these
projects finished first tho'...

Thanks,
  Ian

On 2/2/06, Cédric Muller [EMAIL PROTECTED] wrote:

 please. have a look here:
 http://www.kaourantin.net/2005/08/alpha-masking-goodness-in-flash-
 player.html
 worth everything ;)
 take care
 cedric

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Unconditional and operator

2006-02-02 Thread Ian Thomas
Hi Hans...

Java's  operator isn't intended as an unconditional and - it just sort of
works, because '' means 'bitwise AND', so the operation ab has to combine
the individual bits of the values a and b - so must work out the values of
both. It doesn't return a boolean, it takes two integers and returns a
third.

The equivalent bitwise and operator () also exists in Flash. It behaves the
same way, but because Flash is lazier on the type-checking you could pass
two booleans and get back something which you could treat as a boolean. So
yes, (a()  b()) should do what you want. If you really want to. :-)

(a()  b()), as you'd expect, doesn't evaluate b() if a() is false.

There is a third operator in Flash - 'and' - which was deprecated round
about Flash 5, as far as I remember. It looks very much like it _doesn't_
short-circuit - (a() and b()) evaluates both! So this, too, does what you
want.

A quick test shows this:

function a(msg:String)
{
trace(A);
return false;
}

function b(msg:String)
{
trace(B);
return false;
}

function onStartModule()
{
trace(  result:+(a()  b()) );
trace( and result:+(a() and b()) );
trace(  result:+(a()  b()) );
}

A
 result: false
A
B
and result: false
A
B
 result: 0

So it looks like the old 'and' operator doesn't short circuit. It's
deprecated - so it's your choice whether to use it...

Cheers,
  Ian

On 2/2/06, j.c.wichman [EMAIL PROTECTED] wrote:

 Hi,
 does anyone know of an unconditional and operator in flash that I'm not
 aware of, eg in java a()  b(), forcing both a() and b() to be called?
 And yes I know this reeks of hacking ;).


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Unconditional and operator

2006-02-02 Thread Ian Thomas
Ignore the msg:String parameter - I did. Red herring.

Ian

On 2/2/06, Ian Thomas [EMAIL PROTECTED] wrote:


 function a(msg:String)
 {
 trace(A);
 return false;
 }

 function b(msg:String)
 {
 trace(B);
 return false;
 }


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Unconditional and operator

2006-02-02 Thread Ian Thomas
Hm! Well, you learn something new every day - thanks for that!

Cheers,
  Ian

On 2/2/06, j.c.wichman [EMAIL PROTECTED] wrote:


 Returns true if op1 and op2 are both boolean and both true; always
 evaluates op1 and op2; if both operands are numbers, performs bitwise AND
 operation

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Tell me more about _global--Back to the question

2006-02-02 Thread Ian Thomas
On 2/2/06, Manuel Saint-Victor [EMAIL PROTECTED] wrote:

 Okay- let's meander back to the part where I learn from my question
 So If i create a class with a bunch of static methods from what I've read
 ,
 I can use those methods without instantiating the class.  This would
 effectively create the ability for them to be called from any timeline
 like
 so  NotReallyGlobal.staticMethod();   Am I getting that part correct?


 M


Hi Manuel,
  Yes, that's correct.

Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Seeking a bit of drawing API inspiration..

2006-02-02 Thread Ian Thomas
Hi Gregory,
  Thanks for that - I've come up with an approximation based on very similar
code. Not ideal, but it's close enough for the purpose I needed it for. That
combined with a quick hash table to make sure I'm not plotting circles near
other circles has given me the performance I need.

Thanks for all your help!

Cheers,
  Ian

On 2/2/06, GregoryN [EMAIL PROTECTED] wrote:


 Well, here's a quote from MM docs (Flash 7 AS reference,
 MovieClip.curveTo()):

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Free Flex???

2006-02-01 Thread Ian Thomas
That's absolutely brilliant news.

Ian

On 2/1/06, David Rorex [EMAIL PROTECTED] wrote:

 yes, the command-line compiler  framework will be free.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
Um... not quite sure what you're up to here - but it sounds like you're
getting a bit confused between IWorldPart and WorldPart.

What you need is:
interface IWorldPart
class SomeWorldPartSubclass implements IWorldPart

then
var myPart:IWorldPart = new SomeWorldPartSubclass();

should be fine.

_OR_

interface WorldPart
class SomeWorldPartSubclass implements WorldPart

then
var myPart:WorldPart = new SomeWorldPartSubclass();

Not quite sure why your description mentions both IWorldPart and WorldPart -
unless WorldPart implements IWorldPart..? In which case you're looking for:

interface IWorldPart
class WorldPart implements IWorldPart
class SomeWorldPartSubclass extends WorldPart

then either
var myPart:WorldPart = new SomeWorldPartSubclass();
or
var myPart:IWorldPart = new SomeWorldPartSubclass();

should both work...

HTH,
  Ian


On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote:

 Hi,
 i'm using a collection, which requires items of type Object to be added.

 I've declared an interface which gives me something like:
 - interface IWorldPart
 - a class implementing WorldPart

 now somewhere else i do:
 var myPart:IWorldPart = new SomeWorldPartSubclass();
 myCollection.addItem (myPart);

 The last statement gives a type error, if i replace the first with var
 myPart:WorldPart = new ... all goes well.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
No, you can't instantiate an interface. But I don't think Hans was doing
that.

There's no problem with typing:
interface IWorldPart {}
class SomeWorldPartSubclass implements IWorldPart  {}
var myPart:IWorldPart = new SomeWorldPartSubclass();   /* Note
INTERFACE-typed var, not concrete */
myCollection.addItem(myPart);

Works fine for me on a quick test. A sanity check of
trace(myPart instanceof Object);  //traces true
shows that you should be able to use the myPart variable everywhere that an
Object is expected.

Ian

On 2/1/06, Julien Vignali [EMAIL PROTECTED] wrote:

 Well, you can't instanciate an interface, you need first a concrete
 class that implements the interface...

 Your code should be:

 interface IWorldPart {}
 class SomeWorldPartSubclass implements IWorldPart  {}
 var myPart:SomeWorldPartSubclass = new SomeWorldPartSubclass();
 myCollection.addItem(myPart);

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
Then as Steve says, sounds like a compiler bug.

Ian

On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote:

 Hi,
 No confusion here ;) except maybe for my fuzzy explanation ;).
 I did:
 interface IWorldPart
 class WorldPart implements IWorldPart
 class SomeWorldPartSubclass extends WorldPart

 then either
 var myPart:WorldPart = new SomeWorldPartSubclass(); or var
 myPart:IWorldPart
 = new SomeWorldPartSubclass();

 As you described, however collection.addItem (myPart) only works in the
 first case and not in the second.
 Probably becoz flash thinks IWorldPart is not an object. I changed it to :
 var myPart:Object = new SomeWorldPartSubclass();
 And it works fine (just as var myPart:WorldPart = new
 SomeWorldPartSubclass();) by the way.

 Thanks for your comments,
 H

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
But it should. :-)

Like I said, my quick test of
var myPart:SomeInterface=new SomeConcreteImplementingSomeInterface();
trace(myPart instanceof Object);

Traces 'true'. Which is what I'd expect.

I really don't understand why you're getting an error with myCollection.

I know you've solved your immediate problem - but this is niggling at me
now... ;-)

Ian

On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote:


 Hi,
 I know u can't instantiate an interface, which wasn't what I was trying to
 do ;), I was declaring a variable to be of type SomeInterface
 (instantiating
 it with SomeConcreteClass), which apparently is not regarded by flash then
 of being of type Object as well.
 Got it figured out now ;)

 Thanks
 H

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
MX2004

Cheers,
  Ian

On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote:

 Hi Ian,
 Which flash version are you using?
 I had other problems yesterday with extending CollectionImpl due to my
 flash
 version (mx 2004), which worked just fine in flash 8. Might be the same in
 this case.

 Are you using 7 or 8?

 Thanks!
 Hans

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
'Fraid not. One to chalk down to experience, I guess. Oh well. I'm making
the move to 8 shortly myself, once this latest crop of projects are out of
the way...

Ian

On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote:

 Life is so unfair :)

 I had to switch to flash 8 to make it go away... My mind finally at
 piece...
 And now you tell me that it wasn't mx2004 :), please tell me you are a mac
 user ;))

 Greetz
 Hans

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Seeking a bit of drawing API inspiration...

2006-02-01 Thread Ian Thomas
Hi folks,

I'm looking for a bit of inspiration to help me out with the drawing API.

I've got a feature that's sort of like a painting tool -
- User clicks the mouse
- on mouse move, a filled circle is drawn on the canvas (using
beginFill/curveTo/endFill)
- User releases the mouse

So essentially the user is drawing a trail of circles. (Just as a side note,
it's actually a mask that's being drawn rather than a clip - probably makes
no odds).

I'd much prefer it if the effect stays as overlapping circles rather than as
'paint strokes'.

The problem I have is simply a performance issue - when the user has drawn
lots of circles the app slows down significantly. It's nothing to do with
extra code on my part - it's just Flash (presumably) redrawing all those
curves all the time.

Flash appears to be redrawing each circle, rather than draw the 'union of
the curves' of all the circles. By which I mean - if you completely paint
over the whole paint area, Flash could get away with drawing a filled square
- but clearly it isn't, it's drawing every single curve on top of each
other. (It doesn't do the merging that it would if we were just drawing
overlapping circles in the IDE).

So an obvious optimisation would be to do some maths, merge each new circle
into an existing list of curves, and throw away the unnecessary curves -
then clear the canvas and redraw. I'm sure I could work that out eventually
(with the help of Google!), but I suspect the maths to do this may actually
be too slow to be of much use.

So - any ideas/similar experiences/solutions?

(This is MX04, rather than Flash 8, otherwise I'd be looking at drawing into
bitmaps to solve the problem.)

TIA,

Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash Tree Not Clickable

2006-01-31 Thread Ian Thomas
Place another movieclip over the top of it, 100% alpha, with onRelease set
to a dummy function?

On 1/31/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I have a tree and to Buttons to navigate to tree (up and down).

 Now I need to make the tree not clickable. A user may only navigate with
 the buttons.



 Disabling the change event is not an option, neither is disabling the
 tree.




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash Tree Not Clickable

2006-01-31 Thread Ian Thomas
Sorry, I meant 0% alpha, of course. :-)

Ian

On 1/31/06, Ian Thomas [EMAIL PROTECTED] wrote:

 Place another movieclip over the top of it, 100% alpha, with onRelease set
 to a dummy function?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash Tree Not Clickable

2006-01-31 Thread Ian Thomas
Why will they think there's something to be clicked?

Set .useHandCursor to false on the blocking clip?

Cheers,
  Ian

On 1/31/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I know, but then users will still think there's something to be
 clicked...

 Isn't there a way to access the movieclips for each rows in where the
 click's are processed...


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash Tree Not Clickable

2006-01-31 Thread Ian Thomas
Lieven,
  No problems. Masking things out with a clip might feel a bit like
cheating, but I'm all for 'do the simplest thing that works...'

Cheers,
  Ian

On 1/31/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Yep, Ian, I'v been programming Flash now for a year, and didn't know
 there was a useHandCursor to be set false... Thank you for enlightening
 me...


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Ian Thomas
I definitely get better performance out of Convo rather than Blur in both
Firefox and IE on Win XP.

Cheers,
  Ian

On 1/31/06, franto [EMAIL PROTECTED] wrote:

 in your performance test in Firefox, all seems same for me, little bit
 blur has slower

 but CPU usage on blur: 38-40 %
 on convo: 34 - 38%

 my previous tests was in Flash IDE


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Ian Thomas
Hrm. I get:

blur filter time : 11032
convolution 3x3: 10144
convolution 5x5: 37781
no filter : 7510

Win XP, 3GHz, 512MB RAM

I wonder if it's a graphics card/hardware acceleration thing. (I have a
rubbish graphics card.)

Ian

On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:



  so, please wrote the times, its really strange

 Blur: 5622
 Conv 3x3: 5625
 Conv 5x5: 14453
 None: 5640
 ___
 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] com.ge package throws compile error?

2006-01-31 Thread Ian Thomas
Greater than or Equal to for Strings.
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary374.html

Existed only in Flash 4.

Cheers,
  Ian

On 1/31/06, John Grden [EMAIL PROTECTED] wrote:

 **Error** D:\Blitz\GE\Medical\DEV_Source\classes\com\ge\himss\Logo.as:
 Line
 4: Expected a field name after '.' operator.
  class com.ge.himss.Logo extends MovieClip {

 if I take out .ge in the the path, it works fine.

 .ge turns blue in the Flash editor, so I'm assuming its reserved - but for
 what??  anyone know?  GrandExit? GreatEchosystem? GummyEggs?

 Looked in help searching for com.ge - nothing came back.  Looked in
 classes folders - nada.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Tell me more about _global

2006-01-31 Thread Ian Thomas
That is, of course, one way to do it. If you want to throw out all your
type-checking and the like. Personally I like to make the compiler do as
much of my error-checking as possible, rather than having to hunt through by
hand - so prefer to be 'lame'. Particularly because I'm providing a
framework for other coders to code in.

There are hosts of articles scattered around the web as to why compile-time
type-checking is a Good Thing. And saves you time in the long run with
anything bigger than a small standalone project with one person working on
it. So I won't bother repeating all the arguments here - just have a quick
search on Google if you're interested - which, from your tone, I doubt you
are.

Just because people choose to do things in a different way from you - for a
whole host of _very good_ reasons - doesn't make them lame.

Ian

On 1/31/06, Steven Sacks [EMAIL PROTECTED] wrote:

 Making a class for globals is lame.  I don't get why people do stuff like
 that.  It's completely unnecessary.  Here's how I make a namespace for
 globals in one line.

 On frame one of the root timeline:

 _global.APP = {};

 Wow. That was so hard.

 APP.someglobal
 APP.someotherglobal
 APP.etc


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Constructing XML

2006-01-29 Thread Ian Thomas
Hi Sam,
  Just run it through the PHP function stripslashes() before parsing it.

Cheers,
  Ian

On 1/29/06, Sam Wootton [EMAIL PROTECTED] wrote:

 Hi,

 Thanks in advance for any help.

 I am constructing an XML file in Actionscript, here is a little bit that
 cycles through an array, producing nodes.

 ActionScript Code:

 strXML += squares\n
 for( var i:Number = 0; i  allSquares.length; i++ )
 {
 strXML += square + allSquares[i].id +
 ' xPos=' + allSquares[i].xPos + '' +
 ' yPos=' + allSquares[i].yPos + '' +
 ' color=' + allSquares[i].color + '' +
 ' alpha=' + allSquares[i].alpha + '' +
 ' /\n';
 }
 strXML += /squares\n;



 This produces the following XML structure:

 ActionScript Code:

 squares
 square0 xPos=\652\ yPos=\351\ color=\3342336\ alpha=\100\ /
 square0 xPos=\652\ yPos=\351\ color=\3342336\ alpha=\100\ /
 /squares


 The problem is, it's escaping all of the quotation marks (as you can see
 above).

 I send the XML String to a PHP script using the LoadVars class, i then
 save
 it as an XML file, i then open it back up again and then parse it. Only
 the
 PHP XML parser is getting stuck at the attributes that have been tampered
 with i.e. escaped,  (not by me).

 If anyone could help, i would be very very grateful.

 Regards, Sam
 ___
 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] Gotcha: F8 Security Model

2006-01-27 Thread Ian Thomas
Clark,
  That's because www.fred.com need not point to the same server as fred.com.
At all. They can be routed to totally different machines.

Cheers,
  Ian

On 1/27/06, clark slater [EMAIL PROTECTED] wrote:

 There's obviously no question about the value of the security sandbox and
 the crossdomain policy control. The issue for me is that 'www.' should not
 be considered a subdomain. This is inexcusable and will catch out a lot of
 people, particularly given the dreadful documentation.

 Clark

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] checking combinations

2006-01-26 Thread Ian Thomas
Or even shorter:
  public function handleUpdate(a:Object,b:Object,c:Object,d:Object)
  {
 var handlerName:String = 'onUpdate';
 if (a.selected){handlerName+= 'A'};
 if (b.selected){handlerName+='B'};
 // etc.

 if (this[handlerName]==undefined)
 {
   trace(We haven't got a handler called:+handlerName);
   return;
 }
 this[handlerName]();
  }

  public function onUpdateA()
  {
// do stuff for A etc.
  }

  public function onUpdateAB()
  {
// do stuff for AB etc.
  }

Cheers,
  Ian

On 1/26/06, Andreas Weber [EMAIL PROTECTED] wrote:

 Nice!
 And I was determined not to post again, but at a certain stage my mental
 block irresistibly kicked in again:
 why ingeniously bit-wise encode the combinations just to later decode them
 for better readabilty?

 Why not drop this altogether as we won't do any encoding:
 static var STATE_A:Number = 1; //  1  0

 Define the handlers like
 handlers = {};// or type it/ make it a class
 handlers[STATE_A] = Delegate.create(this,handleAOnly);
 // etc.

 And finally:

  public function handleUpdate(a:Object,b:Object,c:Object,d:Object)
  {
 state = 'STATE_';
 if(a.selected){ state += 'A'};
 if(b.selected){ state += 'B'};
 // etc.

 handlers[state]();
  }

 What's the benefit of encoding/decoding numbers? Please enlighten me!

 Cheers!
 --
 Andreas Weber
 motiondraw.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Slice 9 Question

2006-01-26 Thread Ian Thomas
Create a container movieclip, stick the Slice9 object in as a background,
put the other object in as a sibling to it? So instead of:

Slice9
  + MyImportantClip

have

Container
   + Slice9
|
   + MyImportantClip

HTH,
   Ian

On 1/26/06, Michael Byström [EMAIL PROTECTED] wrote:

 Hello,

 Does anyone know if there is a way of NOT getting a child MovieClip
 resized when attached to a MovieClip that has scale9Grid on. There has
 to be away to this, who as the solution!

 Stay warm
 Micke

 ___
 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] Fullscreen flash

2006-01-26 Thread Ian Thomas
Hi Mike,
  It's a Known Feature with Firefox. It's not strictly speaking a bug - the
browser doesn't know how high the document is supposed to be, because
there's no sized content in the document.

Try sticking this in the head

style
body,html
{
margin:0px;
padding:0px;
height:100%;
}
/style

If that doesn't work straight off, you may need to change the document type
- try putting in a valid HTML or XHTML doctype to kick Firefox out of Quirks
mode. (You might not need it - I honestly can't remember).

The above code and a valid XHTML doctype certainly works for me.

HTH,
  Ian

On 1/26/06, Mike Boutin [EMAIL PROTECTED] wrote:

 Hi,

 I am making a fullscreen flash site and I have the width and height set
 to 100%.  In internet explorer it all views fine, but when I view the
 same page in Firefox and Safari, the flash document doesnt stretch to
 100%, it only shows like 1/3 of the page as flash and the rest as just
 plain html, has anyone had this problem before??


 Cheers!

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Strange text scaling issue

2006-01-25 Thread Ian Thomas
Hi Danny,
  Don't know of any relevant scaling property - but are you using embedded
fonts? If not, at a guess it could be rendering using device/system fonts
and messing up the scaling?

HTH,
  Ian

On 1/25/06, Danny Kodicek [EMAIL PROTECTED] wrote:

 I'm getting something odd: When I rescale my Flash movie (imported into
 Director) the text fields are scaling incorrectly: instead of stretching,
 they seem to be changing point sizes in a quantized way. The result is
 that
 text fields that were previously next to one another are overlapping or
 separating.

 This doesn't happen with other Flash movies, so I'm guessing I've
 accidentally set some kind of scaling property, but I can't find it.
 Anyone
 know?

 Thanks
 Danny

 ___
 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] getting the name of an object

2006-01-23 Thread Ian Thomas
Andreas,
  Just sight-reading the code rather than testing it - shouldn't there be a
=== or !== in there somewhere to make sure you're talking about _exactly_
the same object rather than one which just has the same value..?

Cheers,
   Ian

On 1/23/06, Andreas Weber [EMAIL PROTECTED] wrote:

 If you have a weakness for kludgy solutions, try the 'getObjNames'
 function
 below.
 Otherwise: don't 'forget' the names of the objects: store the name in the
 same object, as an additional property.


 // 'don't try this at home!'

 a = {someProp:'someValue'};
 b = {someProp:'someOtherValue'};
 c = a;

 arr = [a, b];


 // later, when we have 'forgotten' the names of the objects

 for(var i=0, len=arr.length; ilen; i++){
 trace(getObjNames(arr[i]) + '   - someProp: '+ arr[i].someProp);

 // Output:  c,a   - someProp: someValue
 //  b   - someProp: someOtherValue

 }


 // kludgy, poorly tested and a waste of processor cycles
 function getObjNames(o:Object, timeline:MovieClip){
 var names:Array;
 var o2 = arguments[1] ? arguments[1] : _level0;
 if(!names){names = []}
 for(var p in o2){
 if(typeof(o2[p]) == 'object'){
 if(o2[p] != o){
  getObjName(o, o2[p]);
 }else{
 names.push(p);
 }
 }
 }
 return names;
 }

 hth
 --
 Andreas Weber
 motiondraw.com



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Sascha
 Balkau
 Sent: Monday, January 23, 2006 2:03 PM
 To: flashcoders
 Subject: [Flashcoders] getting the name of an object


 hi,

 this might be obvious but how do I get the name of an object? If I got an
 object named fooObj how can I get Flash to for example trace out the name
 of
 the object, so that it traces fooObj? I know this works with movieclips
 but how about objects or arrays?

 Sascha

 ___
 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] Font Preview In ComboBox

2006-01-23 Thread Ian Thomas
Rishi,
  There is such a thing as 'unreasonable requirements', you know. :-D

Could you break down the font list, and present it to the user in sections?
For example, Handwriting Fonts, Electronic Fonts or something - or even
A-D, E-F etc.

Then at least you could load the previews in smaller chunks as required.

Does it truly have to be live preview (i.e. does it have to match text that
the user has entered) or could you convert the text to curves and load each
preview as a graphic instead? It'll make the loading of the preview a lot
faster if it's a graphic rather than a full font. But there'd be a lot of
(possibly manual) work to do up front creating the font previews.

Sounds like you've set yourselves a very difficult challenge... (or rather,
sounds like your bosses have. :-) )

The other thought that occurs - could you start off with all the fonts in
the ComboBox in a 'neutral' font (perhaps greyed out) and update the actual
preview with the correct font as it loads?

HTH,
  Ian

On 1/23/06, rishi [EMAIL PROTECTED] wrote:

 Yes for sure the preview have to occur in Combo


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Nick
 Weekes
 Sent: Monday, January 23, 2006 8:54 PM
 To: 'Flashcoders mailing list'
 Subject: RE: [Flashcoders] Font Preview In ComboBox

 Typo, should read '...does the preview have to occur in the combo?'

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getting the name of an object

2006-01-23 Thread Ian Thomas
Hm. Good point, and something I should go away and test. :-) I had it in my
head somewhere that Flash did a low-level crude equality check on objects
with == - are they both the same type and do the properties match? But I may
well have misremembered that as a feature of a different language - I do
seem to be switching between different languages for different tasks a lot
these days. :-)

Cheers,
  Ian

On 1/23/06, Andreas Weber [EMAIL PROTECTED]  wrote:

  shouldn't there be a === or !== in there somewhere to make
  sure you're talking about _exactly_ the same object rather
  than one which just has the same value..?
 Good question...
 In my understanding - i.e. please correct me if I'm wrong! - when
 testing objects for equality the simple and the strict equality operator
 are completely interchangeable.

 We are not comparing values, which can be of different types (and thus
 provoke 'false positives' with the simple equality operator), but
 references, which have a simple, 'binary' quality: either they do point
 at the same place in memory or they don't.
 And two objects - by definition? - always occupy two distinct locations
 in memory, completely independent of wether they are of the same type
 and contain the same values.

trace({} == {});// output: false

 That's why I think that when testing objects for equality, the simple
 and the strict oprator will always return the same result.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getting the name of an object

2006-01-23 Thread Ian Thomas
For the reasons given by Danny et al, you could never have a myObj.getString()
such as you describe... other than possibly for debugging purposes, I'm at a
loss to work out why it'd be useful?

Ian

On 1/23/06, Julius - XK [EMAIL PROTECTED] wrote:


 Is this what your looking for?  It has it's limitations, would be nice if
 there was a myObj.toString() == myObj..  Or something
 along those lines :)

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Documenting my code

2006-01-22 Thread Ian Thomas
Looks good!

Any chance of a command-line driven version so that I can achieve my goal of
having server-side generated documentation on my SVN box..?

Cheers,
  Ian

On 1/22/06, Sam Wootton [EMAIL PROTECTED] wrote:

 Yes, its written in Java.

 Regards, Sam

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Documenting my code

2006-01-22 Thread Ian Thomas
Sorry, didn't understand that one...

I have already tested as2api - and unfortunately it comes up with a bunch of
errors on the Linux box and produces no output.

Ian

On 1/22/06, erixtekila [EMAIL PROTECTED] wrote:

  Any chance of a command-line driven version so that I can achieve my
  goal of
  having server-side generated documentation on my SVN box..?
 
 You'd test as2api

 my 2 cents

 ---
 erixtekila
 http://blog.v-i-a.net/

 ___
 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] Documenting my code

2006-01-20 Thread Ian Thomas
Looks good - but sadly doesn't support inheritance:

http://www.senocular.com/projects/ZenDoc/doc/#manual_limitations

Which is a real shame.

The hunt for the perfect documentation tool goes on. :-)

(At this rate I might be forced to write one. ;-) )

Ian

On 1/20/06, Duncan Reid [EMAIL PROTECTED] wrote:

 Not sure if this has been mentioned but there is also ZenDoc written in
 php
 that has multiple output modes based on templates, i've played a little
 with
 the demo and it looks promising, plus it's free and open as far as i can
 tell...

 http://www.senocular.com/projects/?project=ZenDocpage=demo

 Dunc
 ___
 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] Documenting my code

2006-01-19 Thread Ian Thomas
As far as I can see from the front page (Roadmap panel) it doesn't yet
support JavaDoc as a style, which is a shame...

On 1/18/06, ryanm [EMAIL PROTECTED] wrote:

  Or, can anyone suggest an alternative software that takes the java-doc
  style comments and create documentation?
 
 Check out NaturalDocs. It's free (open course), and it reads almost
 any
 style of comments.

 ryanm

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Documenting my code

2006-01-19 Thread Ian Thomas
The keywords @param, @see, @return all have special meaning to JavaDoc based
tools (as well as a host of other @commands). In my limited tests of
NaturalDocs it looks like it doesn't support those special meanings- which
is why the front page of the NaturalDocs site says that JavaDoc is still to
be supported (the Roadmap section).

By not supported I mean that it looks like NaturalDocs - if it does anything
with them at all - just copies them verbatim, without using them for
crossreferencing or anything.

I hope that NaturalDocs does get around to supporting JavaDoc, because in my
test of doc tools over the last week or so it looks like the best fit for me
- it actually runs on my Linux server, whereas most other things are either
Mac or PC based or, like as2api, just cause me server errors. I'm trying to
integrate a doc-tool in to our SVN setup (so that nightly up-to-date docs
are built) and am having no luck at all. At the moment I'm having to run
something scheduled on my Windows box to achieve it.

We're not going to switch to NaturalDocs 'natural' commenting style over the
JavaDoc style for the simple reason that more tools, longterm, will support
the JavaDoc tags and I want to retain the flexibility to switch doc tools.
And we've already got a load of code commented in this style. :-)

I used to use Doxygen for this in Java - but to be honest Doxygen's output
for AS2 seems pretty poor - unless I'm missing a config trick somewhere...

Ian

On 1/19/06, ryanm [EMAIL PROTECTED] wrote:

  As far as I can see from the front page (Roadmap panel) it doesn't yet
  support JavaDoc as a style, which is a shame...
 
 What doesn't it support?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Documenting my code

2006-01-19 Thread Ian Thomas
Hi Martin,
  Rather like you - all I have is a script which runs once nightly as a cron
job, does an update from SVN, then calls the doc tool and copies the
generated docs into a folder hosted by the webserver. Nothing complicated.

  I'd be interested in seeing a decent AS2 config for Doxygen too. The
output I got from it indicated that Doxygen didn't understand AS2, and was
trying to parse the .as files as if they were Java (i.e. class names were
com.something.MyClass rather than just MyClass - that sort of behaviour).

Cheers,
  Ian

On 1/19/06, Martin Wood [EMAIL PROTECTED] wrote:


 out of curiosity how are going about this on the linux box?

 I implemented a system a while ago to do nightly documentation builds on
 a linux box, but my system was based around CVS / Doxygen.

 Basically, I wrote a python script that was called as a cron job which
 checked out all the projects from CVS, ran doxygen on them and copied
 the output to a local web server..

 Unfortunately i dont have access to the code anymore because it was
 built for my previous employer but im keen on getting something working
 for myself that uses SVN and produces docs for AS2 code (as well as
 Java, even if that means using seperate tools..)

 the nice thing about using doxygen (after a bit of configuration work)
 was that the documentation for seperate projects was linked together.
 e.g. If project B depended on project A (a library) then you could
 follow links from B to the relevant places in A. (and you got diagrams
 for free..)

 I'd be interested to see if anyone has some configs for doxygen that
 work well with AS2, or if you think that a specific AS2 module for
 doxygen is needed..

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: Search engine indexable Flash content; anyone with insight please help!

2006-01-19 Thread Ian Thomas
Um. Why?

And have you any concrete examples of that sort of ban?

Just seems like an extremely odd decision by Google.

Cheers,
  Ian

On 1/19/06, Johannes Nel [EMAIL PROTECTED] wrote:

 a word of caution. google can ban you for using ripple.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Documenting my code

2006-01-18 Thread Ian Thomas
We've jsut started using AS2API -
http://www.badgers-in-foil.co.uk/projects/as2api/ - which works fine for us
on Windows (but had issues on Linux, sadly, although I think that's because
our Linux box needs a good cleanup).

Cheers,
  Ian

On 1/18/06, eric dolecki [EMAIL PROTECTED] wrote:

 BLDoc for PC
 VisDoc for OS X (rocks)

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Documenting my code

2006-01-18 Thread Ian Thomas
Hi Alan,
  That one's pretty simple - we didn't even try. I too get the huge barf of
'no definition' output for the MX classes. But I didn't need to document the
MX classes, so didn't bother looking into how to do so - the output from
as2api _without_ those classes is absolutely fine for what we want.

Sorry I couldn't be of more help!
  Ian

On 1/18/06, Alan MacDougall [EMAIL PROTECTED] wrote:

 Ian Thomas wrote:

 We've jsut started using AS2API -
 http://www.badgers-in-foil.co.uk/projects/as2api/ - which works fine for
 us
 on Windows (but had issues on Linux, sadly, although I think that's
 because
 our Linux box needs a good cleanup).
 
 
 Perhaps you could share how you got it working? I just tried it with a
 command line like this:

 as2api --classpath path/to/swfRoot;path/to/commonLib
 com.alanmacdougall.project.*

 (I have all my classes arranged properly at swfRoot/com/etc/etc, with
 utility classes like XFactorStudio's XPath at a common library location.)

 First it barfed when it found variable definitions in the style private
 var x:Number, y:Number; -- so I fixed those. But then it started giving
 me huge streams of errors saying Found no definition of type known
 locally as 'MovieClip'.

 Again, I think, no problem -- I add flash_home/en/First Run/Classes/FP8
 and flash_home/en/First Run/Classes/MX to the classpath... but without
 success.

 Could you post your experiences with as2api, and the command line
 parameters you're using? I'd appreciate it.

 Alan

 ___
 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] Fullscreen Flash issue

2006-01-16 Thread Ian Thomas
Mike,
  Where is this code? Just on the root timeline? Are you sure the
repositioning you're getting isn't a result of the normal Flash
resizing/scaling and that this code _is_ being called twice?

Cheers,
  Ian

On 1/16/06, Mike Boutin [EMAIL PROTECTED] wrote:

 I am working on a fullscreen flash project.  Can anyone tell me why this
 code acts like a loop rather than just happening once?  I am trying to
 position an object at the bottom of the browser window no matter what
 the window size.  I am using this code to set it right off the start.
 This all works and positions it at the bottom except when I resize the
 window the object moves around to repositions itself again, when I only
 want it to happen once. It is no in a onEnterFrame or setInterval and it
 is not in a onResize listener either.  Can anyone tell me why this
 happens and how to get around it?

 siteLogo._x = Stage.width / 2;
 siteLogo._y = Stage.height - 70;

 Cheers!





 ___
 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] [ANN] FlashDevelop beta8 release

2006-01-13 Thread Ian Thomas
I've been using FlashDevelop for about a week now; it's excellent stuff.
Nice and lightweight and just seems to work.

Cheers,
  Ian

On 1/12/06, Philippe [EMAIL PROTECTED] wrote:

 The only thing I miss comparing to PrimalScript (that I've been using
 before
 I've got known FlashDevelop ) is creating project from existing
 directory.

 It is actually possible to do that:
 just create an empty project in an existing directory.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] SEO, flash site, url and text in this movie tags

2006-01-11 Thread Ian Thomas
This seems a pretty relevant link:

http://www.webpronews.com/ebusiness/seo/wpn-4-20040907GoogleCanNowIndexFlashAnInterviewwithMichaelMarshall.html

HTH,
  Ian

On 1/11/06, Alan MacDougall [EMAIL PROTECTED] wrote:


 No way. Google is way too smart these days. White text on a white
 background, meta tag text, text in comments, text anywhere a user
 can't read it -- Google ignores it all. Maybe it would work on other
 search spiders, but if you're not convincing Google, what's the point?

 The only way to get a good rank in Google is to have a lot of clearly
 visible, highly relevant, informative text, ideally with links to and
 links from reputable and well-traveled sites. Anything else is just a
 scam, and even if it works one month, it'll fail the next time Google
 rearranges their algorithms.

 Didn't I hear once that there was some way of letting Google search
 inside Flash files, though? Maybe someone else knows a better way of
 getting your Flash-based site ranked.
 ___
 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] Classes being cached - deleting ASO does help (flash 8)

2006-01-07 Thread Ian Thomas
Is the movie you're having trouble with loaded into another containing
movie? And has that other containing movie got references to a version of
the class you're changing? In which case you need to recompile that
containing movie, too. Flash always uses the first version of the class that
it loads.

HTH,
   Ian

On 1/7/06, blists [EMAIL PROTECTED] wrote:

 I have a strange problem.

 When I compile my project in the flash 8 IDE, one of my classes that I am
 editing does not get re-compiled. Testing in a browser does not show the
 changes. If I make a coding error in the class being compiled, the IDE
 complains and I have to change it before it will recompile. That makes me
 think its being compiled! But changes are not reflected. I've closed the
 browser, cleared the cache etc - and none of that works. If I close and
 re-open the IDE, the first time I compile it will work with the new
 changes.

 WTF is going on here? Any body encountered this before?

 Brookd


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Files in directory?

2006-01-06 Thread Ian Thomas
Alternatively, if you're looking in a directory on a server, code up
something in a server-side language - PHP or whatever - to do the file
count, and have flash request the result.

HTH,
  Ian

On 1/6/06, Merrill, Jason [EMAIL PROTECTED] wrote:

 http://www.multidmedia.com/software/zinc/


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Combo troubles

2005-12-22 Thread Ian Thomas
You might also need to set the combobox._lockroot=true to cure other
standard combobox woes...

Ian

On 12/22/05, Steven Sacks [EMAIL PROTECTED] wrote:

 Put a combobox component in the loading movie (the root movie).


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


<    2   3   4   5   6   7   8   >