[Flashcoders] Flash garbage collection

2007-06-28 Thread James Tu

How will Flash's garbage collection handle the following scenario?


function loadAsset(url:String) {

this.createEmptyMovieClip(image_mc, this.getNextHighestDepth());

this.onLoadInit = function(target_mc:MovieClip) {
trace(target_mc + ...loaded);
}

var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(this);;
mcl.loadClip(url);

}




loadAsset(foo.jpg);
loadAsset(bar.swf);
...

What happens to all the instances MovieClipLoader?


-James





___
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] class file updated, but .aso not updated?

2007-05-24 Thread James Tu
I'm having a problem that is not directly related to a previous  
thread on this list about ASO files.


Here's my inheritance heirarchy...

BaseClass - VisualBaseClass - ButtonMessagingBaseClass - CardBase - 
 CardSpecial



I'm on a Mac OSX 10.4.8 running Flash Professional v8.0.
I've updated CardBase, but the changes don't appear!  I've deleted  
ASO files and that didn't work.  I've deleted ASO files, quit Flash,  
restarted and that didn't work.


I also tried to add trace statements all the way up to the parent  
(BaseClass) and those trace statements don't appear.


The other curious bit is that I've checked Omit Trace Actions but  
the old trace statements in CardBase and the other onces all the way  
up to the parent (BaseClass) are still showing!!!



CardSpecial...the last one in the chain, behaves correctly...changes  
take effect, when I Omit Trace Action its traces are suppressed!



What's going on here?  Am I going crazy?  Is the Flash file corrupt?  
(Right now I'm going to try grabbing an older version and see how  
that behaves)


-James





___
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] class file updated, but .aso not updated?

2007-05-24 Thread James Tu

Figured it out:


I'm using runtime shared libraries.  These are automatically imported  
in frame 1.  The classes in my movie are not exported until frame 5!


So, the version of the compiled classes that I'm getting are from the  
rsl's !!!  We're using rsl's to share assets and not code, but one  
specific rsl it also compiles some of the classes.  So, now I'm going  
into that one and just extracting the assets that will be shared.


Whew.  I'm so happy that there was a logical explanation.

-James


On May 24, 2007, at 2:54 PM, James Tu wrote:

I'm having a problem that is not directly related to a previous  
thread on this list about ASO files.


Here's my inheritance heirarchy...

BaseClass - VisualBaseClass - ButtonMessagingBaseClass -  
CardBase - CardSpecial



I'm on a Mac OSX 10.4.8 running Flash Professional v8.0.
I've updated CardBase, but the changes don't appear!  I've deleted  
ASO files and that didn't work.  I've deleted ASO files, quit  
Flash, restarted and that didn't work.


I also tried to add trace statements all the way up to the parent  
(BaseClass) and those trace statements don't appear.


The other curious bit is that I've checked Omit Trace Actions but  
the old trace statements in CardBase and the other onces all the  
way up to the parent (BaseClass) are still showing!!!



CardSpecial...the last one in the chain, behaves  
correctly...changes take effect, when I Omit Trace Action its  
traces are suppressed!



What's going on here?  Am I going crazy?  Is the Flash file  
corrupt? (Right now I'm going to try grabbing an older version and  
see how that behaves)


-James





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

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




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

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


[Flashcoders] class member Array

2007-05-24 Thread James Tu

Has anyone encountered this before...

If you have a class variable that is of type Array...
DO NOT DO THIS:
private var ListOfThings:Array = new Array();


DO THIS:
private var ListOfThings:Array;
//then in your constructor, do this
ListOfThings = new Array();


If you do the former, Flash will create an Array that is SHARED  
between all instances of the class!!!  (i.e., it makes it STATIC)





I did the former:

//this is in the class declaration section
class Foo
{
private var _pressed_event_message:Array = new Array();


//other stuff omitted

function setPressedEventMessage ( m:String, p:Object ) {
_pressed_event_message.push( { msg:m, param:p} );
	trace(this._pressed_event_message.length:  +  
_pressed_event_message.length);

}

}


class FooExtender extends Foo {

}



When I create two FooExtender instances...and call the  
setPressedEventMessage() function, the trace increments as if there  
these both instances share the same array!!!

var a=new FooExtender();
var b=new FooExtender();


a.setPressedEventMessage( blah ); //traces   
this._pressed_event_message.length: 1
b.setPressedEventMessage( blah ); //traces   
this._pressed_event_message.length: 2
a.setPressedEventMessage( blah ); //traces   
this._pressed_event_message.length: 3
a.setPressedEventMessage( blah ); //traces   
this._pressed_event_message.length: 4
b.setPressedEventMessage( blah ); //traces   
this._pressed_event_message.length: 5
b.setPressedEventMessage( blah ); //traces   
this._pressed_event_message.length: 6






When I took the initialization out of the variable declaration  
section and just did this...

class Foo
{
private var _pressed_event_message:Array;

function Foo () {
_pressed_event_message = new Array();
}

}

All behaved as expected...


Was I not doing something correctly?
-James







___
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 and Arabic

2007-04-16 Thread James Tu

We tried the following:
(we're embedding fonts in all cases, also we don't have require any  
input fields...we're just displaying Arabic)


-Copied Arabic text into a static text field...flash actually  
reverses the characters.  So we copied reversed text a static field.   
Then when we published, it seems that the characters were not being  
displayed correctly.  An arabic reader took a look at it and told us  
that the arabic characters didn't connect to each other correctly!   
It's as if you took English script characters and broke them apart!


We then tried a few more experiments...
- copy and pasted Arabic text (normal order) into a dynamic  
field...flash flipped it.  But when you publish it for Player 8, the  
order of the text is correct, but the characters looked disjointed  
again.


-We published it for Player 7 and this time everything looked  
perfect.  The order of the text was correct and the characters looked  
connected!!!


We basically have all the text assets in a separate .swf (published  
for Player 7) and we're using it as a runtime shared library.  Our  
main app is published as Player 8.


Has anyone else seen this?  Am I not doing something right here? I'm  
shocked that support for Arabic (and I'm assuming other RTL  
languages) took a step backwards from Player 7 to Player 8.  I wonder  
what it is in Player 9.



-James


On Apr 16, 2007, at 7:10 AM, nik crosina wrote:


Thank you very much, Danny,


Yes I thought that this post sank without a trace, lucky you saw it!

Fro the moment I jsut needed to know if there were any issues, as I am
tendering for an English course DVD that will be sold in the Middle
East.

Do I remember seeing your name on Director forums a long time ago?


Nik Crosina


On 4/16/07, Danny Kodicek [EMAIL PROTECTED] wrote:

  HI,

 It now transpires that the project I am quoting for needs
 much of it done in Arabic. As it is my first multi language
 project in Flash are there any issues with that in Flash (I
 could write an encyclopedia full about Director and its
 characater set issues)

Just got back from holiday and noticed this post which doesn't  
seem to have

had any replies.

Arabic in Flash is possible but tricky. Exactly how tricky depends  
on what
exactly you need to do. Just putting static Arabic text on screen  
is easy -
no different from Roman. Dynamic text is essentially okay, but you  
need to
watch out for RTL and Bidirectional issues. One major issue is  
that Flash
behaves differently for embedded and non-embedded fonts. Text  
rendered using
non-embedded fonts uses the OS-level text renderer, and so renders  
the text
using the standard Bidirectional algorithm. For single-line text  
this is
perfect (although we didn't test for a very wide range of OS's and  
browsers

- I suspect there might be some niggles on various combinations); for
multiple-line text you'll find that line breaks do not get added  
correctly
(words get broken half-way across) so you'll need to add your line  
breaks
directly into the dynamic text. Text rendered using embedded fonts  
does not
render correctly: it has the same line-break issues as before, but  
also it
renders LTR and fails to correctly interpret the Arabic characters  
into

their cursive variants (that is, join them correctly to give the
'handwritten' style that Arabic text should have). There are ways  
around
this, including some code libraries (check out FlashRTL).  
Personally, I
prefer this option as you're in more control - I hate leaving  
things to the

OS unless I absolutely have to!

Of course, the above also depends on the *source* of your dynamic  
text: if

you're in complete control, you can store the text directly as the
characters that will appear on-screen. But if it's coming from  
something
like an external XML file or some other data source, you'll need  
to consider

these issues.

If you want input text, you're in a different kettle of  
crustaceans. We

managed to solve it, but it was a big job. There aren't currently any
available commercial solutions to this, but hopefully as soon as I'm
finished with my enormous globalisation job that's taken me the  
best part of

a year, we'll be releasing my solution in some form.

Danny

___
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




--
Nik C
___
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] Scaling Up an Image in Proportion to width or height

2007-04-16 Thread James Tu
I found some code online which I turned into a function...  This  
should give you the scale whether you are scaling up or down.  You  
tell it the area you want your mc to fit into and it will give you a  
number back...all you have to do is then use that number...example:  
mc._xscale = mc._yscale = number_returned_from_function.


Maybe this helps out a bit?

function fitToDimension( sourceWidth:Number, sourceHeight:Number,  
targetWidth:Number, targetHeight:Number ):Number {


if ( sourceWidth/targetWidth  sourceHeight/targetHeight ) {
//aspect ratio is determined by width
return (targetWidth*100/sourceWidth);
} else {
//aspect ratio is determined by height
return (targetHeight*100/sourceHeight);
}

}

-James



On Mar 28, 2007, at 10:28 AM, {reduxdj} wrote:

I know how to scale an image down... what's the formula for scaling  
up too?


For instance, i want my images to be in proportion and at least 500  
pixels wide.


Thanks,
Patrick

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

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




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

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


Re: [Flashcoders] Flash and levels

2007-03-28 Thread James Tu
I just tried it and it didn't work.  I don't think that the syntax  
works.

var tmc = this.createEmptyMovieClip(testing, 20);
trace(tmc); //traces _level0.testing

It creates an empty movie clip on depth 20 not _level20.

-James

On Mar 27, 2007, at 7:30 PM, Omar Fouad wrote:


If you need to create a movieClip on level 20 for example :
var myClip:MovieClip = createEmtpyMovieClip(myClipInstance, 20)
Note that the secont parameter (20), is the level number you wish the
movieClip is created, in this case therefore will not get into  
_level0..


if you Need to get a movieClip nasted into another so:

var myClip:MovieClip = containerClip.createEmptyMovieClip 
(otherMcInstance,

containerClip.getNextHighestDepth);

The second Parameter specifies the next Free Level inside the  
containerClip

where the myClip will be nasted...

Hope it helps


On 3/28/07, James Tu [EMAIL PROTECTED] wrote:


Is there a way to createEmptyMovieClip on a level other than _level0?

I tried doing this:
var tmc = _level5.createEmptyMovieClip(foo, 10);
trace(tmc);  //gives me undefined

I also tried to load a blank .swf into _level5 and then creating a
movieclip on _level5 and that didn't work either.


-James

___
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





--
Omar Fouad - Digital Emotions...

Love is always patient and kind. It is never jealous. Love is never  
boastful
nor conceited It is never rude or selfish. It does not take offense  
and is
not resentful. Love takes no pleasure in other people's sins...but  
delights
in the truth. It is always ready to excuse, to trust, to hope...  
and to

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

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




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

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


Re: [Flashcoders] Flash and levels

2007-03-28 Thread James Tu
OK.  Thanks for everyone's input!  I usually do use movieclips to  
nest elemets.  A lot of times I'll have each UI screen be  
encapsulated in it's own MC so that I can easily do transitions for  
the entire screen if needed.  I started down the road with _level's  
again b/c of an article that I was reading regarding the use of  
dynamic shared libraries.  It suggested that I preload dynamic shared  
libraries into levels before I load movies that I use them...so that  
the dsl's are cached...and when I load the movies that use them Flash  
won't reload the dsl's.


If I load the dsl's into movieclips instead, flash should still be  
caching them right? If I load a movie that uses them into another  
movieclip flash should not reload the dynamic shared libraries right?





On Mar 27, 2007, at 8:18 PM, Joshua Sera wrote:


Levels suck, try to avoid them.

Anyway, I did this, and it worked:

stop();
loadMovieNum(blank.swf, 5);
this.onEnterFrame = function() {
if (_level5 != undefined) {
if (_level5.getBytesTotal() ==
_level5.getBytesTotal()) {
var tmp = _level5.createEmptyMovieClip(foo, 10);
trace(tmp);
delete this.onEnterFrame;
}
}
}

My guess is that you're trying to create a clip on
level 5 before it's fully loaded, and so it's failing.



--- James Tu [EMAIL PROTECTED] wrote:


Is there a way to createEmptyMovieClip on a level
other than _level0?

I tried doing this:
var tmc = _level5.createEmptyMovieClip(foo, 10);
trace(tmc);  //gives me undefined

I also tried to load a blank .swf into _level5 and
then creating a
movieclip on _level5 and that didn't work either.


-James

___
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






__ 
__

Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food  Drink QA.
http://answers.yahoo.com/dir/?link=listsid=396545367
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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




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

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


[Flashcoders] Flash Player 7 and Flash Player 8,9 issues.

2007-03-27 Thread James Tu

We're working on a project that uses Arabic.

When we create Dynamic Text Fields and paste in Arabic text, it looks  
backwards in the authoring env, but when we publish for Player 7, the  
text reverses itself(correctly) and the glyphs look correct and  
neighboring glyphs connect to each other correctly.


However, when we publish for Player 8 or 9, the text also reverses  
itselft(correctly), BUT the glyphs look wrong.  The characters are  
totally separate from each other and not connected smoothly.


What happened between Flash Player 7 and Flash Player 8?

-James

___
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] Flash and levels

2007-03-27 Thread James Tu

Is there a way to createEmptyMovieClip on a level other than _level0?

I tried doing this:
var tmc = _level5.createEmptyMovieClip(foo, 10);
trace(tmc);  //gives me undefined

I also tried to load a blank .swf into _level5 and then creating a  
movieclip on _level5 and that didn't work either.



-James

___
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] flash and Arabic

2007-03-26 Thread James Tu
We have an approach to deal with a list of 100 phrases in Arabic.   
When you copy and paste a phrase of Arabic into a Flash textbox,  
Flash reverses it!  So, we first reversed the characters outside of  
Flash and then copied and pasted the phrases into Flash.  Problem  
solved right?


We'll, when someone that can read Arabic read it, they told us that  
the characters look funny.  In essence, the characters weren't  
connecting to each other correctly!  It's as if you took a cursive  
font and laid out the characters and the cursive writing was not  
continuous.


Does anyone have any suggestions on handling Flash and Arabic?  I did  
some extensive searching and there aren't any definitive  
solutions...Some suggested using a special Flash Arabic font, which I  
couldn't find.


Help!
-James

___
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