[Flashcoders] AS3 Object.watch equivalent

2008-10-27 Thread Samuel Adu
Hey guys,
I need a little help here... I'm working on porting some existing AS2 code
to AS3. A porting of the AS2 class watched _root variables which were
updated by javascript (using setVariable) - When a change occurred the
callback method would change instance properties, fire events etc etc...

Now - Object.watch is not around in AS3 (I understand that the overheads for
utilising this method was pretty awful), and my flashVars are contained
within the Stage LoaderInfo obect (LoaderInfo.parameters). Does anybody have
any idea how I can monitor these variables for any changes now? Looking at
the api doc, I can't see any evidence of a LoaderInfo instance firing an
event of any use to me...

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


Re: [BULK] Re: [Flashcoders] Is there a quick way to convert back to AS2?

2008-10-27 Thread Charles Parcell
All well and good, but the government wants business reasons and not
technical abilities.

As someone else noted, point out the security upgrades as a starting point.
Then include tangible reasons such as better performance of course ware.
More robust user experience because of better video support of e-learning
materials. In other words you have to spin the enhances to fit the clients
needs.

But having worked into the government sector for a while, your project is
not likely to grease the wheels alone or even in a timely manner for your
project. But it doesn't hurt to try. :)

Charles P.


On Thu, Oct 23, 2008 at 11:16 AM, Merrill, Jason 
[EMAIL PROTECTED] wrote:

 What are some good arguments for upgrading?  I need to be able to
 convince him that this is the way to go!

 http://gskinner.com/talks/as3workshop/

 and especially:

 http://gskinner.com/talks/50reasonsAS3/


 Jason Merrill
 Bank of America
 GCIB  Staff Support LLD
 Instructional Technology  Media
 Join the Bank of America Flash Platform Developer Community
 Are you a Bank of America associate interested in innovative learning ideas
 and technologies?
 Check out our internal  Innovative Learning Blog  subscribe.

 ___
 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] AS3 associativ array length=0

2008-10-27 Thread laurent

Hi,

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 
...


It's normal behaviour ?? length work only on numerical indexes ?

L

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


Re: [Flashcoders] AS3 associativ array length=0

2008-10-27 Thread Paul Andrews
If you want an associative array like that use Object, not Array. The length 
of an array is the number of elements in the array, so it's 0. obj[name] 
is referring to an attribute of an object not an element of an Array..


Do you really have to store values like that?

Paul


- Original Message - 
From: laurent [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0



Hi,

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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] AS3 - Checking if a Function Exists

2008-10-27 Thread Karim Beyrouti
Hello Group - 

This should be really easy. I am trying to find out how to check if a
function exists or not in AS3 - 
I tried this: 

code
If ( currentSection.refresh != null ) {
currentSection.refresh();
}


/code

But I get ReferenceError: Error #1069: Property refresh not found when the
function does not exist.

Any clues?


Kind Regards



Karim

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


Re: [Flashcoders] AS3 Object.watch equivalent

2008-10-27 Thread Zeh Fernando
The ethos of AS3 is that instead of watching something, you indeed setup
events that are fired when they change. So instead you just do an
.addEventListener() to the object created.

Each object type has particular events it can fire. A LoaderInfo class
dispatches complete, httpStatus, init, ioError, open, progress, and unload
events. You can find them on the reference. Remember that the data changes
once it's loaded (complete), so that's what you want to watch even if
there's no change event.

Zeh

On Mon, Oct 27, 2008 at 9:53 AM, Samuel Adu [EMAIL PROTECTED] wrote:

 Hey guys,
 I need a little help here... I'm working on porting some existing AS2 code
 to AS3. A porting of the AS2 class watched _root variables which were
 updated by javascript (using setVariable) - When a change occurred the
 callback method would change instance properties, fire events etc etc...

 Now - Object.watch is not around in AS3 (I understand that the overheads
 for
 utilising this method was pretty awful), and my flashVars are contained
 within the Stage LoaderInfo obect (LoaderInfo.parameters). Does anybody
 have
 any idea how I can monitor these variables for any changes now? Looking at
 the api doc, I can't see any evidence of a LoaderInfo instance firing an
 event of any use to me...

 Any ideas??
 ___
 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] AS3 Object.watch equivalent

2008-10-27 Thread Ashim D'Silva
Use classes and getters and setters. Getting into details with this
would take a while, but look it up. It's far more efficient than a
watch.

2008/10/27 Samuel Adu [EMAIL PROTECTED]:
 Hey guys,
 I need a little help here... I'm working on porting some existing AS2 code
 to AS3. A porting of the AS2 class watched _root variables which were
 updated by javascript (using setVariable) - When a change occurred the
 callback method would change instance properties, fire events etc etc...

 Now - Object.watch is not around in AS3 (I understand that the overheads for
 utilising this method was pretty awful), and my flashVars are contained
 within the Stage LoaderInfo obect (LoaderInfo.parameters). Does anybody have
 any idea how I can monitor these variables for any changes now? Looking at
 the api doc, I can't see any evidence of a LoaderInfo instance firing an
 event of any use to me...

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




-- 
The Random Lines
My online portfolio
www.therandomlines.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 associativ array length=0

2008-10-27 Thread Hans Wichman
Hi,

I'm guessing the dictionary object allows you to retrieve the size of
the keyset, might be of help.

greetz
JC

On Mon, Oct 27, 2008 at 2:58 PM, Paul Andrews [EMAIL PROTECTED] wrote:
 If you want an associative array like that use Object, not Array. The length
 of an array is the number of elements in the array, so it's 0. obj[name]
 is referring to an attribute of an object not an element of an Array..

 Do you really have to store values like that?

 Paul


 - Original Message - From: laurent [EMAIL PROTECTED]
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Sent: Monday, October 27, 2008 1:35 PM
 Subject: [Flashcoders] AS3 associativ array length=0


 Hi,

 I use an array to store object with their name like that:
 views[ viewName ] = Object

 then views.length return 0 ...

 It's normal behaviour ?? length work only on numerical indexes ?

 L

 ___
 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] AS3 - Checking if a Function Exists

2008-10-27 Thread Hans Wichman
If ( currentSection[refresh] != null ) {
currentSection[refresh]();
}

 ?

 grtz
 JC


 On Mon, Oct 27, 2008 at 3:02 PM, Karim Beyrouti [EMAIL PROTECTED] wrote:
 Hello Group -

 This should be really easy. I am trying to find out how to check if a
 function exists or not in AS3 -
 I tried this:

 code
If ( currentSection.refresh != null ) {
currentSection.refresh();
}


 /code

 But I get ReferenceError: Error #1069: Property refresh not found when the
 function does not exist.

 Any clues?


 Kind Regards



 Karim

 ___
 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] AS3 associativ array length=0

2008-10-27 Thread laurent


I have a static Caddy Class that needs defferent views to show its 
content. I think I really need to store them with a name, so I could 
make a viewsNum to store how many views I got.


The thing is then I update all the views and need to iterate through the 
whole views array/object. For that I should have an array of views with 
a numeric index and so, no name storing them. Dilema


or I make two arrays one for the name, and another for the objects, with 
same index.


or store the name in the CaddyView class and when calling a view by it's 
name just look in views array with the one that have the good name.


I think all the case are here, which one do you want Paul ? :) thx

L

Paul Andrews a écrit :
If you want an associative array like that use Object, not Array. The 
length of an array is the number of elements in the array, so it's 0. 
obj[name] is referring to an attribute of an object not an element 
of an Array..


Do you really have to store values like that?

Paul


- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0



Hi,

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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] AS3 Object.watch equivalent

2008-10-27 Thread Merrill, Jason
And if you are interested in using the Flex framework, databinding is a really 
great solution for this kind of thing. 

Jason Merrill
Bank of America 
GCIB  Staff Support LLD
Instructional Technology  Media 
Join the Bank of America Flash Platform Developer Community 
Are you a Bank of America associate interested in innovative learning ideas and 
technologies?
Check out our internal  Innovative Learning Blog  subscribe. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ashim D'Silva
Sent: Monday, October 27, 2008 10:16 AM
To: Flash Coders List
Subject: Re: [Flashcoders] AS3 Object.watch equivalent

Use classes and getters and setters. Getting into details with this
would take a while, but look it up. It's far more efficient than a
watch.

2008/10/27 Samuel Adu [EMAIL PROTECTED]:
 Hey guys,
 I need a little help here... I'm working on porting some existing AS2 code
 to AS3. A porting of the AS2 class watched _root variables which were
 updated by javascript (using setVariable) - When a change occurred the
 callback method would change instance properties, fire events etc etc...

 Now - Object.watch is not around in AS3 (I understand that the overheads for
 utilising this method was pretty awful), and my flashVars are contained
 within the Stage LoaderInfo obect (LoaderInfo.parameters). Does anybody have
 any idea how I can monitor these variables for any changes now? Looking at
 the api doc, I can't see any evidence of a LoaderInfo instance firing an
 event of any use to me...

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




-- 
The Random Lines
My online portfolio
www.therandomlines.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] AS3 associativ array length=0

2008-10-27 Thread Paul Andrews

OK, I'm not sure if I follow, but..

You basically want named views onto a set of data, each view uses a separate 
object to hold the data for its own particular view.


You could use an array of objects to store the view data and each view 
object could contain a view name.


I'm not really sure how the view name is being used - if it's a finite 
number of views I'd probably use a constant for the view name as an index 
into the array:


var FIRST_VIEW:uint = 0;
var SECOND_VIEW:uint = 1;

etc.

so then we refer to view[FIRST_VIEW].

If it's a true associative array you're after you might need a dictionary.

A lot of people try and write AS3 code using  AS1/AS2 habits, so that's why 
I asked.


Paul

- Original Message - 
From: laurent [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 2:25 PM
Subject: Re: [Flashcoders] AS3 associativ array length=0




I have a static Caddy Class that needs defferent views to show its 
content. I think I really need to store them with a name, so I could make 
a viewsNum to store how many views I got.


The thing is then I update all the views and need to iterate through the 
whole views array/object. For that I should have an array of views with a 
numeric index and so, no name storing them. Dilema


or I make two arrays one for the name, and another for the objects, with 
same index.


or store the name in the CaddyView class and when calling a view by it's 
name just look in views array with the one that have the good name.


I think all the case are here, which one do you want Paul ? :) thx

L

Paul Andrews a écrit :
If you want an associative array like that use Object, not Array. The 
length of an array is the number of elements in the array, so it's 0. 
obj[name] is referring to an attribute of an object not an element of 
an Array..


Do you really have to store values like that?

Paul


- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0



Hi,

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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] AS3 associativ array length=0

2008-10-27 Thread laurent


something like that should do it:

   public function Caddy() {
   if ( getQualifiedClassName( super ) == ::Caddy ) {
   throw new ArgumentError( Use get instance pl0x. );
   }else{
   _listproduct = new Array();
   _views = new Array();
   }
   }
  
   public function addView ( v : CaddyViewBase ) : void

   {
   if ( Boolean( view( v.name ) ) )
   throw new Error ( CaddyView with name' + v.name + ' 
has already been created. );

   else if (!v.name )
   throw new Error ( Cannot create a CaddyView instance 
without a name );

   _views.push( v );
   }
  
   public function view ( name : String ) : CaddyViewBase

   {
   var i : int = _views.length;
   while ( i-- )
   if ( _views[ i ].name == name ) return _views[ i ];
   }

   return null;
   }

then I can retrieve by name and iterate through it

L



Hans Wichman a écrit :

Hi,

I'm guessing the dictionary object allows you to retrieve the size of
the keyset, might be of help.

greetz
JC

On Mon, Oct 27, 2008 at 2:58 PM, Paul Andrews [EMAIL PROTECTED] wrote:
  

If you want an associative array like that use Object, not Array. The length
of an array is the number of elements in the array, so it's 0. obj[name]
is referring to an attribute of an object not an element of an Array..

Do you really have to store values like that?

Paul


- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0




Hi,

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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] AS3 associativ array length=0

2008-10-27 Thread jonathan howe
Hi, laurent,

I'm missing why you can't just use the

for (prop in views) {
   var view:Classname = views[prop] as Classname;
}
type syntax?




On Mon, Oct 27, 2008 at 10:25 AM, laurent [EMAIL PROTECTED] wrote:


 I have a static Caddy Class that needs defferent views to show its content.
 I think I really need to store them with a name, so I could make a viewsNum
 to store how many views I got.

 The thing is then I update all the views and need to iterate through the
 whole views array/object. For that I should have an array of views with a
 numeric index and so, no name storing them. Dilema

 or I make two arrays one for the name, and another for the objects, with
 same index.

 or store the name in the CaddyView class and when calling a view by it's
 name just look in views array with the one that have the good name.

 I think all the case are here, which one do you want Paul ? :) thx

 L

 Paul Andrews a écrit :

 If you want an associative array like that use Object, not Array. The
 length of an array is the number of elements in the array, so it's 0.
 obj[name] is referring to an attribute of an object not an element of an
 Array..

 Do you really have to store values like that?

 Paul


 - Original Message - From: laurent [EMAIL PROTECTED]
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Sent: Monday, October 27, 2008 1:35 PM
 Subject: [Flashcoders] AS3 associativ array length=0


 Hi,

 I use an array to store object with their name like that:
 views[ viewName ] = Object

 then views.length return 0 ...

 It's normal behaviour ?? length work only on numerical indexes ?

 L

 ___
 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




-- 
-jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 associativ array length=0

2008-10-27 Thread laurent

Paul Andrews a écrit :

OK, I'm not sure if I follow, but..

You basically want named views onto a set of data, each view uses a 
separate object to hold the data for its own particular view.


You could use an array of objects to store the view data and each view 
object could contain a view name.


I'm not really sure how the view name is being used - if it's a finite 
number of views I'd probably use a constant for the view name as an 
index into the array:

The view name is the name of the movieClip the view is linked to.
The data is stored in the Caddy class then the different CaddyViews 
display the data with different functionnality, some you have a delete 
button per product some doesn't for exemple.


so it add the view using the movieClip name on stage.


var FIRST_VIEW:uint = 0;
var SECOND_VIEW:uint = 1;
etc.
so then we refer to view[FIRST_VIEW].

If it's a true associative array you're after you might need a 
dictionary.


A lot of people try and write AS3 code using  AS1/AS2 habits, so 
that's why I asked.
yes, I try to learn the AS3 habit. Those static stuff and inheritance 
are awesome.
I think I got the proper solution now, an array and a search method, 
thank you for sharing possibilities.


L



Paul

- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 2:25 PM
Subject: Re: [Flashcoders] AS3 associativ array length=0




I have a static Caddy Class that needs defferent views to show its 
content. I think I really need to store them with a name, so I could 
make a viewsNum to store how many views I got.


The thing is then I update all the views and need to iterate through 
the whole views array/object. For that I should have an array of 
views with a numeric index and so, no name storing them. Dilema


or I make two arrays one for the name, and another for the objects, 
with same index.


or store the name in the CaddyView class and when calling a view by 
it's name just look in views array with the one that have the good name.


I think all the case are here, which one do you want Paul ? :) thx

L

Paul Andrews a écrit :
If you want an associative array like that use Object, not Array. 
The length of an array is the number of elements in the array, so 
it's 0. obj[name] is referring to an attribute of an object not an 
element of an Array..


Do you really have to store values like that?

Paul


- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0



Hi,

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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




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


Re: [Flashcoders] AS3 associativ array length=0

2008-10-27 Thread laurent


Hm yeah...I can't remember if I have memory problems or if I'm just 
ignorant.


So I swap to object, don't need all the stuff stuffed with array.

jonathan howe a écrit :

Hi, laurent,

I'm missing why you can't just use the

for (prop in views) {
   var view:Classname = views[prop] as Classname;
}
type syntax?




On Mon, Oct 27, 2008 at 10:25 AM, laurent [EMAIL PROTECTED] wrote:

  

I have a static Caddy Class that needs defferent views to show its content.
I think I really need to store them with a name, so I could make a viewsNum
to store how many views I got.

The thing is then I update all the views and need to iterate through the
whole views array/object. For that I should have an array of views with a
numeric index and so, no name storing them. Dilema

or I make two arrays one for the name, and another for the objects, with
same index.

or store the name in the CaddyView class and when calling a view by it's
name just look in views array with the one that have the good name.

I think all the case are here, which one do you want Paul ? :) thx

L

Paul Andrews a écrit :

If you want an associative array like that use Object, not Array. The


length of an array is the number of elements in the array, so it's 0.
obj[name] is referring to an attribute of an object not an element of an
Array..

Do you really have to store values like that?

Paul


- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0


Hi,
  

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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] AS3 associativ array length=0

2008-10-27 Thread laurent

Yes that makes everything more simple.
Thanks everyone.
L

jonathan howe a écrit :

Hi, laurent,

I'm missing why you can't just use the

for (prop in views) {
   var view:Classname = views[prop] as Classname;
}
type syntax?




On Mon, Oct 27, 2008 at 10:25 AM, laurent [EMAIL PROTECTED] wrote:

  

I have a static Caddy Class that needs defferent views to show its content.
I think I really need to store them with a name, so I could make a viewsNum
to store how many views I got.

The thing is then I update all the views and need to iterate through the
whole views array/object. For that I should have an array of views with a
numeric index and so, no name storing them. Dilema

or I make two arrays one for the name, and another for the objects, with
same index.

or store the name in the CaddyView class and when calling a view by it's
name just look in views array with the one that have the good name.

I think all the case are here, which one do you want Paul ? :) thx

L

Paul Andrews a écrit :

If you want an associative array like that use Object, not Array. The


length of an array is the number of elements in the array, so it's 0.
obj[name] is referring to an attribute of an object not an element of an
Array..

Do you really have to store values like that?

Paul


- Original Message - From: laurent [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0


Hi,
  

I use an array to store object with their name like that:
views[ viewName ] = Object

then views.length return 0 ...

It's normal behaviour ?? length work only on numerical indexes ?

L

___
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


[Flashcoders] Re: Re: Passing text between SWFs

2008-10-27 Thread Alan Neilsen
Thanks for all your help dr.ache. I think I am very close now. I still get a 
number of errors, but I think the underlying problem is this one:
5000: The class 'RTE2124BuserName' must subclass 'flash.display.MovieClip' 
since it is linked to a library symbol of that type.

What is that trying to tell me, and how do I fix it? I tried a number of things 
(even deleting all the Movie Clips from the library), but I still get the same 
errors. It certainly won't let me put one class in another (as one might 
interpret the term subclass). When I tried that it told me that classes can't 
be nested.

package {
// Import stuff
import flash.events.EventDispatcher;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.*;
import flash.net.URLRequest;
import flash.display.Graphics;
public class RTE2124BuserName {
var rect1:Shape = new Shape();
rect1.graphics.beginFill(0xFF);
rect1.graphics.drawRect(0, 0, 1966, 660);
rect1.endFill();
addChild(rect1);
var ldr1:Loader = new Loader();
ldr1.mask = rect1;
var url1:String = topics/rte2124b_topic1.swf;
var urlReq1:URLRequest = new URLRequest(url1);
ldr1.load(urlReq1);

ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler1);
}
public function completeHandler1(event:Event):void {
MovieClip(event.currentTarget)._parent = this;
trace(_parent.ldr1);
}
}

Alan Neilsen


This message is for the named person’s use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or; lost by any mistransmission. If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify
the sender. You must not directly or indirectly, use, disclose,
distribute, print or copy any part of this message if you are not the
intended recipient. GOULBURN OVENS INSTITUTE OF TAFE and
any of its subsidiaries each reserve the right to monitor all e-mail
communications through its networks. Any views expressed in this
message are those of the individual sender, except where the
message states otherwise and the sender is authorised to state them
to be the views of any such entity.

#
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal
#
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] AS Quicktime animation setup : 40min possible?

2008-10-27 Thread artur

need to know a few things:

1 - can i render/export to QT an AS based animation that will be 40min long?
it will be incorporating an FLV ( soundtrack ) with Cuepoints..that will 
trigger different AS animations made from an XML file.
is there a chance that the animation and sound can become out of sync ( 
this has been known to happen with timeline based animations )


2 - the FLV will have over 10k cuepoints.
is there a way to Scrub through to the middle of the animation by 
giving an ID# to each CuePoint?

and then giving each XML node that same ID#?

then just create a simple textfield form and have the client enter that ID#
and the animation can Jump to that section of the animation ( for 
testing/previewing )


but then how can the client add/delete cuepoints in the FLV and have 
them be resorted numerically? so they can match the xml IDs?

im sure there is a clever  flexible solution out there..anyone?
thanks!

p.s. i need to do this in AS2..if possible.
--

*artur :.*

- *www.artur.com*
- [EMAIL PROTECTED]
- *ph:646.797.3320*

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


Re: [Flashcoders] Re: Re: Passing text between SWFs

2008-10-27 Thread Paul Andrews
- Original Message - 
From: Alan Neilsen [EMAIL PROTECTED]

To: flashcoders@chattyfig.figleaf.com
Sent: Monday, October 27, 2008 10:13 PM
Subject: [Flashcoders] Re: Re: Passing text between SWFs


Thanks for all your help dr.ache. I think I am very close now. I still get a 
number of errors, but I think the underlying problem is this one:
5000: The class 'RTE2124BuserName' must subclass 'flash.display.MovieClip' 
since it is linked to a library symbol of that type.


What is that trying to tell me, and how do I fix it? I tried a number of 
things (even deleting all the Movie Clips from the library), but I still get 
the same errors. It certainly won't let me put one class in another (as one 
might interpret the term subclass).


That's not the correct interpretation of subclass. What it wants is a class 
that is based on MovieClip, so:


public class RTE2124BuserName extends MovieClip {

would base your class on MovieClip and then it would be a subclass of 
MovieClip ..


Paul
-
When I tried that it told me that classes can't be nested.

package {
   // Import stuff
   import flash.events.EventDispatcher;
   import flash.events.Event;
   import flash.events.MouseEvent;
   import flash.display.*;
   import flash.net.URLRequest;
   import flash.display.Graphics;
   public class RTE2124BuserName {
   var rect1:Shape = new Shape();
   rect1.graphics.beginFill(0xFF);
   rect1.graphics.drawRect(0, 0, 1966, 660);
   rect1.endFill();
   addChild(rect1);
   var ldr1:Loader = new Loader();
   ldr1.mask = rect1;
   var url1:String = 
topics/rte2124b_topic1.swf;
   var urlReq1:URLRequest = new 
URLRequest(url1);

   ldr1.load(urlReq1);
   
ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler1);
   }
   public function completeHandler1(event:Event):void {
   MovieClip(event.currentTarget)._parent = 
this;

   trace(_parent.ldr1);
   }
}

Alan Neilsen


This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or; lost by any mistransmission. If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify
the sender. You must not directly or indirectly, use, disclose,
distribute, print or copy any part of this message if you are not the
intended recipient. GOULBURN OVENS INSTITUTE OF TAFE and
any of its subsidiaries each reserve the right to monitor all e-mail
communications through its networks. Any views expressed in this
message are those of the individual sender, except where the
message states otherwise and the sender is authorised to state them
to be the views of any such entity.

#
This e-mail message has been scanned for Viruses and Content and cleared
by MailMarshal
#
___
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: Re: Passing text between SWFs

2008-10-27 Thread dr.ache

Hi Alan.

The missing thing is you must let RTE2124BuserName (one of the most 
horrible class names I have seen so far :-) ) extend MovieClip.

Therefore you have to import the movieclip class
How this is accomplished you can see in the text.

The errormessage tells you that you linked one of the library symbols 
with your class - what is ok to do so.
In the linkage properties you can define a baseclass for your symbol 
what you could change to flash.display.Sprite
but in your case its not necessary. To delete all your symbols in the 
library is definitely not a solution ;-)


As far as I can tell you this is not the last error you get. I highly 
recommend to read the manual.


Alan Neilsen schrieb:

Thanks for all your help dr.ache. I think I am very close now. I still get a 
number of errors, but I think the underlying problem is this one:
5000: The class 'RTE2124BuserName' must subclass 'flash.display.MovieClip' 
since it is linked to a library symbol of that type.

What is that trying to tell me, and how do I fix it? I tried a number of things (even 
deleting all the Movie Clips from the library), but I still get the same errors. It 
certainly won't let me put one class in another (as one might interpret the term 
subclass). When I tried that it told me that classes can't be nested.

package {
// Import stuff
  

here goes:
import flash.display.MovieClip;

import flash.events.EventDispatcher;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.*;
import flash.net.URLRequest;
import flash.display.Graphics;
public class RTE2124BuserName {
  

this one needs to be:
public class RTE2124BuserName extends MovieClip

var rect1:Shape = new Shape();
rect1.graphics.beginFill(0xFF);
rect1.graphics.drawRect(0, 0, 1966, 660);
rect1.endFill();
addChild(rect1);
var ldr1:Loader = new Loader();
ldr1.mask = rect1;
var url1:String = topics/rte2124b_topic1.swf;
var urlReq1:URLRequest = new URLRequest(url1);
ldr1.load(urlReq1);

ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler1);
}
public function completeHandler1(event:Event):void {
MovieClip(event.currentTarget)._parent = this;
trace(_parent.ldr1);
}
}

Alan Neilsen


This message is for the named person’s use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or; lost by any mistransmission. If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify
the sender. You must not directly or indirectly, use, disclose,
distribute, print or copy any part of this message if you are not the
intended recipient. GOULBURN OVENS INSTITUTE OF TAFE and
any of its subsidiaries each reserve the right to monitor all e-mail
communications through its networks. Any views expressed in this
message are those of the individual sender, except where the
message states otherwise and the sender is authorised to state them
to be the views of any such entity.

#
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal

#
___
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] h264 video looks blurry/crappy in flash

2008-10-27 Thread Søren Christensen


The video i am using has the same size as the stage area so no  
scaling is taking place.
smoothing = true  normally activates antialiasing if the video is  
scaled up/down.


However weird things hapens with h264 -

with smoothing 'on' the image gets too soft and to some degree  
degrades the picture.
With smoothing 'off' it leaves the video very rough and aliased as if  
the video had been scaled up from 1/4th the resolution.


I have been testing on osx 10.4 safari/ff  and 9.0.115 fp

Cheers,
B) Søren

  MOTION  INTERACTIVITY
  dslnc studio -  www.desilence.net
  +34 93 268 0953  /  +34 61 555 9963 (mobile)




On Oct 24, 2008, at 5:37 PM, Cedric Muller wrote:


do you, by any chance, use the video.smoothing = true ?
by looking at the video, it seems this option is set to true


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


Re: [Flashcoders] AS3 - Checking if a Function Exists

2008-10-27 Thread Steven Sacks

if (currentSection.refresh)
{
currentSection.refresh();
}

Karim Beyrouti wrote:
Hello Group - 


This should be really easy. I am trying to find out how to check if a
function exists or not in AS3 - 
I tried this: 


code
If ( currentSection.refresh != null ) {
currentSection.refresh();
}


/code

But I get ReferenceError: Error #1069: Property refresh not found when the
function does not exist.

Any clues?


Kind Regards



Karim

___
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