Re: [Flashcoders] Artificial Life flash resources

2005-12-30 Thread Spencer Markowski
You'll have to excues this as it was my first project ever built in Flash...
years ago.

It's not really 'artificial life' in the true sense of automata, but it
started a long line of expirements.

http://www.ablefew.com/dev/systemSprites/systemSprites.html

and of course there's always my source of inspiration

http://www.levitated.net

One idea I looked heavily into was using nueral networks to realistically
represent decision making and memory. Unforturnantly, I was unable to get
Flash to calculate even the smallest enumeration.

I'm still very interested in building a more advanced artificial life
example and I've slated some time in the future for development. Perhaps a
communnity project is in order? Let me know if any of you would be
interested in starting a common source of info regarding Flash and
artificial life.

On 12/30/05, Alan Shaw [EMAIL PROTECTED] wrote:

 Patrick Mineault posted a cool example just recently:

 http://www.5etdemi.com/blog/archives/2005/12/flash-8-experiment-the-game-of-life-and-cellular-automata-using-convolutionfilter/
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
Spencer Markowski
The Able Few
[EMAIL PROTECTED]
314.631.5576
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Artificial Life flash resources

2005-12-30 Thread Weyert de Boer

Looks nice.

You'll have to excues this as it was my first project ever built in Flash...
years ago.
  


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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread Weyert de Boer
What's wrong with the Items-property and then do a Session.Items[ 
sessionKeyName ]; ?

This is also available for the ASP.NET guys.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] FW: Domino Game

2005-12-30 Thread Trevor Burton
Hi List
 
I'm trying to create a dominos game and I'm having trouble - anyone seen
anything similar in flash or any pointers for how to approach this (no,
I'm not being paid for this - it's a personal project so you're not
doing any work for me!) or just advice or hints on how to get started -
 
 I'm specifically after how to approach 'dealing' the dominos (taking
the 28 original dominos and randomly assigning them to either of two
players) and how to approach the 'logic' of game moves (how to decide
whether someone can move a particular domino onto the board or not. 
 
Thanks in advance for any pearls of wisdom, no matter how small, oh, and
happy new year to everyone.
 
Trevor
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] FW: Domino Game

2005-12-30 Thread Danny Kodicek

I'm specifically after how to approach 'dealing' the dominos (taking
the 28 original dominos and randomly assigning them to either of two
players)


That's easy enough. Take a list of dominos (probably a list of two-element 
arrays like [0,0]) and randomise it. Here's a simple randomise function (NB: 
it destroys the original list):


function randomise(tArray:Array) {
var tRet:Array = new Array()
while (tArray.length0) {
var r:Number=Math.floor(Math.random()*tArray.length)
tRet.push(tArray[r])
tArray.splice(0,1)
}
return tRet
}

(Warning: email code may be flawed...)

and how to approach the 'logic' of game moves (how to decide

whether someone can move a particular domino onto the board or not.


I would keep hold of a variable for each of the two ends of the chain 
(assuming you're not allowing side-branching). When they want to add a 
domino, just check if either of its elements matches either of these 
numbers; if so, it can be added.


You'll find the most tricky bit of logic will be fitting the dominoes into 
the space. To keep it simple, I'd arrange them in a loop around the outside 
of the game area. Make sure the 28 dominoes will fit in the space, then just 
build in either direction from the starting point. Guaranteed success :)


HTH
Danny 


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


Re: [Flashcoders] center of rotation for new clip

2005-12-30 Thread Stéphane Bebrone
Hi Gregory,

You can check the work of Darron there:
http://www.darronschall.com/weblog/archives/54.cfm

Hope that will help you!
Greets,
Shaoken.

2005/12/30, GregoryN [EMAIL PROTECTED]:

 Hello Flashcoders,

   Is there a way to change a center of rotation for a clip, created
   with createEmptyMovieClip() ?
   What about the same for createTextField()?

   Situation:
   I'm creating several textfields at runtime and need to rotate them.
   (Yes, fonts embedded :-)
   But I'd like them to rotate around the center of the base instead of
   top-left corner.
   In IDE, we can just move center of rotation with mouse. Can we do it
   with code?

   Thanks in advance.


 --
 Best regards,
 GregoryN
 
 http://GOusable.com
 Flash components development.
 Usability services.


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




--
Regards,
Stéphane Bebrone
--
http://weblog.shaoken.be
--
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] FW: Domino Game

2005-12-30 Thread Trevor Burton
Thanks Danny, I'll have to do some work and see how I get on.

Cheers again.

t

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Danny
Kodicek
Sent: 30 December 2005 11:40
To: Flashcoders mailing list
Subject: Re: [Flashcoders] FW: Domino Game

 I'm specifically after how to approach 'dealing' the dominos (taking
 the 28 original dominos and randomly assigning them to either of two
 players)

That's easy enough. Take a list of dominos (probably a list of
two-element 
arrays like [0,0]) and randomise it. Here's a simple randomise function
(NB: 
it destroys the original list):

function randomise(tArray:Array) {
var tRet:Array = new Array()
while (tArray.length0) {
var r:Number=Math.floor(Math.random()*tArray.length)
tRet.push(tArray[r])
tArray.splice(0,1)
}
return tRet
}

(Warning: email code may be flawed...)

and how to approach the 'logic' of game moves (how to decide
 whether someone can move a particular domino onto the board or not.

I would keep hold of a variable for each of the two ends of the chain 
(assuming you're not allowing side-branching). When they want to add a 
domino, just check if either of its elements matches either of these 
numbers; if so, it can be added.

You'll find the most tricky bit of logic will be fitting the dominoes
into 
the space. To keep it simple, I'd arrange them in a loop around the
outside 
of the game area. Make sure the 28 dominoes will fit in the space, then
just 
build in either direction from the starting point. Guaranteed success :)

HTH
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] Singleton as associative array - yucky icky?

2005-12-30 Thread g.wygonik
nothing wrong with it - and would be the nice way to do it. and
probably will be how it ends up...

but all of the vb developers i know use the shortcuts where ever
possible... Session(key) instead of Session.Items(key),
Recordset(field) instead of Recordset.Fields(field), etc.

i'm just trying to cater to their habits of using the shortcuts
instead of forcing properness on them. :-)

g.

On 12/30/05, Weyert de Boer [EMAIL PROTECTED] wrote:
 What's wrong with the Items-property and then do a Session.Items[
 sessionKeyName ]; ?
 This is also available for the ASP.NET guys.

--
weblog: broadcast.artificialcolors.com
blazePDF: www.blazepdf.com
band: www.cutratebox.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Remote Debugging + Flash Remoting = Frozen Browser. FP8 Bug?

2005-12-30 Thread elibol
I've got a question, is there a way to set Service Capture to detect the
requests made by the client? Is there a way to detect remote client service
activity?

H

On 12/30/05, elibol [EMAIL PROTECTED] wrote:

 Thanks for your reply Judah, I accually use service capture myself!

 Well, I will see to it that this debugger bug (the irony) is
 acknowledged...

 H

 On 12/29/05, Judah Frangipane [EMAIL PROTECTED] wrote:
 
  I'm not using cf but in my remoting endevors Service Capture has helped
  many times (http://www.kevinlangdon.com/phpBB2/). It is well worth it
  compared to the time spent tracking down bugs.
 
  Judah
  PS No, I do not work for them :)
 
  elibol wrote:
 
  Hi everyone,
  
  I use the remote debugger all the time, and now with the release of
  flash 8,
  debugging an application that makes a flash remoting call (CF serving
  CFC)
  will either freeze or crash the subject browser. In the case that it
  freezes, my application will sometimes recover if I stop the debugger.
  
  What happens is my CPU usage maxes out when a remote function call is
  made
  in the application (while I'm running the remote debugger for that
  application), and the there may be an inifinite loop that's slowing
  your
  machine down dialogue appears since the player mistakes the situation
  as an
  infinite loop.
  
  I'm using CF with a CFC Oracle database facade; is anyone else
  experiencing
  the same problems as I am under either the same or different server
  technologies? Has this bug been acknowledged?
  
  Thanks so much for reading about my problem,
  
  H
  ___
  Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  
  
  
  
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 


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


[Flashcoders] Flex 2: Component inheritance?

2005-12-30 Thread Jason Y. Kwong
I'm relatively new to Flex 2 and what I'm trying to do is to create a set of
custom MXML components that share the same AS base class.  So I start with
the base component, an empty container to which I add properties/methods via
AS.  Call it Base.mxml:

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=*
mx:Script source=Base_inc.as/   !-- Declare base properties/methods --
/mx:Canvas

Then I create a component based on Base.  I add a Button and a TextInput.
Call it ComponentA.mxml:

?xml version=1.0 encoding=utf-8?
Base xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=*
mx:Script source=ComponentA_inc.as/   !-- Component-specific code
--
mx:Button x=5 y=41 label=Button/
mx:TextInput x=2 y=12 text=hello id=MyText/
/Base

Then I add ComponentA to an application.  Everything looks fine in the
design view.  However, when the app is run, the controls added by ComponentA
do not show up.  I put in a creationComplete handler for ComponentA and
traced the value of MyText and it came out null, so it looks like it never
got created.

Am I missing something?  If this isn't how you do component inheritance,
then how can it be done while still taking advantage of the easy layout
offered by MXML?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Undefine a Component

2005-12-30 Thread GregoryN

 If your component is based on AS2 class - just associate another mc
 with it.

 If not (as I suspect :) , I'd suggest to make a little/single SWF with only
 this component and then decompile it with Flare or another tool.
 You'll get an abstract code, but will be able to restore everything.

 Hope this can help you.
  

-- 
Best regards,
 GregoryN

http://GOusable.com
Flash components development.
Usability services.

 -  Charles Parcell wrote:
 I was working on creating a little component based on a MC I have in my
 current project. After playing a little I decided that I would wait till the
 project was done before packaging the component for my team to use.
 Somewhere in the process something got mucked up.  When I run my project the
 MC does not behave as it should. As a matter of fact it seems to be holding
 onto variables and values from when I was setting it up as a component (via
 the Component Definition wizard).
 
 My question is, how to you properly reinstate the MC once you have started
 adding component defining properties??
 
 Charles P.


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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread Nathan Derksen
I would say to hell with the VB coders (and I used to be one). What  
if you want to change your implementation later on? What if this  
functionality changes with AS3? Without an API, you open yourself up  
to all sorts of fun stuff that may force the user to have to change  
their code later on. Be nice to yourself and to your users. You'll be  
happier in the end, and your guilt will be assuaged (rightly so)! And  
when was the last time that VB/VBScript catered to anyone in the  
Java, JavaScript, or ActionScript world? They use completely  
different syntax, so don't fret about it.


Nathan
http://www.nathanderksen.com


On Dec 29, 2005, at 10:05 PM, g.wygonik wrote:


whew! thought i might have missed clever and cool in there! :-) though
your comment did bring up some ideas i'll try in the AM.

it's all whack in my book right now. like i told Jesse - it works,  
i'll keep it.


time for bed!

g.

On 12/29/05, Claus Wahlers [EMAIL PROTECTED] wrote:

__resolve?


nope...

not unless there's some super-secret way of using __resolve  
outside of

the normal way.

even with a __resolve function in-place in my class, you still  
get the

dreaded Left side of assignment operator must be variable or
property. when calling:

session(foo) = bar;


ah yes of course:
non-singleton-version:

var session:Session = new Session();
session(foo) = bar;

this makes no sense.

maybe:
session.foo = bar;
in combination with __resolve?

or maybe even let getInstance return a method of the singleton rather
than the instance itself? hmm no then the :Session type would be
invalid.. i guess the only way to do that is using the standard
dot-notation and __resolve.

sorry can't test as2 stuff right now, but maybe it helps somehow ;)
cheers,
claus.


--
weblog: broadcast.artificialcolors.com
blazePDF: www.blazepdf.com
band: www.cutratebox.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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


Re: [Flashcoders] Undefine a Component

2005-12-30 Thread Charles Parcell
Thanks for the response but that is not really what I am looking for.

Indeed I am use a class.

I am able to revert the component back to a MC by removing all the data in
the Component Definition wizard. But the problem is that it seems to hold
onto that data (some how) even though the wizard is blank.

I was able to drill into my MC and copy all the frames and paste them into a
new MC and relink to my class file. Then I deleted the old MC.  This worked
(of course) but there should be a way to remove all the component definition
data without having to rebuild the MC.

Charles P.



On 12/30/05, GregoryN [EMAIL PROTECTED] wrote:


 If your component is based on AS2 class - just associate another mc
 with it.

 If not (as I suspect :) , I'd suggest to make a little/single SWF with
 only
 this component and then decompile it with Flare or another tool.
 You'll get an abstract code, but will be able to restore everything.

 Hope this can help you.


 --
 Best regards,
 GregoryN
 
 http://GOusable.com
 Flash components development.
 Usability services.

  -  Charles Parcell wrote:
  I was working on creating a little component based on a MC I have in my
  current project. After playing a little I decided that I would wait till
 the
  project was done before packaging the component for my team to use.
  Somewhere in the process something got mucked up.  When I run my project
 the
  MC does not behave as it should. As a matter of fact it seems to be
 holding
  onto variables and values from when I was setting it up as a component
 (via
  the Component Definition wizard).
 
  My question is, how to you properly reinstate the MC once you have
 started
  adding component defining properties??
 
  Charles P.


 ___
 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] Remote Debugging + Flash Remoting = Frozen Browser. FP8 Bug?

2005-12-30 Thread Judah Frangipane
I don't think it captures that but it might be a feature that can be 
added. I would ask on the Service Capture feature forum.


http://kevinlangdon.com/phpBB2/


elibol wrote:


I've got a question, is there a way to set Service Capture to detect the
requests made by the client? Is there a way to detect remote client service
activity?

H

On 12/30/05, elibol [EMAIL PROTECTED] wrote:
 


Thanks for your reply Judah, I accually use service capture myself!

Well, I will see to it that this debugger bug (the irony) is
acknowledged...

H

On 12/29/05, Judah Frangipane [EMAIL PROTECTED] wrote:
   


I'm not using cf but in my remoting endevors Service Capture has helped
many times (http://www.kevinlangdon.com/phpBB2/). It is well worth it
compared to the time spent tracking down bugs.

Judah
PS No, I do not work for them :)

elibol wrote:

 


Hi everyone,

I use the remote debugger all the time, and now with the release of
   


flash 8,
 


debugging an application that makes a flash remoting call (CF serving
   


CFC)
 


will either freeze or crash the subject browser. In the case that it
freezes, my application will sometimes recover if I stop the debugger.

What happens is my CPU usage maxes out when a remote function call is
   


made
 


in the application (while I'm running the remote debugger for that
application), and the there may be an inifinite loop that's slowing
   


your
 


machine down dialogue appears since the player mistakes the situation
   


as an
 


infinite loop.

I'm using CF with a CFC Oracle database facade; is anyone else
   


experiencing
 


the same problems as I am under either the same or different server
technologies? Has this bug been acknowledged?

Thanks so much for reading about my problem,

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





   


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

 

   


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



 



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


Re: [Flashcoders] Re: calling a static method on dynamically namedclass?

2005-12-30 Thread Rich Rodecker
yeah, that works, but you are calling the static create() method through the
name of the class itself.  Say I have a number of classes (MyClass1,
MyOtherClass, AnotherClass) and I be able to alter which class to call the
create method on.  I'm thinking there's got to be a way to do something
like:

//set the name of the class to call the create() method on
var classToCall = MyClass;
_global[classToCall].create();

//change the name of the class to call create() on
classToCall = MyOtherClass;
_global[classToCall].create();

again
classToCall = AnotherClass;
_global[classToCall].create();




On 12/29/05, JesterXL [EMAIL PROTECTED] wrote:

 Hrm... how about:

 class com.packageName.MyClass
 {
 public static function create():MyClass
 {
 var inst:MyClass = new MyClass();
 return inst;
 }

 public function toString():String
 {
 return [MyClass];
 }
 }

 import com.packageName.MyClass;
 trace(MyClass.create());


 - Original Message -
 From: Rich Rodecker [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Thursday, December 29, 2005 11:35 PM
 Subject: [Flashcoders] Re: calling a static method on dynamically
 namedclass?


 hmm i tried storing a reference to the class in a variable, like

 var myClass = com.packageName.MyClass
 
  myClass.create()



 and i got this message:

 Static members can only be accessed directly through classes


 there's gotta be a way to pull this off.






 On 12/29/05, Rich Rodecker [EMAIL PROTECTED] wrote:
 
  I know you can instantiate objects by doing:
 
  var myObj = new _global[className]();
  var className = TestClass;
 
  but is it possible to call a static method of a class in a similar way?
  Im trying these two ways, and its not working for me:
 
  _global[iconName].create()
  _global[iconName]().create()
 
 
  if I try and do a trace on the class like trace( _global[iconName]) i
 get
  undefined.  The icon classes are subclasses of movieclip so that might
  make
  a difference.
 
 ___
 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] Singleton as associative array - yucky icky?

2005-12-30 Thread Nathan Derksen

Well, consider how an object can be manipulated.

var myObject:Object = new Object();
myObject.foo = bar;

or

var myObject:Object = new Object();
myObject[foo] = bar;

Those are equivalent syntaxes. Everything basically inherits from  
Object, so this is valid syntax throughout, including your custom  
classes. Basically, you are accessing (and apparently creating)  
properties on the fly, with no type checking, and no compiler  
validation as to whether the property being accessed actually exists.


You can see a bit more of this if you consider the XML class:

var myXML:XML = new XML();
myXML.foo = bar;

In this case, foo is not a valid property of the XML class, so the  
compiler spits out an error. However, if you do this:


var myXML:XML = new XML();
myXML[foo] = bar;

the compiler happily allows it, and a trace on myXML.foo reveals the  
value bar.


One more thing, the LoadVars class takes advantage of the fact that  
the class is just a collection of properties. It allows for the  
arbitrary addition of properties using both syntaxes:


var myLV:LoadVars = new LoadVars();
myLV.foo = bar;
myLV[baz] -= quux;
myLV.sendAndLoad(foo.jsp);

In many respects, LoadVars is doing what you want to do with your  
Session class.


Fun, eh!

Regarding number 2, that is what getters and setters are normally  
for. With arbitrary properties, someone correct me if I am wrong, but  
I don't think there is a way of intercepting them all, just specific  
ones that you have defined.


Nathan
http://www.nathanderksen.com


On Dec 30, 2005, at 9:55 AM, g.wygonik wrote:


lol - indeed. :-)

i'm just trying to look at possible issues that may come up later
on... but this scenario brings up two follow-up questions/concerns:

1 - the fact that Flash (AS2) will happily turn a class into an
associative array without any sort of warning. if a coder comes in and
uses session[foo], it will work with no errors thrown. can i catch
this somehow? should they use this syntax throughout their modules, it
will work with no problems, but won't be correct.

2 - can i somehow catch items being added to the class via the
ass-array method and properly add them to the Items array instead of
the root class? in other words, say a user does use the session[foo]
method. can i intercept that call, add the item/value to the Items
array and remove it from the class? i thought about some sort of
watch, but i wouldn't know what to watch in this case...

while i'm going to be setting up a proper API for them to use, in a
way this conversation is over from a real world standpoint. but i'd
like to figure this out from a theoretical standpoint now.

g.


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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread JesterXL
Correct. __resolve can catch arbitrary function calls, but not arbritary 
variable assignments.

- Original Message - 
From: Nathan Derksen [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 1:20 PM
Subject: Re: [Flashcoders] Singleton as associative array - yucky icky?


Well, consider how an object can be manipulated.

var myObject:Object = new Object();
myObject.foo = bar;

or

var myObject:Object = new Object();
myObject[foo] = bar;

Those are equivalent syntaxes. Everything basically inherits from
Object, so this is valid syntax throughout, including your custom
classes. Basically, you are accessing (and apparently creating)
properties on the fly, with no type checking, and no compiler
validation as to whether the property being accessed actually exists.

You can see a bit more of this if you consider the XML class:

var myXML:XML = new XML();
myXML.foo = bar;

In this case, foo is not a valid property of the XML class, so the
compiler spits out an error. However, if you do this:

var myXML:XML = new XML();
myXML[foo] = bar;

the compiler happily allows it, and a trace on myXML.foo reveals the
value bar.

One more thing, the LoadVars class takes advantage of the fact that
the class is just a collection of properties. It allows for the
arbitrary addition of properties using both syntaxes:

var myLV:LoadVars = new LoadVars();
myLV.foo = bar;
myLV[baz] -= quux;
myLV.sendAndLoad(foo.jsp);

In many respects, LoadVars is doing what you want to do with your
Session class.

Fun, eh!

Regarding number 2, that is what getters and setters are normally
for. With arbitrary properties, someone correct me if I am wrong, but
I don't think there is a way of intercepting them all, just specific
ones that you have defined.

Nathan
http://www.nathanderksen.com


On Dec 30, 2005, at 9:55 AM, g.wygonik wrote:

 lol - indeed. :-)

 i'm just trying to look at possible issues that may come up later
 on... but this scenario brings up two follow-up questions/concerns:

 1 - the fact that Flash (AS2) will happily turn a class into an
 associative array without any sort of warning. if a coder comes in and
 uses session[foo], it will work with no errors thrown. can i catch
 this somehow? should they use this syntax throughout their modules, it
 will work with no problems, but won't be correct.

 2 - can i somehow catch items being added to the class via the
 ass-array method and properly add them to the Items array instead of
 the root class? in other words, say a user does use the session[foo]
 method. can i intercept that call, add the item/value to the Items
 array and remove it from the class? i thought about some sort of
 watch, but i wouldn't know what to watch in this case...

 while i'm going to be setting up a proper API for them to use, in a
 way this conversation is over from a real world standpoint. but i'd
 like to figure this out from a theoretical standpoint now.

 g.

___
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] Passing complex structure of parameters to web service with ActionScript

2005-12-30 Thread Binyamin Bauman
I have been cracking my head against this for days.  I am trying to consume
a web service that requires a complex structure of parameters to be passed
with every call.  See attached screenshot for WSDL structure.  I am trying
to use WebService classes to make the call as follows.  Let me know if you
can tell me what I am doing wrong, I will pay!

Thanks,

Ben

//create parameter object

params = {

request:{

reqHeader:{

organization: Blah,

department: thigny,

application: wierdo,

userID: viga,

messageID: blinga,

timeStamp: Date,

locale: pisa

},

businessHeader:{

B2BPartnerID: 3,

B2BPartnerUser: miss,

B2BPartnerPassword: why,

partnerOrderID: ya,

partnerTransactionID: maybe,

callBackURL: itcouldbe,

preallocatedServiceAccount: string,

preallocatedGABKey: grizzle

},

getSubscriberInfoRequestHeader:{

subLocator:{

externalSystemID: bling,

externalCustomerID:
stringy,

externalSalesChannel: hi,

externalClientReference:
Hi,

subscriberID: hind,

serviceAccount: Hilasd,

email: emails,

firstName: Dave,

lastName: fizzled,

tn: 12345

}

}

}

}

//make the call

itamarResultObj = itamar.GetSubscriberInfo(params);
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Passing complex structure of parameters to webservice with ActionScript

2005-12-30 Thread Adrian Lynch
I don't know the answer, but you owe me £4.50 just for reading your email
:OD

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Binyamin
Bauman
Sent: 30 December 2005 19:03
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Passing complex structure of parameters to
webservice with ActionScript


I have been cracking my head against this for days.  I am trying to consume
a web service that requires a complex structure of parameters to be passed
with every call.  See attached screenshot for WSDL structure.  I am trying
to use WebService classes to make the call as follows.  Let me know if you
can tell me what I am doing wrong, I will pay!

Thanks,

Ben

//create parameter object

params = {

request:{

reqHeader:{

organization: Blah,

department: thigny,

application: wierdo,

userID: viga,

messageID: blinga,

timeStamp: Date,

locale: pisa

},

businessHeader:{

B2BPartnerID: 3,

B2BPartnerUser: miss,

B2BPartnerPassword: why,

partnerOrderID: ya,

partnerTransactionID: maybe,

callBackURL: itcouldbe,

preallocatedServiceAccount: string,

preallocatedGABKey: grizzle

},

getSubscriberInfoRequestHeader:{

subLocator:{

externalSystemID: bling,

externalCustomerID:
stringy,

externalSalesChannel: hi,

externalClientReference:
Hi,

subscriberID: hind,

serviceAccount: Hilasd,

email: emails,

firstName: Dave,

lastName: fizzled,

tn: 12345

}

}

}

}

//make the call

itamarResultObj = itamar.GetSubscriberInfo(params);

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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread g.wygonik
On 12/30/05, Nathan Derksen [EMAIL PROTECTED] wrote:
 Those are equivalent syntaxes. Everything basically inherits from
 Object, so this is valid syntax throughout, including your custom
 classes. Basically, you are accessing (and apparently creating)
 properties on the fly, with no type checking, and no compiler
 validation as to whether the property being accessed actually exists.

while that is true, i thought that was what the dynamic keyword was
to allow, and without it, you'd get some sort of error...

 In many respects, LoadVars is doing what you want to do with your
 Session class.

well, in ways, yes - in ways, no. it's doing the same on-the-fly
variable assignment, but doesn't have any other methods (like
addItem) that would put keys/values into a specific class member.

it seems that LoadVars just iterates over the object and outputs any
property it finds (which is why onLoad=function used to appear in
LoadVars data).

i was doing iterations over both the class object and the Items
member. i'd obviously prefer just to have one place for all props.

 Regarding number 2, that is what getters and setters are normally
 for. With arbitrary properties, someone correct me if I am wrong, but
 I don't think there is a way of intercepting them all, just specific
 ones that you have defined.

indeed there's none that i know of... but i've seen some folks do some
strange things with Flash here ;-)

as Jesse pointed out, __resolve won't work with variable assignments -
so AFAIK, there's no nice way to handle this.

g.

--
weblog: broadcast.artificialcolors.com
blazePDF: www.blazepdf.com
band: www.cutratebox.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread Nathan Derksen

On 12/30/05, Nathan Derksen [EMAIL PROTECTED] wrote:

while that is true, i thought that was what the dynamic keyword was
to allow, and without it, you'd get some sort of error...


That's the theory, but as the XML example shows, using the  
associative array syntax gets around the compile-time checking for that.



In many respects, LoadVars is doing what you want to do with your
Session class.


well, in ways, yes - in ways, no. it's doing the same on-the-fly
variable assignment, but doesn't have any other methods (like
addItem) that would put keys/values into a specific class member.

it seems that LoadVars just iterates over the object and outputs any
property it finds (which is why onLoad=function used to appear in
LoadVars data).

i was doing iterations over both the class object and the Items
member. i'd obviously prefer just to have one place for all props.


Yah, that's why it is so much cleaner just to have an associative  
array as a private property within your class, and create addItem(),  
getItem(), and removeItem() methods to manage that associative array.  
That way you also don't have to worry about the names of added  
properties possibly colliding with existing property/method names  
within the class.


Nathan
http://www.nathanderksen.com


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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread JesterXL
Flash won't bitch when you do this:

my_xml[owner]

Flex 1  1.5 will give you a warning.

Flex 2 bitches if owner isn't public.


- Original Message - 
From: Nathan Derksen [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 2:24 PM
Subject: Re: [Flashcoders] Singleton as associative array - yucky icky?


 On 12/30/05, Nathan Derksen [EMAIL PROTECTED] wrote:

 while that is true, i thought that was what the dynamic keyword was
 to allow, and without it, you'd get some sort of error...

That's the theory, but as the XML example shows, using the  
associative array syntax gets around the compile-time checking for that.

 In many respects, LoadVars is doing what you want to do with your
 Session class.

 well, in ways, yes - in ways, no. it's doing the same on-the-fly
 variable assignment, but doesn't have any other methods (like
 addItem) that would put keys/values into a specific class member.

 it seems that LoadVars just iterates over the object and outputs any
 property it finds (which is why onLoad=function used to appear in
 LoadVars data).

 i was doing iterations over both the class object and the Items
 member. i'd obviously prefer just to have one place for all props.

Yah, that's why it is so much cleaner just to have an associative  
array as a private property within your class, and create addItem(),  
getItem(), and removeItem() methods to manage that associative array.  
That way you also don't have to worry about the names of added  
properties possibly colliding with existing property/method names  
within the class.

Nathan
http://www.nathanderksen.com


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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread JesterXL
I forget what MTASC does  I think it throws a warning too.

- Original Message - 
From: JesterXL [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 2:34 PM
Subject: Re: [Flashcoders] Singleton as associative array - yucky icky?


Flash won't bitch when you do this:

my_xml[owner]

Flex 1  1.5 will give you a warning.

Flex 2 bitches if owner isn't public.


- Original Message - 
From: Nathan Derksen [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 2:24 PM
Subject: Re: [Flashcoders] Singleton as associative array - yucky icky?


 On 12/30/05, Nathan Derksen [EMAIL PROTECTED] wrote:

 while that is true, i thought that was what the dynamic keyword was
 to allow, and without it, you'd get some sort of error...

That's the theory, but as the XML example shows, using the  
associative array syntax gets around the compile-time checking for that.

 In many respects, LoadVars is doing what you want to do with your
 Session class.

 well, in ways, yes - in ways, no. it's doing the same on-the-fly
 variable assignment, but doesn't have any other methods (like
 addItem) that would put keys/values into a specific class member.

 it seems that LoadVars just iterates over the object and outputs any
 property it finds (which is why onLoad=function used to appear in
 LoadVars data).

 i was doing iterations over both the class object and the Items
 member. i'd obviously prefer just to have one place for all props.

Yah, that's why it is so much cleaner just to have an associative  
array as a private property within your class, and create addItem(),  
getItem(), and removeItem() methods to manage that associative array.  
That way you also don't have to worry about the names of added  
properties possibly colliding with existing property/method names  
within the class.

Nathan
http://www.nathanderksen.com


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


Re: [Flashcoders] Re: calling a static method on dynamically namedclass?

2005-12-30 Thread Jim Kremens
//set the name of the class to call the create() method on
var classToCall = MyClass;
_global[classToCall].create();

//change the name of the class to call create() on
classToCall = MyOtherClass;
_global[classToCall].create();

again
classToCall = AnotherClass;
_global[classToCall].create();

I'm not currently on a machine where I can test, but that should work
as long as you
declare the classes somewhere first.  I sometimes have a class that I
use to do just that:

class Dependencies {

  public function Dependencies() {
  //list fully declared class names here
  com.class1;
  com.class2;
  com.class3;
  }
}

var d: Dependencies = new Dependencies();
//even better to make it a singleton

As long as you've listed the fully declared class names somewhere in
your compiled swf, Flash will be able to provide dynamic access to
them.  If you don't list them, it will not allow you to instantiate
them out of thin air.

So, once you've done the above,

classToCall = class1;
_global[classToCall].create();

should work just fine.

Jim Kremens

On 12/30/05, Rich Rodecker [EMAIL PROTECTED] wrote:
 yeah, that works, but you are calling the static create() method through the
 name of the class itself.  Say I have a number of classes (MyClass1,
 MyOtherClass, AnotherClass) and I be able to alter which class to call the
 create method on.  I'm thinking there's got to be a way to do something
 like:

 //set the name of the class to call the create() method on
 var classToCall = MyClass;
 _global[classToCall].create();

 //change the name of the class to call create() on
 classToCall = MyOtherClass;
 _global[classToCall].create();

 again
 classToCall = AnotherClass;
 _global[classToCall].create();




 On 12/29/05, JesterXL [EMAIL PROTECTED] wrote:
 
  Hrm... how about:
 
  class com.packageName.MyClass
  {
  public static function create():MyClass
  {
  var inst:MyClass = new MyClass();
  return inst;
  }
 
  public function toString():String
  {
  return [MyClass];
  }
  }
 
  import com.packageName.MyClass;
  trace(MyClass.create());
 
 
  - Original Message -
  From: Rich Rodecker [EMAIL PROTECTED]
  To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
  Sent: Thursday, December 29, 2005 11:35 PM
  Subject: [Flashcoders] Re: calling a static method on dynamically
  namedclass?
 
 
  hmm i tried storing a reference to the class in a variable, like
 
  var myClass = com.packageName.MyClass
  
   myClass.create()
 
 
 
  and i got this message:
 
  Static members can only be accessed directly through classes
 
 
  there's gotta be a way to pull this off.
 
 
 
 
 
 
  On 12/29/05, Rich Rodecker [EMAIL PROTECTED] wrote:
  
   I know you can instantiate objects by doing:
  
   var myObj = new _global[className]();
   var className = TestClass;
  
   but is it possible to call a static method of a class in a similar way?
   Im trying these two ways, and its not working for me:
  
   _global[iconName].create()
   _global[iconName]().create()
  
  
   if I try and do a trace on the class like trace( _global[iconName]) i
  get
   undefined.  The icon classes are subclasses of movieclip so that might
   make
   a difference.
  
  ___
  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



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


Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread g.wygonik
On 12/30/05, Nathan Derksen [EMAIL PROTECTED] wrote:
 Yah, that's why it is so much cleaner just to have an associative
 array as a private property within your class, and create addItem(),
 getItem(), and removeItem() methods to manage that associative array.
 That way you also don't have to worry about the names of added
 properties possibly colliding with existing property/method names
 within the class.

most definitely - and is the way i'm working it. just sucks that i
can't catch a mistake that _might_ be made because of the associative
array call.

g.

--
weblog: broadcast.artificialcolors.com
blazePDF: www.blazepdf.com
band: www.cutratebox.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Compoent Events Example (dispatch, listen, etc)

2005-12-30 Thread Mark Ribau
Does anyone know of a really really good example that shows how to write 
Components that dispatch and listen to events ?


Deeper question: What about a Component that when dragged onto another 
Component/Object adds listeners for that Component's Events to the 
Component/Object ?


Any and all assistance is appreciated.
--
Mark Ribau
Lead Windows Developer | My Tech Blog 
http://www.redbugtech.com/blogs/mark.php

Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Compoent Events Example (dispatch, listen, etc)

2005-12-30 Thread JesterXL
Crap, tired, forgot the import statement for the first example:

import mx.events.EventDispatcher;

- Original Message - 
From: JesterXL [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 9:28 PM
Subject: Re: [Flashcoders] Compoent Events Example (dispatch, listen, etc)


I can hit the first part; I'll leave the 2nd to someone else.

In Flash 8 and below, here's how you can tap into the framework using 
MovieClip:

class Component extends MovieClip
{
// these functions are added at runtime by the mixin
// we define here so Flash compiler doesn't bitch
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function;

// event dispatching power turn on... we get signal
static private var mixit:Void = 
EventDispatcher.initialize(Component.prototype);

public function onPress():Void
{
var o:Object = {};
o.type = pressSucka;
o.target = this;
dispatchEvent(o);
}

}

To use it, give the MC a linkage name, associate this class, and then:

import Component;
attachMovie(Component, mc, 0);
mc.addEventListener(pressSucka, this);

function pressSucka(event:Object):Void
{
trace(pressed button, G!);
}

You get this for free extending UIObject:

import mx.core.UIObject;

class Component extends UIObject
{
 public function onPress():Void
{
var o:Object = {};
o.type = pressSucka;
o.target = this;
dispatchEvent(o);
}
}

In AS3, DisplayObject, Sprite, and MovieClip all extend EventDispatcher, 
thus, they too already get dispatchEvent and friends for free.

- Original Message - 
From: Mark Ribau [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 3:15 PM
Subject: [Flashcoders] Compoent Events Example (dispatch, listen, etc)


Does anyone know of a really really good example that shows how to write
Components that dispatch and listen to events ?

Deeper question: What about a Component that when dragged onto another
Component/Object adds listeners for that Component's Events to the
Component/Object ?

Any and all assistance is appreciated.
-- 
Mark Ribau
Lead Windows Developer | My Tech Blog
http://www.redbugtech.com/blogs/mark.php
Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 

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


Re: [Flashcoders] Compoent Events Example (dispatch, listen, etc)

2005-12-30 Thread Spencer Markowski
It's fairly straightforward.. at least it is if what I'm about to show you
is what you want to know. In your class file follow this basic structure.
You'll need to import mx.events.EventDispatcher and add the three functions
at the bottom to any class you wish to broadcast from.

import mx.events.EventDispatcher;
class SampleClass {
function SampleClass() {
//Register
mx.events.EventDispatcher.initialize(this);
}

public function someFunction():Void {
//Build an event object. Type is the name of the callback function
you'll use. (listener.onDragRelease)
var eventObject:Object = {target:this, type:'onDragRelease'};
//You can also add variables to pass into the event
eventObject.position = getDropPosition();
//Send it away!
dispatchEvent(eventObject);
}
/**
*dispatchEvent
*
*Used to dispatch events
*
*/
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
}

To listen to those events you just need to add a listener that is listening
for the event name you defined in the event object as type:

applicationListener = new Object;
applicationListener.onDragRelease= function(eventObj) {
//trace(:: onDragRelease Event Recieved!);
//trace(eventObj.position);
//Do something here with the data
}
var someObject:Object = {};
someObject.addEventListener(onDragRelease,applicationListener);


Hope that helps you.


On 12/30/05, Mark Ribau [EMAIL PROTECTED] wrote:

 Does anyone know of a really really good example that shows how to write
 Components that dispatch and listen to events ?

 Deeper question: What about a Component that when dragged onto another
 Component/Object adds listeners for that Component's Events to the
 Component/Object ?

 Any and all assistance is appreciated.
 --
 Mark Ribau
 Lead Windows Developer | My Tech Blog
 http://www.redbugtech.com/blogs/mark.php
 Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
Spencer Markowski
The Able Few
[EMAIL PROTECTED]
314.631.5576
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Compoent Events Example (dispatch, listen, etc)

2005-12-30 Thread JesterXL
This too, is valid:

mx.events.EventDispatcher.initialize(this);

However, that adds 3 methods to each class instance, thus every time you 
create a new class instance or component, you now add more functions to 
memory for each instance, and you run that initialize function every time 
your class is created.

If you put it up top as a static mixin:
- she only runs once
- you only add 3 methods to the protoytpe; all instances inherit them


- Original Message - 
From: Spencer Markowski [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, December 30, 2005 9:32 PM
Subject: Re: [Flashcoders] Compoent Events Example (dispatch, listen, etc)


It's fairly straightforward.. at least it is if what I'm about to show you
is what you want to know. In your class file follow this basic structure.
You'll need to import mx.events.EventDispatcher and add the three functions
at the bottom to any class you wish to broadcast from.

import mx.events.EventDispatcher;
class SampleClass {
function SampleClass() {
//Register
mx.events.EventDispatcher.initialize(this);
}

public function someFunction():Void {
//Build an event object. Type is the name of the callback function
you'll use. (listener.onDragRelease)
var eventObject:Object = {target:this, type:'onDragRelease'};
//You can also add variables to pass into the event
eventObject.position = getDropPosition();
//Send it away!
dispatchEvent(eventObject);
}
/**
*dispatchEvent
*
*Used to dispatch events
*
*/
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
}

To listen to those events you just need to add a listener that is listening
for the event name you defined in the event object as type:

applicationListener = new Object;
applicationListener.onDragRelease= function(eventObj) {
//trace(:: onDragRelease Event Recieved!);
//trace(eventObj.position);
//Do something here with the data
}
var someObject:Object = {};
someObject.addEventListener(onDragRelease,applicationListener);


Hope that helps you.


On 12/30/05, Mark Ribau [EMAIL PROTECTED] wrote:

 Does anyone know of a really really good example that shows how to write
 Components that dispatch and listen to events ?

 Deeper question: What about a Component that when dragged onto another
 Component/Object adds listeners for that Component's Events to the
 Component/Object ?

 Any and all assistance is appreciated.
 --
 Mark Ribau
 Lead Windows Developer | My Tech Blog
 http://www.redbugtech.com/blogs/mark.php
 Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
Spencer Markowski
The Able Few
[EMAIL PROTECTED]
314.631.5576
___
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] Difference keying

2005-12-30 Thread bryan.rice


On Dec 30, 2005, at 2:00 PM, Weyert de Boer wrote:

 My question is does anyone here already happen to have such a  
example working in Flash 8?


Check out Grant's Dynamic Keying example on http://incomplet.org/
.  No source code, but it shows the possibility.

blue skies,
bryan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders