Re: [Flashcoders] Performance from casting array/vector?

2009-12-26 Thread Fumio Nonaka
A variable declaration is processed before statements.  Therefore, it 
does not matter if it is inside or outside a loop.


myClass = new MyClass();
trace(myClass);  // Output: [object MyClass]
while (false) {
var myClass:MyClass;
}
_
Piers Cowburn wrote:

AFAIK, using implicit casting rather than explicit in this case is faster, so 
A1 in your examples is faster than A2. Also, it's better to move your variable 
declaration outside the loop:

var i:int = myArray.length;
// Variable is declared once here and then reused
var myClass:MyClass;
while (i--)
{
   myClass = myArray[i];
}


Good luck,
--
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
English bloghttp://blog.jactionscripters.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Resizing the drop down list of ComboBox when removeItem() is called

2009-07-28 Thread Fumio Nonaka
When items in a CombBox compnent instance are removed with
ComboBox.removeItem() method, its size of drop down list will not be
adjusted. I suspect that this behavior might be a bug because
ComboBox.removeItemAt() method properly reset its size.
http://blog.jactionscripters.com/2009/07/28/resizing-the-drop-down-list-of-combobox-when-removeitem-is-called/
-- 
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Multiplying a Vector3D by a projection Matrix3D

2009-05-17 Thread Fumio Nonaka
I am sorry for replying late.  And thank you very much for your comment, 
Ron.


I think that the results was interesting.  Because no number multiplied 
by 0 comes to be 1.  It would take a little time to explain my point. 
Therefore I wrote it in our blog.


Vector3D.w property for multiplication
http://blog.jactionscripters.com/2009/05/17/test/

Any comments would be very appreciated.
_
Ron Wheeler wrote:

Fumio Nonaka wrote:

var myMatrix3D:Matrix3D = new Matrix3D();
var myVector3D:Vector3D = new Vector3D();
trace(myVector3D, myVector3D.w);  // Output: Vector3D(0, 0, 0) 0
myVector3D = myMatrix3D.transformVector(myVector3D);
trace(myVector3D, myVector3D.w);  // Output: Vector3D(0, 0, 0) 1


You seem to be multiplying a null vector(zero length located at 0,0,0 at 
the best interpretation) by a null or zero transformation. The results 
will not be very interesting .


Perhaps you might try it with a not null vector and a not null 
transformation and see if you get something more interesting.


Good luck,
--
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Blog in Englishhttp://blog.jactionscripters.com/
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Multiplying a Vector3D by a projection Matrix3D

2009-05-07 Thread Fumio Nonaka
Vector3D.project() method in [Help] says:
If the current Vector3D object is the result of multiplying a Vector3D
object by a projection Matrix3D object, the w property can hold the
transform value.
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/Vector3D.html#project()

How can you multiply a Vector3D object by a projection Matrix3D object?
 I had thought the Matrix3D.transformVector() method do it.  However the
Vector3D.w property of the reslut instance did not hold its value but
was set to 1.  I could not find out other methods for multiplication.

var myMatrix3D:Matrix3D = new Matrix3D();
var myVector3D:Vector3D = new Vector3D();
trace(myVector3D, myVector3D.w);  // Output: Vector3D(0, 0, 0) 0
myVector3D = myMatrix3D.transformVector(myVector3D);
trace(myVector3D, myVector3D.w);  // Output: Vector3D(0, 0, 0) 1

Any advices or suggestions would be very appreciated.
-- 
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Math: Is this correct?

2009-04-10 Thread Fumio Nonaka

One correction:
_
Anthony Pace wrote:
 Point (x, y) for a spin
// result_x = Math.cos (a) * x Math.sin (a) * y;
result_x = Math.cos (a) * x - Math.sin (a) * y;
 result_y = Math.sin (a) * x + Math.cos (a) * y;
 ? a in radians

The rotation matrix represents these formulas:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/images/matrix_rotate.jpg

The figure in Flash CS4 Help is incorrect, though.  I added comment to 
correct it.

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/Matrix.html

Good luck,
--
Fumio Nonaka
mailto:fu...@mx10.ttcn.ne.jp
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-27 Thread Fumio Nonaka

I am a little late.  But another way to make the script short:

function dec2hex(input:Number):String {
var hex:Number;
// var stgHex:String = uint(input).toString(16);
var stgHex:String = uint(input+0x100).toString(16).substr(1);
/*
while (stgHex.length  6) {
stgHex = 0+stgHex;
}
*/
stgHex = 0x+stgHex;
return stgHex;
}
_
Robert Leisle wrote:

Hi Jason,

Is something like this what you need?

function dec2hex(input):String {
var hex:Number;
var stgHex:String = uint(input).toString(16);
while (stgHex.length  6){
stgHex = 0+stgHex;
}
stgHex = 0x+stgHex;
return stgHex;
}

function hex2dec(input):String {
return String(uint(input));
}

// test run
var decColor:Number = 102;
var hexColor:String = dec2hex(decColor);
trace(hex: +hexColor);
trace(dec: +hex2dec(hexColor));

--
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Calling super.apply

2008-06-29 Thread Fumio Nonaka

Is the following what you would like to do?
http://www.fumiononaka.com/TechNotes/Flash/FN0703001.html
*Sorry, the article is in Japanese.

package {
dynamic public class MyArray extends Array {;
public function MyArray(...args) {
if (args.length == 1  !isNaN(args[0])) {
this.length = args[0];
} else {
push.apply(this, args);
}
}
}
}
_
Sidney de Koning wrote:
If i push my values; my class returns that current item, if i pass it  
through the constructor i get back an array.
I want to be able to do both; push items seperately and pass through  an 
whole array in its constructor.


Is there something i can like super.apply(this, args) ?

public dynamic class ArrayIterator extends Array
{
//
protected var _index:int;

public function ArrayIterator(...args)

{
super(args);
_index = 0;
}

What am i doing wrong here and what can i do to solve this?

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Fumio Nonaka

Using Point class?

import flash.geom.Point;
var p0:Point = new Point(0, 0);
var p1:Point = new Point(1, Math.sqrt(3));
var nDistance:Number = Point.distance(p0, p1);
trace(nDistance);  // Output: 2
_
Jim Hayes wrote:

I think there may be an inbuilt method in flash, mind you, but if there
is I don't know what it is.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lehr,
Theodore M (N-SGIS)
Sent: 11 March 2008 12:05
To: Flash Coders List
Subject: [Flashcoders] calculating distance between two points

How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] clean scripting

2008-03-11 Thread Fumio Nonaka
Yes, you might be missed something, Jesse.  I got the same result as 
Muzak did.


// ActionScript 2.0
// frame action:
var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();
instance1.addItem(Hello World);
trace(instance1.data);  // Output: Hello World
trace(instance2.data);  // Output: Hello World
_
Jesse Graupmann wrote:

Muzak,

Maybe I missed something, but instance2 in your example has no data. Only
static members can be shared across all instances - did you mean...



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Muzak
Sent: Tuesday, March 11, 2008 4:51 PM
To: Flash Coders List
Subject: Re: [Flashcoders] clean scripting

Allthough the following no longer seems to apply in AS3, it might be good to
know.

In AS2, if you have the following class:

class MyClass {
 
 private var myArray:Array = new Array();
 
 public function addItem(item:Object) {

  myArray.push(item);
 }
 
 public function get data():Array {

  return myArray;
 }
 
}


The myArray class member will be shared across ALL instances of the class.

var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();

instance1.addItem(Hello World);
trace(instance1.data);
trace(instance2.data);

//output:
Hello World
Hello World


Good luck,
--
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] urgent angle problem

2008-02-05 Thread Fumio Nonaka

angle = (angle%360+360)%360;

Then:
810 - 90
-810 - 270
_
Bob Leisle wrote:

if (angle  0) {
  angle += 360;
}

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] parent property woes in AS3

2008-01-06 Thread Fumio Nonaka

You should cast to the class.  About casting see the following:

Programming ActionScript 3.0  ActionScript language and syntax  Data 
types  Type conversions:

http://livedocs.adobe.com/flash/9.0/main/0048.html
_
Omar Fouad wrote:

so if I am inside a movieClip mc i should do:

mc(parent).play(); ???



On Jan 6, 2008 5:45 AM, Fumio Nonaka [EMAIL PROTECTED] wrote:

The parent is a property of DisplayObject class, while the play() method
is belongs to MovieClip class which is a sub class of DisplayObject.
Therefore the reference of the property should be cast to MovieClip class.

MovieClip(parent).play();

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] parent property woes in AS3

2008-01-05 Thread Fumio Nonaka
The parent is a property of DisplayObject class, while the play() method 
is belongs to MovieClip class which is a sub class of DisplayObject. 
Therefore the reference of the property should be cast to MovieClip class.


MovieClip(parent).play();
_
Omar Fouad wrote:

In AS3 I am tring to get the parent movieClip that contains some movieClip
timeline animation...

parent.play();

It gets me an Error???


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MovieClip Buttons in Flash CS3 ActionScript 3

2007-06-28 Thread Fumio Nonaka
When the statement you put is processed the play head in the btn_play 
instance is in the first frame, in which the over_mc instance does not 
exist.  This is what the error tells you.  Therefore 
InteractiveObject.mouseEnabled for over_mc cannot be set.


trace(btn_play.over_mc);  // Output: null

The statement should be placed in the second frame of the btn_play, or 
inside the over_mc itself.

_
Jim Berkey wrote:

Can you explain using' InteractiveObject.mouseEnabled' to allow a mc inside a 
mc acting as a button a little more? I have a mc called button_play, with the 
three frames (_up, _over, and _down), in the over frame, instead of a graphic, 
I placed a mc, gave it instance name over_mc, and on the main timeline, put:

btn_play.over_mc.mouseEnabled = false;

I got this error:
TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
at FinalAssets2_fla::MainTimeline/FinalAssets2_fla::frame1()


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] MovieClip Buttons in Flash CS3 ActionScript 3

2007-06-27 Thread Fumio Nonaka

This works in ActionScript 3.0, too.

You should use Graphic instances for your button's states.  Otherwise, 
set the InteractiveObject.mouseEnabled properties of MovieClips for each 
state to false.

_
Adam Pasztory wrote:

The problem seems to be that each of my button states is a MovieClip.  In
your version, the buttons states are just raw graphics and text the 
timeline

of the button.  Do a convert to symbol on your graphics, and change each
button state into a MovieClip.  The hit areas will no longer work.


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] attachMovie fails on embedded clip in a movie, why?

2007-06-25 Thread Fumio Nonaka

One sidenote:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15638sliceId=2
Instances of imported symbols must be manually placed on the Timeline 
during authoring.

_
Ian Thomas wrote:

The only exception is when using shared libraries.


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] onReleaseOutside event - AS3

2007-06-20 Thread Fumio Nonaka
My site below, which I am afraid is in Japanese, includes a class that 
implements onReleaseOutside event handler method as well as onPress and 
onRelease methods.

http://www.fumiononaka.com/TechNotes/Flash/FN0608004.html

Translation by babelfish:
http://babelfish.altavista.com/babelfish/urltrurl?lp=ja_entrurl=http%3a%2f%2ffumiononaka.com%2fBooks%2f..%2fTechNotes%2fFlash%2fFN0608004.html
_
Bob Wohl wrote:
Just Curious, why the heck is there no onReleaseOutside Events in AS3? I 
was

building a custom scrubber the other day and couldn't fine any events for
this. Flex has one, why not AS3?


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] rotate a cube

2007-05-01 Thread Fumio Nonaka

Flash 8 source fla file can be downloaded.

3D Transformation:
http://www.fumiononaka.com/Sample/3D_Box/3D_Box.html
_
Danny Kodicek wrote:

If you made your cube as a perspective object in Flash, you're right, you
can't rotate it automatically (how would Flash know what the rest of it
looked like?!) There's no way to do what you're trying without using some
actionscript (and a fair amount of maths). However, there are a fair number
of 3d tutorials out there - a Google on 'rotate cube actionscript' brought
up this one as a first hit:
http://www.kirupa.com/developer/actionscript/rotation_center.htm

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] Are string literals and String objects the same in AS3?

2007-04-30 Thread Fumio Nonaka
Programming ActionScript 3.0  ActionScript language and syntax  Data 
types:

http://livedocs.adobe.com/flash/9.0/main/0044.html
In ActionScript 3.0, primitive values and their wrapper objects are, 
for practical purposes, indistinguishable. All values, even primitive 
values, are objects. Flash Player treats these primitive types as 
special cases that behave like objects but that don't require the normal 
overhead associated with creating objects.


ECMAScript 4  Types
http://www.mozilla.org/js/language/es4/libraries/types.html
Unlike in ECMAScript 3, there is no distinction between objects and 
primitive values. All values can have methods.

_
David Bellerive wrote:


In AS2, your example would of course work but only because the Flash Player 
would create a temporary String object with your string literal, then get the 
object's length property and return the value, and then delete the temporary 
String object it created. So yes, all method calls and get/set on property 
values would work just fine on literals in AS2, but only because Flash Player 
used to create temporary objects and delete them as soon as the operation ended.
Thus, when you needed to call multiple methods on a string for exemple, it was 
more efficient to explicitely create a new instance of the String object and 
call those methods on the object rather that just calling those methods on a 
string literal.
But it seems that this is no longer true in AS3, that String objects and string 
literals are now treated the same by Flash Player 9 using AS3 (there are no 
more implicit temporary String objects created by the Flash Player).

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] 寂しい人妻は、本当 にビックリするくらい。。。

2007-03-28 Thread Fumio Nonaka
To: Web master

This is a SPAM mail in Japanese.  Please remove this account from this
mailing list.

 Original Message 
Subject: [Flashcoders] 寂しい人妻は、本当にビックリするくらい。。。
Date: 28 Mar 2007 02:08:33 -0700
From: 心の隙間 [EMAIL PROTECTED]
-

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

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

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


Re: [Flashcoders] AS3 parseFloat issue?

2007-03-06 Thread Fumio Nonaka

2 floating point numbers are NOT close enough.  That IS the problem.

var _str:String = 1.2e+51;
var n:Number = parseFloat(_str);
trace((n-1.2e+51)  1000);  // true
_
Ron Wheeler wrote:
If you want to know that 2 floating point numbers are close enough to 
be considered as the same value, then subtract them and check to see if 
the absolute value of their difference is less than your criteria for 
sameness.



elibol wrote:

I came to this specific value from 6.3e51. Here are some more tests:

var test1_str:String = 6.3e51; //6.3e+51 outputs same result.
var n1:Number = parseFloat(test1_str);



trace(n1-(6.3e51));

//AS3



1.32922799578491e+36



On 3/5/07, Fumio Nonaka [EMAIL PROTECTED] wrote:

I am not sure whether it is a bug or by design, though.

var test0_str:String = 6.30e+51;
var n0:Number = parseFloat(test0_str);



trace(n0-(6.30e+51));
// ActionScript 3.0



1.32922799578491e+36
// ActionScrpt 2.0



0


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

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

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


Re: [Flashcoders] AS3 parseFloat issue?

2007-03-05 Thread Fumio Nonaka

I am not sure whether it is a bug or by design, though.

var test0_str:String = 6.30e+51;
var n0:Number = parseFloat(test0_str);
trace(n0);
trace(n0 == (6.30e+51));
trace(n0-(6.30e+51));
// ActionScript 3.0
6.30e+51
false
1.32922799578491e+36
// ActionScrpt 2.0
6.3e+51
true
0

Decrease one digit:

var test1_str:String = 6.3e+51;
var n1:Number = parseFloat(test1_str);
trace(n1 == (6.3e+51));
trace(n1-(6.3e+51));
// ActionScript 3.0
true
0
_
elibol wrote:

Those who are interested in helping me verify the problem can run this test
in actionscript 2.0 and again in actionscript 3.0.

var a:String = 6.30e+51;
var b:String = 23;
var c:Number = parseFloat(a)%parseFloat(b);
trace(c); //outputs 7 in as3, and 18 in as2
trace(6.30e+51%23); // outputs 18 in both as2 and 3


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

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

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


Re: [Flashcoders] Set Interval Question

2007-03-02 Thread Fumio Nonaka
It is inadvertently undocumented but officially supported. See the 
comment by Francis Cheng of Adobe:

http://livedocs.adobe.com/flash/8/main/1717.html
_
Muzak wrote:

It's an undocumented feature:
http://www.flashguru.co.uk/flash-8-settimeout/


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

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

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


Re: [Flashcoders] removeMovieclip actions on 1000 MCs

2007-02-16 Thread Fumio Nonaka
If your movie's structure allows, create an empty MovieClip and put all 
instances to be removed into it.  Removing the parent MovieClip clears 
all included children.

_
Mick G wrote:

At the moment I have a for loop that is assigning:

for(var i=0; i1000; i++){
   this[mc+i].onPress = function(){
trace(this);
   this.removeMovieClip();
   }
}

it all works fine, I'm just wondering if anyone can think of anything more
efficient for such a large number of MCs. Like a listener or something?


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/

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

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


[Flashcoders] How to clear the settings of data bindings?

2007-02-13 Thread Fumio Nonaka
How could the settings of data bindings be cleared up?  My problem is
reproduced by the followings:

1. Place two CheckBox compontnent instances named checkBox0 and
checkBox1.
2. Open the [Component Inspecter] and select the [Bindings] tab.
3. Select checkBox1 and click the [Add binding] button. With
selected:Boolean hilighted click the [OK] button.
4. Set [direction] to [in/out] and [bound to] the other CheckBox,
checkBox1
5. [Test Movie] to make sure selection of one CheckBox is cooperate to
the other status.

It works.  Then do the followings:
6. Select two component instances and make them to a MovieClip symbol.
7. [Test Movie] shows errors because path or something for data bindings
comes to be wrong.
8. Delete the MovieClip on the stage. (Then nothing exists on it.)
Also, delete all items in the [Library].  Nothing should be included in
the fla document.
9. [Test Movie] still shows errors:
Scene 1, Binding between unknown.selected. and unknown.selected.:
The endpoint of the binding does not exist
Scene 1, Binding between unknown.selected. and unknown.selected.:
The endpoint of the binding does not exist

And [Debug]  [List Variables] shows two objects remain in the movie.
Variable _global.mx = [Object #1, Class 'Object'] {
Variable _level0.__junk = [Object #26, Class 'Binding'] {

Of course, the errors do not occur if the [Bindings] settings are
cleared before step #8.  But if it has been done, how the settings can
be cleared?

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

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

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


Re: [Flashcoders] questions about [embed] in AS3

2007-01-21 Thread Fumio Nonaka
[Embed] metadata tag is a Flex's functionality.  To embed assets use 
[Library] in Flash.


•Embedded asset classes
Flex:http://livedocs.macromedia.com/flex/2/docs/1844.html
Flash:http://livedocs.macromedia.com/labs/as3preview/docs/0054.html
_
[EMAIL PROTECTED] wrote:

  i think [Embed] is a flex thing. i'm not sure on this. anyone else who can 
comment?
  
  the square brackets indicate compiler directive metadata. i think the flash compiler just ignores [Embed]


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

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

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


Re: [Flashcoders] A v2 Window with a Checkbox and a Button

2007-01-17 Thread Fumio Nonaka

Hi Muzak,

Shouldn't the EventDispatcher.initialize() apply to the prototype of a 
class?

_

The checkbox and button aren't ready (initialized) by the time the Window 
complete event is triggered.

To found out when the Settings movieclip is ready, attach a class to the movieclip (call it Settings), which extends the MovieClip 
class.

Define an onLoad method and dispatch an event.

import mx.events.EventDispatcher;
class Settings extends MovieClip {
   // private static var dispatcherInit = 
EventDispatcher.initialize(Object(Settings));
  private static var dispatcherInit = 
EventDispatcher.initialize(Settings.prototype);

 // EventDispatcher methods
 public var dispatchEvent:Function;
 public var addEventListener:Function;
 public var removeEventListener:Function;
 //=
 // CONSTRUCTOR
 //=
 function Settings() {
  trace(Settings ::: CONSTRUCTOR);
 }
 //=
 // PRIVATE METHODS
 //=
 private function onLoad() {
  trace(Settings ::: onLoad);
  this.dispatchEvent({type:ready});
 }
}


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

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

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


Re: [Flashcoders] Is UIEventDispatcher class functioning?

2007-01-06 Thread Fumio Nonaka
Thank you for your suggestion, Brian.  mx.events.LowLevelEvents was the 
key point.


Once the LowLevelEvents class is accessed, mix-in will be accomplished. 
 That is, UIEventDispatcher.initialize() is called and mouse events are 
implemented.


mx.events.LowLevelEvents;  // *just access the class
import mx.managers.DepthManager;
import mx.controls.Button;
var myButton:Button = Button(this.createClassChildAtDepth(Button, 
DepthManager.kTop));

myButton.label = Button;
myButton.move(10, 10);
var listenerObject:Object = new Object();
listenerObject.mouseOver = function(eventObject:Object):Void  {
trace(eventObject.target);
};
myButton.addEventListener(mouseOver, listenerObject);

ASO files are properly overwritten because their time stamps are newer. 
 And I keep the classes in the First Run.  Therefore I just remove 
modified classes for testing and restart Flash to restore the original ones.

_
Brian Williams wrote:

Look at mx.events.LowLevelEvents.as

The way it works, as soon as you add an eventlistener for one of the low
level events, it will replace onPress, onRelease, etc with new methods that
dispatch an event.

Code that's in your configuration folder is only looked at once when
starting flash, so if you add a trace statement in
mx.events.UIEventDispatcher, you may need to clear your aso cache and/or
restart Flash to see the change.

If you're modifying any of those classes (even for testing purposes), it's
better to make a copy of the tree and put it higher in your class path, so
that flash will check it again if you make changes.

I remember reading a couple of blog posts about lowlevel events, so I would
try googling for mx v2 lowlevelevents


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

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

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


[Flashcoders] Is UIEventDispatcher class functioning?

2007-01-05 Thread Fumio Nonaka
Is the UIEventDispatcher class functioning?

[1] According to Flash 8 Component Language Reference, the
UIEventDispatcher class is mixed in to the UIComponent class.  But the
main method, UIEventDispatcher.initialize(), does not seem to be called
as I inserted a trace() statement in the method to make sure.
http://livedocs.macromedia.com/flash/8/main/4178.html

[2] The UIComponent class has several mouse events.  However it does not
have statements to dispatch mouse events.  It only has load/unload and
key events.

While I searched about this issue by Google, no useful information could
be found.  I wonder if few people use this class.

Any suggestions and comments would be very appreciated.

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

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

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


Re: [Flashcoders] Object registerClass

2006-11-17 Thread Fumio Nonaka
You do not have to import the class nor declare any variables with its 
type.  But just access it.

_
el oskitar wrote:

I solved the problem, I need to import the class and force a new variable
with this type before the new object declaration,
So, Object.registerClass is not necessary anymore



  // import lib.buttons.test;
  // var force:test
  lib.buttons.test;

var clase = test;
var ap = new (lib.buttons[clase]);//works!
var ap = new lib.buttons[clase]();//works!


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

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

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


Re: [Flashcoders] Boolean question

2006-10-20 Thread Fumio Nonaka
Because a Boolean instance is evaluated as an object.  Boolean(object) 
should return true.


var myBool:Boolean = new Boolean(false);
var myObject:Object = new Object();
trace([myBool, Boolean(myBool), !myBool, typeof myBool]);
// Output: false,true,false,object
trace([myObject, Boolean(myObject), !myObject, typeof myObject]);
// Output: [object Object],true,false,object
_
David Buff wrote:
I think it's because q.zoomed = false create a memory space where the 
boolean value flase is stored, and q.zoomed is a pointer witch point 
to this memory space.
New Boolean(false) create also a memory space and a pointer, but with 
w.zoomed = new Boolean(false) , w.zoomed point to the pointer of the 
value and don't point to the value. So you can do !Boolean but not 
!Pointer(of boolean)...


w = new Object();
w.zoomed = new Boolean(false);
trace (w.zoomed);
//false
w.zoomed = !(w.zoomed);
trace (w.zoomed);
//false

test = !(w.zoomed);
trace(test);


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

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

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


Re: [Flashcoders] Find item in array

2006-09-19 Thread Fumio Nonaka
Unlike to evaluation of a condition, the initial value should be 
evaluated only once anyway.


for (var i = initialValue(); icondition(); i++) {}
function initialValue() {
trace(initial value is evaluated);
return 0;
}
function condition() {
trace(condition is evaluated);
return 3;
}
// [Output]:
initial value is evaluated
condition is evaluated
condition is evaluated
condition is evaluated
condition is evaluated
_
Mike Mountain wrote:

var l =  myArray.length;
for (var i = l; --i -(-1); ) {}

Then you're not looking up the length on every iteration..

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

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

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


Re: [Flashcoders] AS3: Objects never get deleted

2006-09-12 Thread Fumio Nonaka
The useWeakReference parameter of EventDispatcher.addEventListener() 
does not seem to work.  Also, the method has a bug, which is that the 
event listner function cannot be deleted with the parameter set to true.


Flash 9 ActionScript 3.0 Preview:
Does useWeakReference parameter of addEventListener() method work?
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72catid=612threadid=1186643enterthread=y
_
Meinte van't Kruis wrote:

I am using weak references for the listener, here's the code (within
GCTarget):

   this.addEventListener(Event.ENTER_FRAME,onFrame,false,0,true);
   }
   private function onFrame(e:Event):void{
   trace(A);
   }

So I don't think that's it, else it wouldn't really matter if I pass
arguments or set variables
or not , because if I don't it does get deleted properly.


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

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

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


[Flashcoders] [AS3] Does useWeakReference parameter of addEventListener() work?

2006-08-24 Thread Fumio Nonaka
Does the useWeakReference parameter of
EventDispatcher.addEventListener() method in ActionScript 3.0 work?  I
referred the following documents:

ActionScript 3.0 Language Reference
http://livedocs.macromedia.com/labs/as3preview/langref/flash/events/EventDispatcher.html#addEventListener()
AS3: Weakly Referenced Listeners
http://www.gskinner.com/blog/archives/2006/07/as3_weakly_refe.html

Then tried the script as follows:

// frame action
import flash.events.Event;
addEventListener(EVENT.ENTER_FRAME,
function (eventObject:Event):void {
trace(eventObject);;
},
false, 0, true);  // sets useWeakReference to true

But the anonymous listener function does not seems to be garbage
collected.  And it continues to be called on every enterFrame event.  I
am using Flash Professional 9 ActionScript 3.0 Preview.

How the useWeakReference parameter works?  Any suggestion and advice
would be very appreciated.

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

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

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


Re: [Flashcoders] [AS3] Does useWeakReference parameter of addEventListener() work?

2006-08-24 Thread Fumio Nonaka

Sorry, one typo:

Fumio Nonaka wrote:
 // frame action
 import flash.events.Event;
  // addEventListener(EVENT.ENTER_FRAME,
  addEventListener(Event.ENTER_FRAME,

function (eventObject:Event):void {
trace(eventObject);;
},
false, 0, true);  // sets useWeakReference to true

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

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

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


Re: [Flashcoders] Misreporting instanceof operator.

2006-08-24 Thread Fumio Nonaka

Ian, did you set System.security.allowDomain() from both side to the other?

In some case, for example to MovieClip.setMask() to a MovieClip loaded 
from other domain, System.security.allowDomain() should be set not only 
from other domain to the domain to which the swf is loaded but also from 
the loading swf to the other.

_
Ian Thomas wrote:

My initial thought is it must be a cross-domain scripting issue - i.e.
the app wouldn't let you check the instanceof because of a domain
scripting policy (see
http://www.adobe.com/devnet/flash/articles/fplayer_security_04.html).

But I've tested it with System.security.allowDomain() and checked
scripting between the two movies, and even when cross-domain scripting
works perfectly (no sandbox violations) the instanceof still returns
false. (I'm not 100% sure whether I've got the System.security
settings right - but I can read vars in the loaded movies and vice
versa, so that sounds pretty correct to me.)

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

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

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


[Flashcoders] NumericStepper.checkValidValue() method

2006-08-20 Thread Fumio Nonaka
The NumericStepper component in Flash 8 seems to have a problem. Where
minimum = 1, maximum = 10, stepSize = 2, value = 1, the second value on
clicking the up arrow is 2. Then it is changing to 4  6  8  10.  What
I expect is 1  3  5  7  9  10.

Therefore, I modified NumericStepper.checkValidValue() method as
follows.  To test the script just place the NumericStepper component
into the [Library] without anything on the stage.

Any comments and suggestions for this modification would be very
appreciated.

// dynamically placing a NumericStepper instance
import mx.managers.DepthManager;
import mx.controls.NumericStepper;
var myNumericStepper:NumericStepper =
this.createClassChildAtDepth(NumericStepper, DepthManager.kTop);
// initializing
myNumericStepper.move(10, 10);
myNumericStepper.minimum = 1;
myNumericStepper.maximum = 10;
myNumericStepper.stepSize = 2;
myNumericStepper.value = myNumericStepper.minimum;
// modifying NumericStepper.checkValidValue() method
NumericStepper.prototype.checkValidValue = function(val:Number):Number  {
// var initDiv:Number = val/this.stepSize;
// var roundD:Number = Math.floor(initDiv);
var stepS:Number = this.stepSize;
var minVal:Number = this.minimum;
var maxVal:Number = this.maximum;
var initDiv:Number = (val-minVal)/this.stepSize+minVal;
var roundD:Number = Math.floor(initDiv-minVal)+minVal;
// if (valminVal and valmaxVal) {
if (valminVal  valmaxVal) {
if (initDiv-roundD == 0) {
return val;
} else {
// var tmpV:Number = Math.floor(val/stepS);
var tmpV:Number = Math.floor((val-minVal)/stepS);
var stepDownV:Number = tmpV*stepS+minVal;
if ((val-stepDownV=stepS/2  maxVal=stepDownV+stepS 

minVal=stepDownV-stepS) || (val+stepS == maxVal 
maxVal-stepDownV-stepS0.01)) {
stepDownV += stepS;
}
return stepDownV;
}
} else {
if (val=maxVal) {
return maxVal;
} else {
return minVal;
}
}
};

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

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

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


[Flashcoders] How to declare an instance in a MovieClip in a AS3 class

2006-07-28 Thread Fumio Nonaka
In a ActionScript 3.0 class how is an instance placed in a MovieClip
symbol with which the class is associated declared?

In ActionScript 2.0 an instance can be simply declared with 'var'.

// ActionScript 2.0 class definition: ButtonTest.as
// This is associated with a MovieClip symbol
class ButtonTest extends MovieClip {
// my_btn is placed in the MovieClip symbol
var my_btn:Button;

However, ActionScript 3.0 yields a compile error to the class definition
below.

// ActionScript 3.0 class definition: ButtonTest.as
// This is associated with a MovieClip symbol
package {
import flash.display.MovieClip;
import flash.display.Button;
public class ButtonTest extends MovieClip {
var my_btn:Button;  // Compile error

Any advices or suggestions would be very appreciated.

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

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

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


Re: [Flashcoders] How to declare an instance in a MovieClip in a AS3 class

2006-07-28 Thread Fumio Nonaka

I am sorry for invalid data typing.
_
Fumio Nonaka wrote:

However, ActionScript 3.0 yields a compile error to the class definition
below.

// ActionScript 3.0 class definition: ButtonTest.as
// This is associated with a MovieClip symbol
package {
import flash.display.MovieClip;

// import flash.display.Button;
import flash.display.SimpleButton;

public class ButtonTest extends MovieClip {

// var my_btn:Button;  // Compile error
var my_btn:SimpleButton;  // Compile error


Any advices or suggestions would be very appreciated.

Thank you,


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

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

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


Re: [Flashcoders] import statement and accessing a class in AS3

2006-07-15 Thread Fumio Nonaka

Thank you, Geoffrey.

I referred the ActionScript 3.0 Language Reference and understood the
difference of 'import' directive between 3.0 and 2.0.

Also, I saw Adobe Flash 9 Public Alpha/Configration/ActionScript 
3.0/implicitImports.xml, in which classes are defined to be imported 
implicitly into Flash IDE.  The following packages are imported:


 implicitImport name = adobe.utils.*/
 implicitImport name = flash.accessibility.*/
 implicitImport name = flash.display.*/
 implicitImport name = flash.errors.*/
 implicitImport name = flash.events.*/
 implicitImport name = flash.external.*/
 implicitImport name = flash.filters.*/
 implicitImport name = flash.geom.*/
 implicitImport name = flash.media.*/
 implicitImport name = flash.net.*/
 implicitImport name = flash.printing.*/
 implicitImport name = flash.system.*/
 implicitImport name = flash.text.*/
 implicitImport name = flash.ui.*/
 implicitImport name = flash.utils.*/
 implicitImport name = flash.xml.*/
_
Geoffrey Williams wrote:

You must always import your classes in external AS files.

In Flash, the flash.* sub packages are automatically imported.


Thank you,

Fumio Nonaka
Phone: +81-42-397-9452
Fax: +81-42-397-9452
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/

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

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


[Flashcoders] import statement and accessing a class in AS3

2006-07-14 Thread Fumio Nonaka
In ActionScript 3.0, a class can be accessed just by the name of the
class without the import statement in a timeline.

// timeline: _level0
// frame action (ActionScript 3.0)
// import flash.display.MovieClip;
trace(MovieClip);  // output: [class MovieClip]

On the other hand, a class cannot be accessed by its fully qualified
class name in a class definition.

// ActionScript 3.0 class definition file: Test.as
package {
// import flash.display.MovieClip
public class Test {
function Test() {
trace(flash.display.MovieClip);  // ReferenceError
}
}
}

Are the behaviors above the specification of ActionScript 3.0?

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

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

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


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

2006-05-25 Thread Fumio Nonaka

It is a very interesting find, Derek.  I haven't noticed that.
_
Derek Vadneau wrote:
Now the docs say that import by itself doesn't include the classes, but I 
used this code:


import mx.controls.Button;
import mx.controls.List;
import mx.controls.Tree;
import mx.controls.DataGrid;
import mx.containers.Accordion;

trace(_global['mx']['controls']['Button']);


I played with it a little. (Flash 8.0/Mac OS X.4.6)

import mx.controls.Button;
import mx.controls.List;
// import mx.controls.Tree;
// import mx.controls.DataGrid;
// import mx.containers.Accordion;

trace(_global['mx']['core']['UIObject']);  // Output: [type Function]
trace(_global['mx']['controls']['Button']);  // Output: undefined
trace(_global['mx']['controls']['List']);  // Output: undefined

// import mx.controls.Button;
import mx.controls.List;
import mx.controls.Tree;
// import mx.controls.DataGrid;
// import mx.containers.Accordion;

trace(_global['mx']['core']['UIObject']);  // Output: [type Function]
trace(_global['mx']['controls']['List']);  // Output: [type Function]
trace(_global['mx']['controls']['Tree']);  // Output: undefined

// import mx.controls.Button;
import mx.controls.List;
// import mx.controls.Tree;
import mx.controls.DataGrid;
// import mx.containers.Accordion;

trace(_global['mx']['core']['UIObject']);  // Output: [type Function]
trace(_global['mx']['controls']['List']);  // Output: [type Function]
trace(_global['mx']['controls']['DataGrid']);  // Output: [type Function]

// import mx.controls.Button;
// import mx.controls.List;
// import mx.controls.Tree;
// import mx.controls.DataGrid;
import mx.containers.Accordion;

trace(_global['mx']['core']['UIObject']);  // Output: [type Function]
trace(_global['mx']['controls']['Button']);  // Output: [type Function]
trace(_global['mx']['containers']['Accordion']);  // Output: undefined

Good luck,

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

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

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


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

2006-05-25 Thread Fumio Nonaka
I nailed down this issue.  If a class is imported in the timeline, its 
super class will be embedded.


// Class definitions:
class Test extends Super {}
class Super {}

// Timeline: _root
import Test;
// Test;
trace(_global['Super']);  // Output: [type Function]
trace(_global['Test']);  // Output: undefined

Good luck,

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

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

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


Re: [Flashcoders] \r

2006-05-16 Thread Fumio Nonaka
Interesting.  How about the following statements, which don't include 
any empty strings:


// Frame action in the main timeline
var my0_str:String = newline;
my0_str += newline;
var my1_str:String = newline+newline;

// [Debug]  [List Variables]:
Variable _level0.my0_str = \n\n
Variable _level0.my1_str = \r\r

Flash 8.0/Mac OS X.4.6
_
ryanm wrote:
   Well, it seems inconsistant, but it's not really unexpected. Without 
the empty string both hard returns are appended to the end of the 
previous line, which isn't technically correct, but makes sense in 
context. With the empty string there is an empty line (your new line), 
so a line feed is used to go to the next line. Hard return ends a span 
of text by breaking to the next line. Line feed passes over an empty 
line without moving the cursor, which is why a hard return (a.k.a. a 
carriage return) is needed at the end of a span of text. It's 
old-school logic based on how it would render on paper. If you used a 
line feed without a carriage return, the proper way to render it would 
be to move down one line without moving to the first column. Without the 
empty string, though, there is no new line to pass over, so the html 
kluge is to simply hard return again.


Good luck,

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

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

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


Re: [Flashcoders] \r

2006-05-15 Thread Fumio Nonaka
Even if you manipulate newline only with string, you might get annoying 
result:


// Frame action
var my_str:String = newline;
my_str += +newline;

// [Debug]  [List Variables]:
Variable _level0.my_str = ¥n¥r

Tested on Flash 8.0/Mac OS X.4.6  Windows XP (SP1)
_
Derek Vadneau wrote:
The bugger is using \n or newline in a string and setting the text of a 
textfield to that string converts \n to \r when you read the text again. 
It's why I never use \n or newline.


Good luck,

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

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

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


Re: [Flashcoders] \r

2006-05-15 Thread Fumio Nonaka

Remove an empty string  from the second statement.  Is it also expected?
_
ryanm wrote:

// Frame action
var my_str:String = newline;

   // my_str += +newline;
   my_str += newline;


// [Debug]  [List Variables]:

   Variable _level0.my_str = \n\n

   That's expected. One line break is a hard return, two of them is 
not two hard returns, it is a hard return and a line feed.


Good luck,

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

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

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


Re: [Flashcoders] createClassObject with List Class funky

2006-04-27 Thread Fumio Nonaka
mx.core.ext.UIObjectExtensions class, which is initialized in the 
UIComponent symbol, do that.

_
Jim Armstrong wrote:
If memory serves, MovieClip is a dynamic class and createClassObject() 
is added to the MovieClip prototype by the V2 framework at runtime.


class mx.core.ext.UIObjectExtensions
{
// ...[snip]...

static function Extensions():Boolean
{
// ...[snip]...
var ui:Object = UIObject.prototype;
// ...[snip]...
var mc:Object = MovieClip.prototype;
// ...[snip]...
mc.createObject = ui.createObject;
mc.createClassObject = ui.createClassObject;
mc.createEmptyObject = ui.createEmptyObject;
mc.destroyObject = ui.destroyObject;

// ...[snip]...
static var UIObjectExtended = Extensions();

Good luck,

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

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

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


Re: [Flashcoders] Howto randomize the elements of an array?

2006-04-18 Thread Fumio Nonaka

See:
[Flashcoders] Array.shuffle
http://chattyfig.figleaf.com/pipermail/flashcoders/2002-August/043766.html
_
Danny Kodicek wrote:

The basic randomisation algorithm is:

take a new array
for each element in the old array: add it at a random position in the 
new array


It's not really rocket science, but it should do the job perfectly well 
for your purposes.


Good luck,

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

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

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


Re: [Flashcoders] RE:Flashcoders] Extending Array Question

2006-04-18 Thread Fumio Nonaka

Another solution:

// ActionScript 2.0 Class Definition: com/ArrayExtension.as
dynamic class com.ArrayExtension extends Array {
function ArrayExtension() {
if (arguments.length == 1  !isNaN(arguments[0])) {
this.length = arguments[0];
} else {
this.push.apply(this, arguments);
}
}
}

// fla for Testing
// Frame Action
import com.ArrayExtension;
var arEx0:ArrayExtension = new ArrayExtension(one, two, three);
trace([arEx0.length, arEx0]);  // Output: 3,one,two,three
var arEx1:ArrayExtension = new ArrayExtension(3);
trace([arEx1.length, arEx1]);  // Output: 3,undefined,undefined,undefined

// [Debug]  [List Variables]:
Variable _level0.arEx0 = [Object #3] [
0:one,
1:two,
2:three
  ]
Variable _level0.arEx1 = [Object #4] []
_
Mike Britton wrote:

class com.ArrayExtension extends Array
{

   public function ArrayExtension()
   {
   super()
var argString = arguments[0].split(,);

   for(var i=0; i argString.length; i++)
   push(argString[i]);

   }

}

Usage:

var arEx = new ArrayExtension(one,two,three);
trace(arEx.length);


Good luck,

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

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

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


[Flashcoders] Variable containing a String instance crash Flash 8 on [List Variables]

2006-04-04 Thread Fumio Nonaka
If a variable containing a String instance exists, [List Variables]
causes to crash Flash 8.

[1] Write the following frame action:
_str = new String();
[2] [Test Movie]
[3] From the [Debug] menu, chose [List Variables]
[Result] Flash 8 will crash.

The crash is reproduced in Flash 8.0/Mac OS X.4.5 and Windows XP (SP1).

Regards,

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

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

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


Re: [Flashcoders] crosspost: update your flash-players immediately

2006-03-16 Thread Fumio Nonaka

I got the url from the following post:

[Flashcoders] updating the ide-players
http://chattyfig.figleaf.com/pipermail/flashcoders/2006-March/162063.html
_
Fumio Nonaka wrote:
Have the players 8.0r24 for developers including debug version and 
SAFlashPlayer been available, too?


Thanks,

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

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

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


Re: [Flashcoders] updating the ide-players

2006-03-16 Thread Fumio Nonaka

Thank you very much, micha.  I have been looking for the url. :)
_
Michael Stuhr wrote:

http://www.macromedia.com/support/flashplayer/downloads.html

~30MB wtf ? :-)


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

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

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


Re: [Flashcoders] updating the ide-players

2006-03-16 Thread Fumio Nonaka
I installed the players on Flash 8/Mac OS X.  While the plug-ins and the 
standalone players seem to be updated, getVersion() in the test movie 
returns 8,0,22,0, which is not new version of 8.0r24.


Could any Mac users successfully update the Test Movie Player?
_
Michael Stuhr wrote:

http://www.macromedia.com/support/flashplayer/downloads.html

~30MB wtf ? :-)


Thanks in advance,

Fumio Nonaka
Phone: +81-42-397-9452
Fax: +81-42-397-9452
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/

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

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


Re: [Flashcoders] updating the ide-players

2006-03-16 Thread Fumio Nonaka

Thank you for your comments, micha and Isaac.

I ran the uninstaller before installed the players. And all the players 
in the players folder in Flash 8 seem to be updated to 8.0r24.


But only in the Test Movie, [List variables], getVersion() and 
System.capabilities.version return 8,0,22,0. I got the same result in 
Flash 8/Winsows XP (SP1).

_
Isaac Rivera wrote:
In any case, the stand alones and the internet plug in are all  updated. 
Getting info on them confrims that they are version 8.0 r24.  Running 
them outside the authoring environment also shows the correct  version.


BUT ON THE FLASH AUTHORING ENVIRONMENT

trace(getVersion()) // 8,0,22,0  !!!



On Mar 16, 2006, at 12:20 PM, Michael Stuhr wrote:


Fumio Nonaka schrieb:

I installed the players on Flash 8/Mac OS X.  While the plug-ins  and 
the standalone players seem to be updated, getVersion() in the  test 
movie returns 8,0,22,0, which is not new version of 8.0r24.

Could any Mac users successfully update the Test Movie Player?
_



have you uninstalled all players ?


Thanks,

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

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

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


Re: [Flashcoders] crosspost: update your flash-players immediately

2006-03-15 Thread Fumio Nonaka
Have the players 8.0r24 for developers including debug version and 
SAFlashPlayer been available, too?


Regards,

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

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

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


Re: [Flashcoders] Flash Player bug?

2006-02-20 Thread Fumio Nonaka
According to the ECMA-262 (11.8 and 11.9), all the statements below 
should return false.  And so does JavaScript in Netscape.  Therefore, I 
think this is a bug.

_
Tuomas Glad wrote:
 I was wondering how this is possible?

 var test:Number = undefined;
 trace(test = 0); // true
 trace(test == 0); // false
 trace(test  0); // undefined

Good luck,

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

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

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


Re: [Flashcoders] Q:getter setters vs accessor methods

2006-02-08 Thread Fumio Nonaka
Right.  And in simple assignment, getter's returned value is returned as 
the assignment formula's value.  According to ECMA-262 (11.13.1), the 
formula's value should be its lefthand expression.


var _mc:MovieClip = this.createEmptyMovieClip(my_mc, 1);
var a:Number = _mc._rotation=270;
trace([a, _mc._rotation]);  // Output: 270,-90 // Good
var o:MyRotation = new MyRotation();
var b:Number = o.rotation=-90;
trace([b, o.rotation]);  // Output: 270,270 // Bad

// ActionScript 2.0 class definition for Testing
class MyRotation {
var _rotation:Number = 0;
// gets the value between 0 and 360
function get rotation():Number {
trace([get, _rotation]);
return (_rotation%360+360)%360;
}
// sets the value between -180 and 180
function set rotation(n:Number):Void {
_rotation = (n%360+540)%360-180;
trace([set, _rotation]);
}
}
_
JesterXL wrote:

Setters call the getters automatically.


Good luck,

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

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


Re: [Flashcoders] Q:getter setters vs accessor methods

2006-02-08 Thread Fumio Nonaka
Sorry.  The formula's value should be its assignment expression, i.e. 
righthand side expression.

_
Fumio Nonaka wrote:
Right.  And in simple assignment, getter's returned value is returned as 
the assignment formula's value.  According to ECMA-262 (11.13.1), the 
formula's value should be its lefthand expression.


Good luck,

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

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


[Flashcoders] Loading multiple swfs simultaneously with MovieClipLoader.loadClip()

2006-02-05 Thread Fumio Nonaka
Is it no problem to load multiple SWFs simultaneously with
MovieClipLoader.loadClip() method?  I saw a sample fla, [Flash 8
Application]/Samples and
Tutorials/Samples/ActionScript/Galleries/gallery_tween.fla, which calls
MovieClipLoader.loadClip() method multiple times in for loop as follows:

/* create a function which loops through the images in an array,
   and creates new movie clips on the Stage. */
function displayGallery(gallery_array:Array) {
var galleryLength:Number = gallery_array.length;
// loop through each of the images in the gallery_array.
for (var i = 0; igalleryLength; i++) {
/* create a movie clip instance which holds the image. We'll 
also set
a variable,
   thisMC, which is an alias to the movie clip instance. */
var thisMC:MovieClip = 
this.createEmptyMovieClip(image+i+_mc, i);

/* load the current image source into the new movie clip 
instance,
   using the MovieClipLoader class. */
mcLoader_mcl.loadClip(gallery_array[i].src, thisMC);

I uploaded the sample to my server and it loads JPEG files without
problem.  But I wonder if it works with narrow band as well.  Does the
MovieClipLoader class manage multiple request to load files from a
server at the same time?  Or, is it better practice to load one file
each after the prior file is completed?

Regards,

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

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


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

2006-02-02 Thread Fumio Nonaka
function xDrawCircle(target_mc:MovieClip, nX:Number, nY:Number, 
nR:Number, nSegments:Number):Void {

if (nSegments == undefined) {
nSegments = 8;
}
var nAngle:Number = 2*Math.PI/nSegments;
target_mc.moveTo(nX+nR, nY);
for (var i = 1; i=nSegments; ++i) {
var nTheta:Number = i*nAngle;
var nAnchorX:Number = nR*Math.cos(nTheta);
var nAnchorY:Number = nR*Math.sin(nTheta);
		var nControlX:Number = 
nAnchorX+nR*Math.tan(nAngle/2)*Math.cos(nTheta-Math.PI/2);
		var nControlY:Number = 
nAnchorY+nR*Math.tan(nAngle/2)*Math.sin(nTheta-Math.PI/2);

target_mc.curveTo(nControlX+nX, nControlY+nY, nAnchorX+nX, 
nAnchorY+nY);
}
}
// Test
var _mc:MovieClip = this.createEmptyMovieClip(target_mc, 1);
_mc.beginFill(0x00);
_mc.lineStyle(2, 0xFF);
xDrawCircle(_mc, Stage.width/2, Stage.height/2, 100, 8);
_mc.endFill();
_
Ian Thomas wrote:

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


Good luck,

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

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


Re: [Flashcoders] Text not showing up in Flash Player 7 with Flash 8SWF

2006-01-12 Thread Fumio Nonaka
Static text published for Flash Player 8 does not appear on Flash 
Player 7(Flash TechNote)

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=144b4be2
_
Howard Nager wrote:
Are you trying to publish a somewhat backwards compatible flash movie? All the bells and whistles when viewed in f8 but stilla cceptable in f7? I ran in to the same issue when trying to do the same. The swf runs fine in the 7 player but the text doesnt show. 


Good luck,

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

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


[Flashcoders] What does the newline constant insert?

2006-01-08 Thread Fumio Nonaka
According to ActionScript 2.0 Language Reference the newline constant
Inserts a carriage return character (\r).  But it should return a
newline character (\n).

var my_str:String = newline;
// [Debug]  [List Variables]:
Variable _level0.my_str = \n

However the return value is changed depending on a value which is added
to the constant with + operator.  This is very odd.  My environment is
Flash 8/Mac OS X.4.3.

var empty_str = ;
var my0_str = newline;
var my1_str = +newline;
var my2_str = empty_str+newline;
var my3_str = +newline+empty_str;
var my4_str = empty_str+newline+;
var my5_str = 0+newline;
var my6_str = String(0)+newline;
var my7_str = true+newline;
var my8_str = undefined+newline;
var my9_str = NaN+newline;
// [Debug]  [List Variables]:
Variable _level0.my0_str = \n
Variable _level0.my1_str = \r
Variable _level0.my2_str = \n
Variable _level0.my3_str = \r
Variable _level0.my4_str = \n
Variable _level0.my5_str = 0\r
Variable _level0.my6_str = 0\n
Variable _level0.my7_str = true\r
Variable _level0.my8_str = undefined\n
Variable _level0.my9_str = NaN\n

Regards,

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

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


Re: [Flashcoders] No Key.isDown() method in AS3?

2005-12-28 Thread Fumio Nonaka
Adding true to an array at the index of the keycode instead of adding 
the code to it might be better on looking through the array.  Because 
you do not have to use for loop.


Adding:
pressedKeys_array[Key.getCode()] = true;

Looking:
bIsDown = pressedKeys_array[Key.getCode()]
_
Newsdee wrote:

I can see a workaround though:

It would be not too hard to write a class that listesn to the keyboard, and
when an onKeyDown event is triggered, it reads the key and adds the keycode
to an array.

The keycode is then removed at an onKeyUp event. And the isDown method would
just have to look through the array.


Good luck,

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

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


Re: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Fumio Nonaka
Most of MovieClip's properties are initialized when an external file is 
loaded into it.  But some properties including _x, _y, _xscale, and 
_yscale will hold their value.  Of course if you would like to calculate 
its scales based on the external file's actual size, you should do it 
after it is fully loaded.

_
Ian Thomas wrote:

You need to do the resizing after the image has fully loaded. The trouble is
if you just set the _xscale and _yscale (for example) and then call
.loadMovie(), the 'new movie' (the image) replaces all the attributes of the
old movie and you lose your _xscale and _yscale values.


Good luck,

Fumio Nonaka
Phone: +81-42-397-9452
Fax: +81-42-397-9452
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/

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