Re: [Flashcoders] accessing event dispatchers in a loosely-coupled, modular design

2010-02-23 Thread Allandt Bik-Elliott (Receptacle)
aside from the advice that i got on this message list, i found this  
article from adobe really useful

http://www.adobe.com/devnet/flex/articles/blueprint.html

might help here too

best
a



On 23 Feb 2010, at 17:19, Merrill, Jason wrote:

Sort of - but I wouldn't have the controller dispatch anything. I  
would

only have it listen to the view(s)  (your other classes with a visual
presence).  The controller first creates an instance of A (what
determines when that happens, I don't know because I don't know what  
A
or your app is all about).  When it does, it also creates listeners  
for

B, C, D if they are present in the view.  Controller also of
course has the handler that tells whatever else to do what it has to  
do

(now I'm just guessing because I don't know what you're ultimately
trying to accomplish).

If something needs to happen when something changes data-wise in the
model, then you would listen to the model which dispatches events and
have the controller respond, perhaps by telling the view to change.
IMO, the Controller is the most ambiguous part of the MVC pattern.  
View
and Model are pretty straightforward (esp. the Model). Different  
people

have different ways of using the controller, but this is how I use it.
It listens to other parts of your app, and then tells other parts of
your app to do something.  It's the central nervous system to use a
methaphor - at least how I use it.  AS3 Frameworks get more broken  
down
than that, using things like Command classes, Mediators, and Facades  
and

junk for even better OOP development and control, but there can be a
steep learning curve to most of those frameworks.

Jason Merrill

Bank of  America  Global Learning
Learning  Performance Solutions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Andrew
Sinning
Sent: Tuesday, February 23, 2010 12:05 PM
To: Flash Coders List
Subject: Re: [Flashcoders] accessing event dispatchers in a
loosely-coupled,modular design

In other words:

   Create a Controller class before creating any other classes.

   Any instances that need to know when potential event dispatchers  
are


created should listen to the Controller class.

   When dispatchers are created, the Controller class should dispatch
an event.

This way I won't need to use a Timer to repeatedly look for the
dispatchers.

Merrill, Jason wrote:
If an instance of those classes has been created, then it will eval  
to

true, otherwise it will be null, so this should work for that part of
the problem:

if(_myinstance) _myInstance.addEventListener(myEvent, myHandler);

However, if you're creating A after B, C, and D, then you'll
want to call the code above from say, a Controller class whenever A

is

created.  Once A is created, then that's a trigger to add the
listeners to the other classes if they exist.  Make sense?


Jason Merrill

Bank of  America  Global Learning
Learning  Performance Solutions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(inote: these are for Bank of America employees only)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of  
Andrew

Sinning
Sent: Tuesday, February 23, 2010 10:04 AM
To: Flash Coders List
Subject: [Flashcoders] accessing event dispatchers in a
loosely-coupled,modular design

Following the discussion about root yesterday, it got me thinking
about a constant problem I face.

Object-A needs to listen to events coming from objects B, C and D,  
but



only if and when these objects actually exist.  There's no guarantee
that any of the objects B, C and D will be instantiated before or

after
A is instantiated.  So, what's the proper way for A to add itself  
as a



listener to B, C and D?

What I'm currently do is this:

   The event dispatchers (B, C, D etc) implement a singleton

interface.


   Within the target (A), I set up a Timer event to repeatedly check
for instances of the dispatchers.  Once a dispatcher is found, the
target adds itself as a listener, and a pointer to the dispatcher is
created so that the target can later remove itself.


I'm not very happy with this design, but it's the best that I've been
able to come up with.

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




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] as3 to iphone app

2009-10-28 Thread Allandt Bik-Elliott (Receptacle)
don't swfs compiled from c run faster in the plugin than ones compiled  
in actionscript? i thought i read that


if so - the potential also exists here doesn't it?

a



On 9 Oct 2009, at 01:13, Eric E. Dolecki wrote:

Yes, it is an assumption not based on any fact. My opinion right now  
as I

believe I stated originally.
I saw what is supported and I know the vast ocean of iPhone APIs  
that are
available when developing natively. I won't assume that the level of  
control
Adobe will offer in the conversion compile can be nearly as good as  
when
compiling using Xcode. I could be wrong, but having people learn how  
to
drive in a simulator probably won't ever be as good as driving the  
real

thing. That's all. I hope Adobe proves me wrong. But I don't think
abandoning learning Obj-C is favor of AS3 is a good idea  
regardless... it's

great to know both or more.
Eric

On Thu, Oct 8, 2009 at 7:22 PM, Mike Chambers mcham...@adobe.com  
wrote:


I think that is a misguided statement, not based on any fact. Why  
do you
assume / suggest that using Flash will be inferior for building all  
types of

iPhone applications and content?

mike chambers

m...@adobe.com

On Oct 8, 2009, at 5:50 AM, Eric E. Dolecki wrote:

If you want to *really* make iPhone apps, use Xcode and the SDK. If  
you

just
want to get some stuff up on the store quickly, use CS5 I gues



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





--
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




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


Re: [Flashcoders] strange error when removing sprite from parents display list

2009-09-28 Thread Allandt Bik-Elliott (Receptacle)

sorry for the really late reply to this thread but thanks :)

a

On 22 Aug 2009, at 16:07, Juan Pablo Califano wrote:


PS: The place to report bugs:
http://www.flashdevelop.org/community/viewforum.php?f=6

And the rules:
http://www.flashdevelop.org/community/viewtopic.php?f=6t=92

2009/8/22 Juan Pablo Califano califa010.flashcod...@gmail.com

The stack dump looks like .NET, indeed, so it's probably a bug to  
be fixed
in FlashDevelop.  Have you considereded sending a bug report with a  
mininal

sample to reproduce the problem?

Cheers
Juan Pablo Califano
2009/8/22 Allandt Bik-Elliott (Receptacle) alla...@receptacledesign.com 



FYI


This compiles correctly with flexbuilder so it seems it's a  
problem with

flashdevelop (and not the flex sdk or my code)

pity really, - i was really enjoying a flash ide-less workflow  
(could use

flexbuilder - it's awful)

a


On 19 Aug 2009, at 11:42, allandt bik-elliott (thefieldcomic.com)  
wrote:


hi guys

i really hope you can help me with this:

i'm getting the following error from the flex_sdk_3 when  
compiling with

flashdevelop

'undefined' is an unexpected token. Expecting white space. Line 1,
position
58.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.MoveToContent()
at FlashViewer.Controls.FlashView.FlashMovieFlashCall(Object  
sender,

_IShockwaveFlashEvents_FlashCallEvent e)


it happens when the following method fires

public function destroy():void
{
Debug.add(Destroying preloader);
for (var i:int = 0; i  this.numChildren; i++)
{
removeChildAt(0);
}
_sprPreloader = null;
_tfPercent = null;
_tfmtPercent = null;
_percentBar = null;
_assetLoader = null;
parent.removeChild(this);
}

more specifically, it's this line (i've tested with and without it)
parent.removeChild(this);

this is something i've used numerous times before successfully  
and i

don't
really understand why it would be affecting the XmlTextReader (!!)

could anyone shed some light on this please as it's a bit of a  
mystery to

me

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




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





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




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


Re: [Flashcoders] Testing

2009-09-16 Thread Allandt Bik-Elliott (Receptacle)

i always use


this is a test

do not adjust your set

a






On 11 Sep 2009, at 23:57, Glen Pike wrote:


8,16,32

Karl DeSaulniers wrote:

Aaap ya missed 3

;)

Karl


On Sep 11, 2009, at 5:45 PM, Glen Pike wrote:


1,2,4
--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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



--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

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




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


[Flashcoders] Extra information in classes

2009-09-08 Thread Allandt Bik-Elliott (Receptacle)

hi guys

Something I've been thinking about for the last couple of days - what  
extra information do you add to a class when you're writing it?


My headers always include


/**
 * @filename: Main.as
 * @version : Actionscript 3.0
 * @author  : Allandt Bik-Elliott
 * @company : thereceptacle.co.uk
 */

and more recently a changelog

/**
 * @changelog:
 * 2009_09_03 : reason : change
 */

but I've been thinking about refreshing my practises.

I think I'll be using @version to track the class version number in  
the header and revising my @version with @ASversion. I also think i  
might need an @usage


do you add similar headers to each method (i've seen this done a few  
times)? do you add any other information?


thanks
alz

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


Re: [Flashcoders] strange error when removing sprite from parents display list

2009-08-22 Thread Allandt Bik-Elliott (Receptacle)

FYI

This compiles correctly with flexbuilder so it seems it's a problem  
with flashdevelop (and not the flex sdk or my code)


pity really, - i was really enjoying a flash ide-less workflow (could  
use flexbuilder - it's awful)


a

On 19 Aug 2009, at 11:42, allandt bik-elliott (thefieldcomic.com) wrote:


hi guys
i really hope you can help me with this:

i'm getting the following error from the flex_sdk_3 when compiling  
with

flashdevelop

'undefined' is an unexpected token. Expecting white space. Line 1,  
position

58.

  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
  at System.Xml.XmlTextReaderImpl.ParseAttributes()
  at System.Xml.XmlTextReaderImpl.ParseElement()
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
  at System.Xml.XmlTextReaderImpl.Read()
  at System.Xml.XmlTextReader.Read()
  at System.Xml.XmlReader.MoveToContent()
  at FlashViewer.Controls.FlashView.FlashMovieFlashCall(Object sender,
_IShockwaveFlashEvents_FlashCallEvent e)


it happens when the following method fires

public function destroy():void
{
Debug.add(Destroying preloader);
for (var i:int = 0; i  this.numChildren; i++)
{
removeChildAt(0);
}
_sprPreloader = null;
_tfPercent = null;
_tfmtPercent = null;
_percentBar = null;
_assetLoader = null;
parent.removeChild(this);
}

more specifically, it's this line (i've tested with and without it)
parent.removeChild(this);

this is something i've used numerous times before successfully and i  
don't

really understand why it would be affecting the XmlTextReader (!!)

could anyone shed some light on this please as it's a bit of a  
mystery to me


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




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


Re: [Flashcoders] How to compare two audio files with actionscript?

2009-08-10 Thread Allandt Bik-Elliott (Receptacle)

have you seen anything like this?

http://www.communitymx.com/content/article.cfm?cid=8E9A0

just trying to get a feel for what you are trying to do

a


On 10 Aug 2009, at 09:35, johnny lee wrote:


Where are the Actionscript Sages when you need them :(

On Mon, Aug 10, 2009 at 10:25 AM, johnny lee jlee...@gmail.com  
wrote:



Thanks Latcho, can you please describe the process a little bit. What
actually is going on? How is the FFT used to compare the wav files?  
Is it
comparing header data or something? And what about MP3 files, can  
they be

used instead of wav? Thanks, juju

P.S. Has to be AS3, trying to make a Flash RIA.


On Thu, Aug 6, 2009 at 3:42 AM, Latcho spamtha...@gmail.com wrote:



I'd suggest you first get down in audio math and algorithms and  
indeed

FFT.
If you're done with that... choose whatever language you like and
preferably a faster one then AS3.
But it is not impossible to answer your question.


johnny lee wrote:

Hi All, how do you compare two audio files with actionscript? I  
heard

something about Fast Fourier Transform, but don't understand how it
works. What I'm trying to do is a basic voice recognition  
programme,

similar to the one on symbian mobile phones where you can give word
commands to your phone. Can this be done in actionscript?

Thanks and cheers, juju
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





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





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




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


Re: [Flashcoders] button overlay appearing under textfield?

2009-08-10 Thread Allandt Bik-Elliott (Receptacle)

hey glen

thanks for the response

i've adjusted the layout to include another textfield with a quantity  
number in the form and for some reason the order seems to have sorted  
itself out - i've proved this by colouring the _tfItem field and the  
button overlay like i did before. I haven't changed the order or any  
of the spelling but it's okay now.


Really not sure what it was but i do appreciate your time

best
a


On 10 Aug 2009, at 09:20, Glen Pike wrote:

Have you tried disabling the TextField's mouse input? mouseEnabled =  
false or something.  You can also set mouseChildren = false on a  
container to switch off inputs for all the child sprites.


Glen

Allandt Bik-Elliott (Receptacle) wrote:

hey guys

this is probably a silly bug but i've got a very strange occurance

i've got a method that is supposed to create a textfield with an  
invisible button on top but, even tho the traces come out  
correctly, i can't seem to stop the textfield obscuring the button  
if they're added to the same sprite. I'd rather know why that was  
rather than simply creating another sprite to sit the button in


here's the method

   private function createItem():void
   {
   var w:Number = _nWidth - (BasketItem.PADDING * 2);
   _tfItem = AssetFactory.createTextField(0, 0,  
w, 20);

   _tfItem.autoSize = TextFieldAutoSize.LEFT;
   _tfItem.wordWrap= true;
   _tfItem.x= BasketItem.PADDING;
   _tfItem.background = true;
   _tfItem.backgroundColor = 0xFF;
  _sprHitArea =  
AssetFactory.createButtonOverlay(0, 0, _nWidth);
   _sprHitArea.addEventListener(MouseEvent.CLICK,  
itemClickHandler, false, 0, true);

  _sprItemLayer.addChild(_tfItem);
   _sprItemLayer.addChild(_sprHitArea);
  trace(i +  
_sprItemLayer.getChildIndex(_tfItem)); // traces as i0
   trace(ha +  
_sprItemLayer.getChildIndex(_sprHitArea));// traces as ha1

   }

the AssetFactory.createTextField method is here - AssetFactory is a  
static class that i use to create a lot of the common items  
throughout my ria


   public static function createTextField(nX:Number = 0,  
nY:Number = 0, nWidth:Number = 100, nHeight:Number = 100):TextField

   {
   var tf:TextField = new TextField();
   tf.x = nX;
   tf.y = nY;
   tf.width = nWidth;
   tf.height = nHeight;
   tf.multiline = true;
   tf.embedFonts = true;
   tf.selectable = false;
   tf.antiAliasType = AntiAliasType.ADVANCED;
   tf.sharpness = 200;
   tf.styleSheet = SiteData.instance.cssStyle;
  return tf;
   }

and here is the AssetFactory.createButtonOverlay method

   public static function createButtonOverlay(nX:Number = 0,  
nY:Number = 0, nWidth:Number = 100, nHeight:Number = 100):Sprite

   {
   var sp:Sprite = new Sprite();
   sp.graphics.beginFill(0xff9900, 0);
   sp.graphics.drawRect(nX, nY, nWidth, nHeight);
   sp.graphics.endFill();
   sp.buttonMode = true;
  return sp;
   }

i've set the background of the textfield to white and the button  
overlay to orange so i can see what is overlapping what and the  
white seems to be on top of the orange even though their indices  
indicate that the textfield is below the button


i'm very confused about this as it's a fairly simple operation

thanks in advance
a




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




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




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


[Flashcoders] mac vs pc

2009-08-10 Thread Allandt Bik-Elliott (Receptacle)
i'd completely understand if nobody wanted to touch this one but i  
thought i'd throw it out there


a bit of background: I've been developing on mac for 7 or 8 years, the  
first 5 were as an enthusiastic amateur but more recently i've gone  
full time flash developing. As time has progressed, i've started to  
use more tools to help with coding, I've tried FDT on Eclipse for mac  
which i found (at the time) to be overpriced, overfinicky, flaky and  
unreliable (i realise that with the release of the standalone FDT  
package the flakiness is something that has been rectified) and  
flexbuilder just doesn't have any of the text manipulation tools that  
a good coding IDE should imo (duplicating / transposing lines of code  
shouldn't require a mouse) so i've settled for using FlashDevelop  
(which i LOVE) with Parallels as a vm to run it.


This setup has kept me going for a while but it's not without it's  
problems: the keyboard changes from my mac-based Flash IDE to the pc- 
based FlashDevelop IDE has been a headache, I have 3 sources of  
program failures as opposed to 2 (Flash, FlashDevelop AND Parallels)  
which, while they don't account for a lot of my day, are usually  
pretty savage when they do occur. However, as I've been using a pc at  
work, I've really started to seriously consider simply buying a pc on  
my next round of hardware spend (end of this year, beginning of next)  
and be done with it. The mac will always be at the center of my home  
media but this is for my take along, work machine.


So the question I'm really getting to is, how many people use osX  
(using windows in boot camp doesn't count) and how many are using  
windows for their main work machine and what kind of software setup  
are you using?


thanks for your time guys
Allandt


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


[Flashcoders] button overlay appearing under textfield?

2009-08-07 Thread Allandt Bik-Elliott (Receptacle)

hey guys

this is probably a silly bug but i've got a very strange occurance

i've got a method that is supposed to create a textfield with an  
invisible button on top but, even tho the traces come out correctly, i  
can't seem to stop the textfield obscuring the button if they're added  
to the same sprite. I'd rather know why that was rather than simply  
creating another sprite to sit the button in


here's the method

private function createItem():void
{
var w:Number= _nWidth - (BasketItem.PADDING * 2);
_tfItem = 
AssetFactory.createTextField(0, 0, w, 20);
_tfItem.autoSize= TextFieldAutoSize.LEFT;
_tfItem.wordWrap= true;
_tfItem.x   = BasketItem.PADDING;
_tfItem.background = true;
_tfItem.backgroundColor = 0xFF;

_sprHitArea = 
AssetFactory.createButtonOverlay(0, 0, _nWidth);
			_sprHitArea.addEventListener(MouseEvent.CLICK, itemClickHandler,  
false, 0, true);


_sprItemLayer.addChild(_tfItem);
_sprItemLayer.addChild(_sprHitArea);

trace(i + _sprItemLayer.getChildIndex(_tfItem));  
  // traces as i0
			trace(ha + _sprItemLayer.getChildIndex(_sprHitArea));	// traces  
as ha1

}

the AssetFactory.createTextField method is here - AssetFactory is a  
static class that i use to create a lot of the common items throughout  
my ria


		public static function createTextField(nX:Number = 0, nY:Number = 0,  
nWidth:Number = 100, nHeight:Number = 100):TextField

{
var tf:TextField= new TextField();
tf.x= nX;
tf.y= nY;
tf.width= nWidth;
tf.height   = nHeight;
tf.multiline= true;
tf.embedFonts   = true;
tf.selectable   = false;
tf.antiAliasType= AntiAliasType.ADVANCED;
tf.sharpness= 200;
tf.styleSheet   = SiteData.instance.cssStyle;

return tf;
}

and here is the AssetFactory.createButtonOverlay method

		public static function createButtonOverlay(nX:Number = 0, nY:Number  
= 0, nWidth:Number = 100, nHeight:Number = 100):Sprite

{
var sp:Sprite   = new Sprite();
sp.graphics.beginFill(0xff9900, 0);
sp.graphics.drawRect(nX, nY, nWidth, nHeight);
sp.graphics.endFill();
sp.buttonMode   = true;

return sp;
}

i've set the background of the textfield to white and the button  
overlay to orange so i can see what is overlapping what and the white  
seems to be on top of the orange even though their indices indicate  
that the textfield is below the button


i'm very confused about this as it's a fairly simple operation

thanks in advance
a




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


Re: [Flashcoders] button overlay appearing under textfield?

2009-08-07 Thread Allandt Bik-Elliott (Receptacle)
i've taken to putting the button overlay into a separate sprite but i  
would be interested if anyone has any insights as to why this happened  
as it seemed a bit random to me


ta
a


On 7 Aug 2009, at 17:32, Allandt Bik-Elliott (Receptacle) wrote:


hey guys

this is probably a silly bug but i've got a very strange occurance

i've got a method that is supposed to create a textfield with an  
invisible button on top but, even tho the traces come out correctly,  
i can't seem to stop the textfield obscuring the button if they're  
added to the same sprite. I'd rather know why that was rather than  
simply creating another sprite to sit the button in


here's the method

private function createItem():void
{
var w:Number= _nWidth - (BasketItem.PADDING * 2);
_tfItem = 
AssetFactory.createTextField(0, 0, w, 20);
_tfItem.autoSize= TextFieldAutoSize.LEFT;
_tfItem.wordWrap= true;
_tfItem.x   = BasketItem.PADDING;
_tfItem.background = true;
_tfItem.backgroundColor = 0xFF;

_sprHitArea = 
AssetFactory.createButtonOverlay(0, 0, _nWidth);
			_sprHitArea.addEventListener(MouseEvent.CLICK, itemClickHandler,  
false, 0, true);


_sprItemLayer.addChild(_tfItem);
_sprItemLayer.addChild(_sprHitArea);

			trace(i + _sprItemLayer.getChildIndex(_tfItem)); 		// traces as  
i0
			trace(ha + _sprItemLayer.getChildIndex(_sprHitArea));	// traces  
as ha1

}

the AssetFactory.createTextField method is here - AssetFactory is a  
static class that i use to create a lot of the common items  
throughout my ria


		public static function createTextField(nX:Number = 0, nY:Number =  
0, nWidth:Number = 100, nHeight:Number = 100):TextField

{
var tf:TextField= new TextField();
tf.x= nX;
tf.y= nY;
tf.width= nWidth;
tf.height   = nHeight;
tf.multiline= true;
tf.embedFonts   = true;
tf.selectable   = false;
tf.antiAliasType= AntiAliasType.ADVANCED;
tf.sharpness= 200;
tf.styleSheet   = SiteData.instance.cssStyle;

return tf;
}

and here is the AssetFactory.createButtonOverlay method

		public static function createButtonOverlay(nX:Number = 0,  
nY:Number = 0, nWidth:Number = 100, nHeight:Number = 100):Sprite

{
var sp:Sprite   = new Sprite();
sp.graphics.beginFill(0xff9900, 0);
sp.graphics.drawRect(nX, nY, nWidth, nHeight);
sp.graphics.endFill();
sp.buttonMode   = true;

return sp;
}

i've set the background of the textfield to white and the button  
overlay to orange so i can see what is overlapping what and the  
white seems to be on top of the orange even though their indices  
indicate that the textfield is below the button


i'm very confused about this as it's a fairly simple operation

thanks in advance
a




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




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


Re: [Flashcoders] RE: Flash full screen examples

2009-08-07 Thread Allandt Bik-Elliott (Receptacle)

wow that site is the cows udders - you might say it was moo-velous

a


On 7 Aug 2009, at 17:57, Paul Andrews wrote:


Merrill, Jason wrote:

Those California Milk Processors are loaded. :)


Fortunately they didn't go for a cheesy website..

Jason Merrill
Bank of  America   Global Learning Shared Services Solutions  
Development
Monthly meetings on the Adobe Flash platform for rich media  
experiences

- join the Bank of America Flash Platform Community




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kurt
Dommermuth
Sent: Friday, August 07, 2009 12:38 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] RE: Flash full screen examples

http://www.gettheglass.com/

Really nice.  I can't believe there was a budget for that.  None of  
my

clients ever want to pay for something that elaborate.

Do you think the agency cut their rates to do the job or that they  
are

just
amazing salesmen?

Anyway, cool stuff.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of  
Boerner,

Brian J
Sent: Friday, August 07, 2009 11:30 AM
To: Flash Coders List
Subject: [Flashcoders] RE: Flash full screen examples


How about this one?



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of
Mendelsohn,
Michael
Sent: Friday, August 07, 2009 11:11 AM
To: Flash Coders List
Subject: [Flashcoders] Flash full screen examples

Hi list...

Can anyone point out some amazing examples of Flash content taking up
the
entire window?
(StageDisplayState.NORMAL, not StageDisplayState.FULL_SCREEN)
I can offer these examples, but I'm looking for examples applicable  
to

an
eventual holiday greeting card.
http://rb.hi-res.net/index.html (drag the earth)
http://www.pushhere.com/
http://www.oringe.com/flashSite/ (click some of the links)
http://gskinner.com/site2_5/

Looking for inspiration, thanks!
- Michael M.


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

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




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



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


Re: [Flashcoders] RE: Flash full screen examples

2009-08-07 Thread Allandt Bik-Elliott (Receptacle)

the milk of human kindness is running thin with these puns :D


On 7 Aug 2009, at 19:21, Kerry Thompson wrote:


was it the cream of the crop?


It was until they started skimming the profits.

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



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


Re: [Flashcoders] [JOB] Flash/Flex Developer, San Mateo, CA | 75-120k

2009-08-03 Thread Allandt Bik-Elliott (Receptacle)

~noses through portfolio

whassat?


On 31 Jul 2009, at 16:41, Matt Gitchell wrote:


Jeez. Sorry about that, folks.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




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


[Flashcoders] separating MouseEvent.MOUSE_UP from MouseEvent.CLICK

2009-07-12 Thread Allandt Bik-Elliott (Receptacle)

hi guys

quick question - is it possible to separate a MOUSE_UP event from a  
CLICK event?


i have a mouse listener function that does the following:

[code]
private function grabListener(e:MouseEvent):void
{
switch(e.type)
{
case MouseEvent.MOUSE_DOWN :
startDrag();
	stage.addEventListener(MouseEvent.MOUSE_UP, grabListener, false,  
0, true);
	addEventListener(MouseEvent.MOUSE_MOVE, grabListener, false, 0,  
true);

break;

case MouseEvent.MOUSE_UP :
stopDrag();

stage.removeEventListener(MouseEvent.MOUSE_UP, grabListener);
break;

case MouseEvent.MOUSE_MOVE :
_nShowPosition = y;
break;

case MouseEvent.CLICK :
popup();
break;
}
}
[/code]

but the problem is that every time MOUSE_UP fires, it also completes  
the CLICK event, even after the user has dragged the object


i've tried setting the useCapture to true for the following line
	stage.addEventListener(MouseEvent.MOUSE_UP, grabListener, true, 0,  
true);

and in the mouse_up case i've tried doing the following
e.stopPropagation() and e.stopImmediatePropagation()
to try and head the event off before it gets to the click but i guess  
because click is a separate event, it didn't affect it


am i missing a trick here?

hope you can help

best
alz

thefieldcomic.com

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


[Flashcoders] CDATA whitespace issue

2008-10-16 Thread Allandt Bik-Elliott (Receptacle)

hi folks

i'm writing some xml for my site to load in content and, because i  
want to use html, i'm using cdata in my description nodes.


The problem is that if i do the following:

[xml]
?xml version=1.0 encoding=UTF-8?
site
blog
/blog
portfolio
carousel
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
/carousel
/portfolio
contact
/contact
/site
[/xml]

which is the best structural way of creating it (in my opinion), the  
CDATA keeps the whitespace between the 2 lines which means that the  
best way (in as3's eyes) for me to do this is:


[xml]
?xml version=1.0 encoding=UTF-8?
site
blog
/blog
portfolio
carousel
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
/carousel
/portfolio
contact
/contact
/site
[/xml]

which is jarring to write (again, my opinion). Is there any way (like  
the old ignoreWhite param), that i can get as3 to strip the extra tabs  
and linebreaks (even within CDATA)?


thanks
a



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


Re: [Flashcoders] CDATA whitespace issue

2008-10-16 Thread Allandt Bik-Elliott (Receptacle)

hey cedric - thanks for your response

the linebreaks are purely aesthetic, to make it easier to write  
directly in the xml doc but, as you say, they could be stripped (i'm  
using p tags already but the net result is the same). I'm really  
just seeing how far i can go in my xml - the first option is my best- 
case scenario


best
a




On 16 Oct 2008, at 14:01, Cedric Muller wrote:

I don't have the answer, but since you are using html, can't you  
just add br instead of linebreaks ?

p class=headingHeading/pbrpDescription from xml./p

Sometimes, I strip linebreaks from the text I parse in xml, but by  
doing this, you have to know for sure when you can apply such  
'hardcore' rule. This could result in breaking the readability of a  
paragraph.


hth,
Cedric



hi folks

i'm writing some xml for my site to load in content and, because i  
want to use html, i'm using cdata in my description nodes.


The problem is that if i do the following:

[xml]
?xml version=1.0 encoding=UTF-8?
site
blog
/blog
portfolio
carousel
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
/carousel
/portfolio
contact
/contact
/site
[/xml]

which is the best structural way of creating it (in my opinion),  
the CDATA keeps the whitespace between the 2 lines which means that  
the best way (in as3's eyes) for me to do this is:


[xml]
?xml version=1.0 encoding=UTF-8?
site
blog
/blog
portfolio
carousel
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
/carousel
/portfolio
contact
/contact
/site
[/xml]

which is jarring to write (again, my opinion). Is there any way  
(like the old ignoreWhite param), that i can get as3 to strip the  
extra tabs and linebreaks (even within CDATA)?


thanks
a



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


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




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


Re: [Flashcoders] CDATA whitespace issue

2008-10-16 Thread Allandt Bik-Elliott (Receptacle)

:D

thanks mate


On 16 Oct 2008, at 14:44, Cedric Muller wrote:


:)
yes I know, I am facing the exact same problem.
I love best-case scenarios, but with xml I couldn't achieve the  
first option, unless rendering the xml from a cms.


cedric


hey cedric - thanks for your response

the linebreaks are purely aesthetic, to make it easier to write  
directly in the xml doc but, as you say, they could be stripped  
(i'm using p tags already but the net result is the same). I'm  
really just seeing how far i can go in my xml - the first option is  
my best-case scenario


best
a




On 16 Oct 2008, at 14:01, Cedric Muller wrote:

I don't have the answer, but since you are using html, can't you  
just add br instead of linebreaks ?

p class=headingHeading/pbrpDescription from xml./p

Sometimes, I strip linebreaks from the text I parse in xml, but by  
doing this, you have to know for sure when you can apply such  
'hardcore' rule. This could result in breaking the readability of  
a paragraph.


hth,
Cedric



hi folks

i'm writing some xml for my site to load in content and, because  
i want to use html, i'm using cdata in my description nodes.


The problem is that if i do the following:

[xml]
?xml version=1.0 encoding=UTF-8?
site
blog
/blog
portfolio
carousel
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
/carousel
/portfolio
contact
/contact
/site
[/xml]

which is the best structural way of creating it (in my opinion),  
the CDATA keeps the whitespace between the 2 lines which means  
that the best way (in as3's eyes) for me to do this is:


[xml]
?xml version=1.0 encoding=UTF-8?
site
blog
/blog
portfolio
carousel
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
carouselItem name=Test imgUrl=icon_logo.png 
linkUrl=
description
![CDATA[p class=headingHeading/p
pDescription from xml./p]]
/description
/carouselItem
/carousel
/portfolio
contact
/contact
/site
[/xml]

which is jarring to write (again, my opinion). Is there any way  
(like the old ignoreWhite param), that i can get as3 to strip the  
extra tabs and linebreaks (even within CDATA)?


thanks
a



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


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




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


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




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


Re: [Flashcoders] AS3 flash is treating static function call as property?

2008-10-14 Thread Allandt Bik-Elliott (Receptacle)
awesome - knew it was something stupid - i've been doing wy to  
much as2 recently :)


thanks guys

a


On 14 Oct 2008, at 15:24, Cédric Tabin wrote:


Hello,

Didn't you forget the 'public' before class ? :)

Regards,
Cedric

On Tue, Oct 14, 2008 at 4:05 PM, Allandt Bik-Elliott (Receptacle) 
[EMAIL PROTECTED] wrote:


hey guys

quick question for you as3 coders:

i have an old as2 class which i've converted to as3 that checks to  
see
where the movie is being played (browser or IDE test movie player)  
and
adjusts the url of the loading swf to make sure that i don't have  
to keep
the main loader swf outside of my swf directory (it'll explain  
itself)


my converted class is :

[code]
package com.receptacledesign.utils
{
  import flash.system.Capabilities;

  class Path
  {
  public static function assess(sPath:String):String
  {
  sPath = (Capabilities.playerType !=  
External) ?

sPath : ../ + sPath;
  return sPath;
  }
  }
}
[/code]

and i'm trying to use this in my loader class like so

[code]
private var _sMainPath:String;

in my constructor:
_sMainPath = Path.assess(main.swf);
[/code]

but i get the following error:
1120: Access of undefined property Path.

so it would seem that my class is treating Path as a property  
rather than a
class in it's own right. I've imported the class as usual so it  
isn't that


hope you can help
a

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


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





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


[Flashcoders] AS3 flash is treating static function call as property?

2008-10-14 Thread Allandt Bik-Elliott (Receptacle)

hey guys

quick question for you as3 coders:

i have an old as2 class which i've converted to as3 that checks to see  
where the movie is being played (browser or IDE test movie player) and  
adjusts the url of the loading swf to make sure that i don't have to  
keep the main loader swf outside of my swf directory (it'll explain  
itself)


my converted class is :

[code]
package com.receptacledesign.utils
{
import flash.system.Capabilities;

class Path
{
public static function assess(sPath:String):String
{
			sPath = (Capabilities.playerType != External) ? sPath : ../ +  
sPath;

return sPath;
}
}
}
[/code]

and i'm trying to use this in my loader class like so

[code]
private var _sMainPath:String;

in my constructor:
_sMainPath = Path.assess(main.swf);
[/code]

but i get the following error:
1120: Access of undefined property Path.

so it would seem that my class is treating Path as a property rather  
than a class in it's own right. I've imported the class as usual so it  
isn't that


hope you can help
a

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


Re: [Flashcoders] streaming mp3s not consistent

2008-10-09 Thread Allandt Bik-Elliott (Receptacle)

what would be the netstream method to do this please?


On 6 Oct 2008, at 12:40, Allandt Bik-Elliott (Receptacle) wrote:


hi guys

i have a quick question regarding streaming mp3s.

I have several (hundred) dynamically loaded mp3s that i've been  
streaming into flash using the following code:


NOTE: AS2
[code]
private function startMouth():Void
{
var avatarSound:Sound = new Sound();
avatarSound.loadSound(mp3, true);
avatarSound.onSoundComplete = Delegate.create(this, stopMouth);
}
[/code]

mp3 is a getter that grabs the property _mp3 which is set  
dynamically before the method


the problem i'm having is that the mp3s don't always stream fully  
and can stop before the end (and because of this, the  
onSoundComplete never fires).


This is for a high-use application so we expect high server-load and  
spikes which makes me think that streaming might not be the best way  
- the mp3s are between 5-8k each so i was thinking that preloading  
them individually before use might be better


would you agree with this or is there a better way of doing this?

thanks a lot
alz

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




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


[Flashcoders] streaming mp3s not consistent

2008-10-06 Thread Allandt Bik-Elliott (Receptacle)

hi guys

i have a quick question regarding streaming mp3s.

I have several (hundred) dynamically loaded mp3s that i've been  
streaming into flash using the following code:


NOTE: AS2
[code]
private function startMouth():Void
{
var avatarSound:Sound = new Sound();
avatarSound.loadSound(mp3, true);
avatarSound.onSoundComplete = Delegate.create(this, stopMouth);
}
[/code]

mp3 is a getter that grabs the property _mp3 which is set dynamically  
before the method


the problem i'm having is that the mp3s don't always stream fully and  
can stop before the end (and because of this, the onSoundComplete  
never fires).


This is for a high-use application so we expect high server-load and  
spikes which makes me think that streaming might not be the best way -  
the mp3s are between 5-8k each so i was thinking that preloading them  
individually before use might be better


would you agree with this or is there a better way of doing this?

thanks a lot
alz

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


[Flashcoders] [Solved] flushing memory

2008-10-06 Thread Allandt Bik-Elliott (Receptacle)

Found out what the problem was

The data for the game was being held in a singleton - just needed to  
clear that and the game behaves properly





On 4 Oct 2008, at 08:20, allandt bik-elliott (thefieldcomic.com) wrote:


i've tried delete Question (Question is the main object that gets
populated) but that didn't cut it

On Fri, Oct 3, 2008 at 7:27 PM, eric e. dolecki [EMAIL PROTECTED]  
wrote:


Handle it without using a timeline at all and use code straight  
instead?


On Fri, Oct 3, 2008 at 2:11 PM, Allandt Bik-Elliott (Receptacle) 
[EMAIL PROTECTED] wrote:


hi folks

is there any way i can completely flush the memory for the flash  
plugin?


i have a spelling game that uses classes on symbols placed on the

timeline
and when i hit a replay button at the end of my game, the playhead  
is

moved

to the start of the timeline (so none of the symbols are present any

more)

and then the game is started up again

the only problem is that when the game goes through it's second  
pass, all

of the questions are duplicated.

I've tried delete'ing all of the objects in the class itself at  
the end

of

the game before i move back to the start but it still happens

the only way i can see around it is to reload the whole page but  
that's a

hit on the server which seems a little over the top

cheers
alz

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


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


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




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


[Flashcoders] AS2 - problems calling a movieclip class

2008-10-03 Thread Allandt Bik-Elliott (Receptacle)

hi guys - really hope you can help with this one

i've got the following class assigned to a movieclip (using linkage)

[code]
import com.receptacledesign.events.EventClip
import mx.utils.Delegate;

class com.avatar extends EventClip // adds events to the movieclip
{

var _nc:NetConnection;
var _ns:NetStream;
var _mp3:String;

var player:MovieClip;
var avatarStatic:MovieClip;

// constructor
public function avatar()
{
init();
}

private function init():Void
{
trace(this +  is here. v0.2); // outputs correctly
		player = this.attachMovie(mcVideo, player,  
this.getNextHighestDepth());

}

public function mouthControl(mouthMode:String):Void
{
trace(mouthControl); // doesn't trace :(
switch (mouthMode)
{
case start :
trace(startMouth);
startMouth();
break;

case stop :
trace(stopMouth);
stopMouth();
break;

default :
trace(mouthMode not recognised);
}
}

public function testavatar():Void // doesn't fire :(
{
trace(avatar is testing);
}

// private methods -
private function startMouth():Void
{
trace(startMouth());

_nc = new NetConnection();
_nc.connect(null);
_ns = new NetStream(_nc);
player.attachVideo(_ns);
_ns.play(mp3: + MP3);
_ns.onStatus = Delegate.create(this, nsOnStatus);

lexStatic.gotoAndPlay(on);
}

private function stopMouth():Void
{
trace(stopMouth());
}

private function fireEvent(evt:String):Void
{
if (evt != outro) gotoAndStop(static);
dispatchEvent({target:this, value:evt, 
type:EventClip.FINISHED});
}

private function nsOnStatus(evt:Object):Void
{
trace(evt.code);
if (evt.code == NetStream.Buffer.Flush) stopMouth();
}

// getters and setters
public function set MP3(s:String):Void
{
_mp3 = s;
}
public function get MP3():String
{
return _mp3;
}
}
[/code]

and i'm trying to do the following

set the mp3 file path with the setter mp3
run the mouthControl() method

so i've done this in my main class:
private var avatar:MovieClip; // set on initialisation

private function avatarSayWord():Void
{
avatar.MP3 = Questions[nCurrentQuestion].media;
		trace(Game.avatarSayWord:  + avatar.MP3); // traces path to mp3  
file correctly from avatar

avatar.mouthControl(start); // does nothing
avatar.testavatar(); // does nothing
}


the setter and the getter is working but the public methods aren't  
working at all


what am i doing wrong please?

please help - it's crunch time here

thankyou
alz



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


Re: [Flashcoders] AS2 - problems calling a movieclip class

2008-10-03 Thread Allandt Bik-Elliott (Receptacle)

ah never mind again - i got it

i was referencing the holding clip, not the clip with the class on

sorry
alz


On 3 Oct 2008, at 12:07, Allandt Bik-Elliott (Receptacle) wrote:


hi guys - really hope you can help with this one

i've got the following class assigned to a movieclip (using linkage)

[code]
import com.receptacledesign.events.EventClip
import mx.utils.Delegate;

class com.avatar extends EventClip // adds events to the movieclip
{

var _nc:NetConnection;
var _ns:NetStream;
var _mp3:String;

var player:MovieClip;
var avatarStatic:MovieClip;

// constructor
public function avatar()
{
init();
}

private function init():Void
{
trace(this +  is here. v0.2); // outputs correctly
		player = this.attachMovie(mcVideo, player,  
this.getNextHighestDepth());

}

public function mouthControl(mouthMode:String):Void
{
trace(mouthControl); // doesn't trace :(
switch (mouthMode)
{
case start :
trace(startMouth);
startMouth();
break;

case stop :
trace(stopMouth);
stopMouth();
break;

default :
trace(mouthMode not recognised);
}
}

public function testavatar():Void // doesn't fire :(
{
trace(avatar is testing);
}

// private methods -
private function startMouth():Void
{
trace(startMouth());

_nc = new NetConnection();
_nc.connect(null);
_ns = new NetStream(_nc);
player.attachVideo(_ns);
_ns.play(mp3: + MP3);
_ns.onStatus = Delegate.create(this, nsOnStatus);

lexStatic.gotoAndPlay(on);
}

private function stopMouth():Void
{
trace(stopMouth());
}

private function fireEvent(evt:String):Void
{
if (evt != outro) gotoAndStop(static);
dispatchEvent({target:this, value:evt, 
type:EventClip.FINISHED});
}

private function nsOnStatus(evt:Object):Void
{
trace(evt.code);
if (evt.code == NetStream.Buffer.Flush) stopMouth();
}

// getters and setters
public function set MP3(s:String):Void
{
_mp3 = s;
}
public function get MP3():String
{
return _mp3;
}
}
[/code]

and i'm trying to do the following

set the mp3 file path with the setter mp3
run the mouthControl() method

so i've done this in my main class:
private var avatar:MovieClip; // set on initialisation

private function avatarSayWord():Void
{
avatar.MP3 = Questions[nCurrentQuestion].media;
		trace(Game.avatarSayWord:  + avatar.MP3); // traces path to mp3  
file correctly from avatar

avatar.mouthControl(start); // does nothing
avatar.testavatar(); // does nothing
}


the setter and the getter is working but the public methods aren't  
working at all


what am i doing wrong please?

please help - it's crunch time here

thankyou
alz



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




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


[Flashcoders] flushing memory

2008-10-03 Thread Allandt Bik-Elliott (Receptacle)

hi folks

is there any way i can completely flush the memory for the flash plugin?

i have a spelling game that uses classes on symbols placed on the  
timeline and when i hit a replay button at the end of my game, the  
playhead is moved to the start of the timeline (so none of the symbols  
are present any more) and then the game is started up again


the only problem is that when the game goes through it's second pass,  
all of the questions are duplicated.


I've tried delete'ing all of the objects in the class itself at the  
end of the game before i move back to the start but it still happens


the only way i can see around it is to reload the whole page but  
that's a hit on the server which seems a little over the top


cheers
alz

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


[Flashcoders] AS2 EventDispatcher problem

2008-10-02 Thread Allandt Bik-Elliott (Receptacle)

hi guys - i could really use some help here

I have a swf, 'swf', that has a movieclip called 'clip' placed on  
stage that uses the following class in it's linkage


all of this is loaded into another swf with moviecliploader

[code]
import com.receptacledesign.events.EventClip

class com.Clip extends EventClip
{
public function Lex()
{
super();

trace(Lex is here);
trace(_root._currentframe);
}

public function fireEvent(evt:String):Void
{
trace(evt);
dispatchEvent({target:this, type:EventClip.FINISHED});
}
}
[/code]

The fireEvent method of Clip is called from the timeline of the clip

once the onLoadInit event fires, i'm trying to listen to it within the  
main class using the following line:


[code]
swf.clip.addEventListener(EventClip.FINISHED, Delegate.create(this,  
animationFinished));

[/code]

but the event never gets picked up (i have a trace in the  
animationFinished method to see if it's working) even tho the  
fireEvent method traces correctly (with the trace(evt));


is it possible to do what i'm trying to do or have i done something  
stupid?


thanks
allandt

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


[Flashcoders] favourite programming environment

2008-09-26 Thread Allandt Bik-Elliott (Receptacle)
I'm sure it's been asked before but as these things change over time,  
i thought it worth rehashing now


what's your favourite coding environment?

I really like FlashDevelop but because I'm on a mac, I've been looking  
into other options (although FD with parallels is a pretty good  
setup). I've found eclipse and FDT to be shaky at best - the AS2  
libraries are incomplete (the mx lib has to be added to the default  
setup, for instance) and it seems to be a little unstable (if it  
doesn't crash entirely once in a while, it seems to get slower over  
time - maybe there's a memory leak somewhere?) and FDT costs an  
astronomical amount for something that is supposed to go alongside the  
Flash IDE when doing AS2 (which seems to be still the most widely used  
version of Actionscript outside of full-on microsite design) as it  
doesn't have it's own AS2 compiler.


I've seen that coda has started supporting AS code hinting but without  
real OOP class support, it really only is a curio at the moment.


what do you guys think?

thanks
allandt

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


Re: [Flashcoders] TweenMax help needed

2008-08-25 Thread Allandt Bik-Elliott (Receptacle)

sweet

i actually found a workaround for my issue - i used the  
TweenMax.delayedCall to run my functions instead of running delay:  
and delayIncrement: and that seemed to fix the problem i had.


On a side note - i was using a setInterval to add pauses in between  
firing the different tweens i was doing (as part of a larger  
animation manager package) and it seemed to have problems doing both  
the tweens and the interval - the numbers i was passing to the  
interval were behaving very strangely - they were behaving like  
seconds rather than milliseconds and the whole interval would fall  
over after a couple of calls (hence me digging into the tweenmax api  
for the delay and delayedCall options). So it would seem that  
TweenMax doesn't play nice with setInterval. Is this a recognised  
issue (and the reason for a delayedCall method)?


a


On 24 Aug 2008, at 16:34, Jack Doyle wrote:

Sure, you can use delay and delayIncrement together in a  
TweenMax.allTo()

call. They work great together.

Also, I should mention that I'm releasing a pretty significant  
upgrade to
the TweenLite/TweenFilterLite/TweenMax family soon. Probably the  
biggest
enhancement has to do with a new OverwriteManager class that gives  
you lots
of control of how (and if) tweens handle overlaps/conflicts,  
including an
AUTO mode that only overwrites individual overlapping properties  
instead
of the entire tweens. There are actually 4 modes from which to  
choose (NONE,
ALL, AUTO, and CONCURRENT). This means you'll probably never have  
to type
overwrite:false again. Keep an eye on http://blog.greensock.com  
for the

announcement.

If anyone would like me to e-mail them when the update is ready,  
just let me

know by sending me an e-mail with TweenMax update in the subject.

Jack


-Original Message-
From: allandt bik-elliott (thefieldcomic.com)  
[mailto:[EMAIL PROTECTED]

Sent: Friday, August 22, 2008 10:27 AM
To: Flash Coders List
Subject: [Flashcoders] TweenMax help needed

hi folks - i have a quick question

can anyone tell me if i use delay and delayIncrement in the same  
TweenMax

call, will they clash?

so

will delayIncrement:0.05 and delay:_delay overwrite each other?
TweenMax.allTo(aTilesToMove, .2, {_y:nMoveAmount, ease:Quad.easeIn,
delayIncrement:0.05, overwrite:false, , onStart:nextAnimationFrame,
onStartParams:[_oAnimationObject]});

thanks
a



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




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


Re: [Flashcoders] ...Friday, 5:38 pm

2008-07-26 Thread Allandt Bik-Elliott (Receptacle)

heh :)

if flash died tomorrow, what would you do instead?

On 25 Jul 2008, at 22:20, Steven Sacks wrote:


I'm still here.  ;)

allandt bik-elliott (thefieldcomic.com) wrote:
it brings up a serious point tho - can flash survive with the  
amount of

animosity there is towards it?

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




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


Re: [Flashcoders] ...Friday, 5:38 pm

2008-07-26 Thread Allandt Bik-Elliott (Receptacle)

i mean if the flash plugin died so no actionscript what would you do



On 26 Jul 2008, at 12:13, Cor wrote:


OK, serious, FlashDevelop.
I already use it in combination with the Flex SDK.
Marvelous autocompletion and other handy functionalities.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of  
Allandt

Bik-Elliott (Receptacle)
Sent: zaterdag 26 juli 2008 13:02
To: Flash Coders List
Subject: Re: [Flashcoders] ...Friday, 5:38 pm

heh :)

if flash died tomorrow, what would you do instead?

On 25 Jul 2008, at 22:20, Steven Sacks wrote:


I'm still here.  ;)

allandt bik-elliott (thefieldcomic.com) wrote:

it brings up a serious point tho - can flash survive with the
amount of
animosity there is towards it?

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




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

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



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


Re: [Flashcoders] regexp question

2008-07-04 Thread Allandt Bik-Elliott (Receptacle)

wow - i have no idea what that means at all

time to hit the books - thanks :)

On 4 Jul 2008, at 01:09, Claudius Ceteras wrote:


Hi,


is there a way of counting back from the end of the number and
inserting the comma (even without a regular expression)? if i
use the
g modifier in the regexp (so var pattern:RegExp = /000/g;), it will
only pick up the first 000 (and every multiple thereafter)
instead of
leaving the first 0 (which is expected behaviour but something i'd
like to get around)


How about positive lookaheads?

/(000)(?=(?:000)*[^0])/g

If you want this also to work for 1234567 = 1,234,567, you can  
replace
every 0 in the pattern with \d and call the replace function with , 
\1

instead of ,000

This is untested, but should work... Let me know.

regards,

Claudius

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



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


Re: [Flashcoders] regexp question

2008-07-04 Thread Allandt Bik-Elliott (Receptacle)

hi again

i've been trying different things and it seems that the [^0] or [^\d]  
is stopping it working. (I needed to use $1 rather than \1 to  
reference the first group in the String.replace statement)


here is what i've got so far

var sYear:String = 1234567;
var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g;
sYear = sYear.replace(pattern, ,$1);
//traces 1234567

if i drop the NOT part
var sYear:String = 1234567;
var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*)/g;
sYear = sYear.replace(pattern, ,$1);
//traces ,123,4567

This stuff is really new to me so i really appreciate the help

thanks
a

On 4 Jul 2008, at 01:09, Claudius Ceteras wrote:


Hi,


is there a way of counting back from the end of the number and
inserting the comma (even without a regular expression)? if i
use the
g modifier in the regexp (so var pattern:RegExp = /000/g;), it will
only pick up the first 000 (and every multiple thereafter)
instead of
leaving the first 0 (which is expected behaviour but something i'd
like to get around)


How about positive lookaheads?

/(000)(?=(?:000)*[^0])/g

If you want this also to work for 1234567 = 1,234,567, you can  
replace
every 0 in the pattern with \d and call the replace function with , 
\1

instead of ,000

This is untested, but should work... Let me know.

regards,

Claudius

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



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


Re: [Flashcoders] regexp question

2008-07-04 Thread Allandt Bik-Elliott (Receptacle)

hey that's great sid - thanks

a


On 4 Jul 2008, at 12:26, Sidney de Koning wrote:


Hi Allandt,

Have you found this tool already? http://www.gskinner.com/blog/ 
archives/2008/03/regexr_free_onl.html

It allows you to test your regex pattern expecially for AS

And you can find a cheatsheat on RegEx on www.ilovejackdaniels.com  
and there is ofcourse alot on whttp://www.regular-expressions.info/ 
quickstart.html

and http://www.regular-expressions.info/tutorial.html

Hope this will get you started,

Sid

On Jul 4, 2008, at 11:32 AM, Allandt Bik-Elliott (Receptacle) wrote:


hi again

i've been trying different things and it seems that the [^0] or [^ 
\d] is stopping it working. (I needed to use $1 rather than \1 to  
reference the first group in the String.replace statement)


here is what i've got so far

var sYear:String = 1234567;
var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g;
sYear = sYear.replace(pattern, ,$1);
//traces 1234567

if i drop the NOT part
var sYear:String = 1234567;
var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*)/g;
sYear = sYear.replace(pattern, ,$1);
//traces ,123,4567

This stuff is really new to me so i really appreciate the help

thanks
a

On 4 Jul 2008, at 01:09, Claudius Ceteras wrote:


Hi,


is there a way of counting back from the end of the number and
inserting the comma (even without a regular expression)? if i
use the
g modifier in the regexp (so var pattern:RegExp = /000/g;), it will
only pick up the first 000 (and every multiple thereafter)
instead of
leaving the first 0 (which is expected behaviour but something i'd
like to get around)


How about positive lookaheads?

/(000)(?=(?:000)*[^0])/g

If you want this also to work for 1234567 = 1,234,567, you  
can replace
every 0 in the pattern with \d and call the replace function with  
,\1

instead of ,000

This is untested, but should work... Let me know.

regards,

Claudius

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



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



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



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


Re: [Flashcoders] regexp question

2008-07-04 Thread Allandt Bik-Elliott (Receptacle)

the \b boundary worked a treat - i'm just researching why it worked now

thanks for all your help guys

a


On 4 Jul 2008, at 13:17, Claudius Ceteras wrote:

To get this to also work with just the year you may replace [^\d]  
with

(?:[^\d]|$) which expects a non-digit or the end of the string


Or even better Replace [^\d] with \b which should also work.

regards

Claudius

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




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


Re: [Flashcoders] regexp question

2008-07-04 Thread Allandt Bik-Elliott (Receptacle)

wow - that's really helpful - thanks a lot for your time claudius

best
a


On 4 Jul 2008, at 14:56, Claudius Ceteras wrote:






the \b boundary worked a treat - i'm just researching why it
worked now



/(\d\d\d)(?=(?:\d\d\d)*\b)/g

Find all groups of three digits  (\d\d\d) , which are followed by 
positive lookahead: (?= ) 
0, 3, 6, 9, ... Digits, followed by a word boundary  (?:\d\d\d)*\b 

Word boundaries match at the end of the number, so because it only  
matches

three digits groups which are followed by a number of digits which is
divisible by 3, it doesnt find 123 in 1234567, but  
234 (because it's
followed by 3 digits followed by a word boundary) and  
456 (because it's

followed by 0 digits followed by a wod boundary)

Btw,
(?:   ) is a non-capturing group,
(?=   ) is a positive lookahead.
You can google for both...


regards

Claudius

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



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


Re: [Flashcoders] Strange Masking Bug in Flash

2008-07-03 Thread Allandt Bik-Elliott (Receptacle)

are the masks rendered as bitmaps?

On 3 Jul 2008, at 16:40, peter ginsberg wrote:


Hoping to get some help with a bizarre bug that has been haunting
development of the current game we're working on.

The situation is this:
We have character animations where we swap in dynamic clothing.  We
developed a system where we add patterns dynamically to the  
clothing by

doing the following with code:
1. Dupe the movieclip/sprite which is going to get a pattern
2. Use the dupe as a mask on a big square sprite that has the graphic
pattern in it.
3. Put the resulting masked element as a MULTIPLY overlay on the  
underlying

original clip.

It works great in most cases EXCEPT for this bizarre issue we keep  
running
into where in some clips the mask is partially broken -- seemingly  
random
parts of the movieclip are not masked, or in other parts weird  
extra lines

appear, or even big blocks.

*Sometimes* you can fix this by going into the movieclip and grouping
ungrouped graphical elements.  It gets really messed up if there  
are more
complicated graphical elements in there (like a gradient).  In  
these cases,

even attempts to group elements, or make them movieclips, or whatever,
doesn't seem to help much.

I was able to create a super simple demonstration of this bug, and  
posted

here:
http://www.thup.com/maskbug.zip

Surprisingly, I was able to replicate the error without any code, just
using  CS3.   The movieclips on the left and right are both the  
same, but
the one on the right has the lines and fills inside the movieclip  
groups
*separately*.  You'll note both of these look just fine in preview,  
but when
you build the swf, the one on the left has a big block of the  
masked object

showing for no reason.

Someone is probably going to tell me to just group items as I've  
done in
this example, but like I said above that doesn't always work.  For  
some

elements nothing works at all.

This is sort of a bug in flash, but I can't have been the first  
person to
notice it.  Does anyone have any idea how we caused it?  Is it just  
that

flash can only support masks that are simple flat color fills?

If it's the latter, I have a follow up question, can anyone think of a
clever way to take the movieclips we are using and convert them into
monotone fills of the same exact dimensions (some kind of bitmapdata
conversion maybe?).

Thanks in advance for any advice!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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


[Flashcoders] regexp question

2008-07-02 Thread Allandt Bik-Elliott (Receptacle)

hey

i am using regexp to inject commas into my years by searching for 000  
and replacing with ,000 like this


var pattern:RegExp = /000/;
sYear = sYear.replace(pattern, ,000);

however, this approach will bug every multiple of 10,000 as there are  
more zeros than the pattern expects.


is there a way of counting back from the end of the number and  
inserting the comma (even without a regular expression)? if i use the  
g modifier in the regexp (so var pattern:RegExp = /000/g;), it will  
only pick up the first 000 (and every multiple thereafter) instead of  
leaving the first 0 (which is expected behaviour but something i'd  
like to get around)


would you use an if statement to count the length of the sYear string  
or is there a better way?


at the moment, because i know that i only need years from 15,000 bc,  
i'm doing this:


var sYear:String = String(nYear);
if (sYear.length  5)
{
if (sYear != -1)
{
var pattern:RegExp = /000/;
sYear = sYear.replace(pattern, ,000);
} else {
var pattern:RegExp = //;
sYear = sYear.replace(pattern, 0,000);
}
}

which is a bit hacky and limited

interested to hear your answer

a

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


Re: [Flashcoders] as3 textfield scroll problem

2008-07-02 Thread Allandt Bik-Elliott (Receptacle)
Would be really interested in an opinion on this - there's 3 lines of  
code (commented) that are relavent in the block below


thanks a lot, guys
a

On 30 Jun 2008, at 18:33, Allandt Bik-Elliott (Receptacle) wrote:

Hi - i found a way around this (by adding a body format as a  
setTextFormat even though it replicates the defaultTextFormat) but  
i'd really like to know if anyone has had similar problems and if  
this is a bug in the player or if there's a problem with my  
implementation


thanks again
a



On 30 Jun 2008, at 15:38, Allandt Bik-Elliott (Receptacle) wrote:

i should probably mention that the same object is used for several  
instances but it's just the one that doesn't use the  
elCreditFormat TextFormat that fails to scroll


thanks
a


On 30 Jun 2008, at 15:10, Allandt Bik-Elliott (Receptacle) wrote:


i really hope someone can help me here

i have a textfield that is set up with a defaultTextFormat and  
has several setTextFormats applied to type within it but when i  
try to overflow it and add a scrollbar, i get no scroll result.


I've looked into it and it seems that no matter how much type  
goes in (either more or less), it shows that there are 4 lines  
(using TextField.numLines) in it.


i've included the method below and commented where the issue is -  
note that there is a textformat that is applied if the elCredit  
property is set that is the thing that seems to be the problem:  
when it is added, the numLines traces to the actual number of  
lines (and the scrollbar works) but when it doesn't get used,  
numLines is 4 regardless of content and the scrollbar doesn't work


please help as i'm really stumped on this issue

thankyou
a

private function createBase():void
{
elBase = new Sprite();
elBase.graphics.beginFill(commonGrey, 1);
elBase.graphics.drawRect(0, 0, elWidth, elHeight);
elBase.x = elX;
elBase.y = elY;

var dropShadow:DropShadowFilter = new 
DropShadowFilter();
dropShadow.color = 0x00;
dropShadow.blurX = 10;
dropShadow.blurY = 10;
dropShadow.angle = 135;
dropShadow.alpha = ...5;
dropShadow.distance = 10;
var filtersArray:Array = new Array(dropShadow);
elBase.filters = filtersArray;

var close_btn:Sprite = new Sprite();
close_btn.buttonMode = true;
close_btn.graphics.lineStyle(1, 0x33, 1);
close_btn.graphics.beginFill(0xFF);
close_btn.graphics.drawRect(0, 0, 10, 10);
close_btn.addEventListener(MouseEvent.CLICK, 
closeBtnListener);
close_btn.x = elWidth -15;
close_btn.y = 5;

var popupNotice_txt:String = Click image to zoom 
in/out.;
			var popupNotice:SimpleTextField = new SimpleTextField 
(0xFF, 12, headingFont, 5, 2, textWidth, textHeight,  
popupNotice_txt, true);


var txt:String  = elTitle +\n;
txt += elDate +\n;
txt += elText +\n;
if (elCredit != \nPicture credit: ) txt += elCredit;
textWidth   -= 15;


// this is the textfield

			var elTextField:SimpleTextField = new SimpleTextField 
(0x00, 12, mainFont, textX, textY, textWidth, textHeight, txt);

elTextField.wordWrap = true;
elTextField.multiline = true;

var eltfScrollbar:UIScrollBar = new UIScrollBar();
eltfScrollbar.scrollTarget = elTextField;
			eltfScrollbar.move(elTextField.x+elTextField.width,  
elTextField.y);

eltfScrollbar.height = elTextField.height;

var titleFormat:TextFormat = new TextFormat();
titleFormat.font = headingFont;
titleFormat.size = 16;
titleFormat.leading = 0;
titleFormat.color = 0xFF;

var dateFormat:TextFormat = new TextFormat();
dateFormat.font = subheadingFont;
dateFormat.size = 14;
dateFormat.leading = 6;
dateFormat.color = 0xFF;

var creditFormat:TextFormat = new TextFormat();
creditFormat.size = 9

Re: [Flashcoders] regexp question

2008-07-02 Thread Allandt Bik-Elliott (Receptacle)

thanks a lot :)


On 2 Jul 2008, at 15:24, Juan Pablo Califano wrote:


Hi,

You can check out ascb (ActionScript Cook Book), a library with  
some useful
functions. In this case, the class NumberFormat, and the method  
format may

do the job.

http://www.rightactionscript.com/ascb/

Almost any formatNumber method you can find in many other libraries  
will

help you too, except for some reason you want to roll your own.


Cheers
Juan Pablo Califano

2008/7/2, Allandt Bik-Elliott (Receptacle)  
[EMAIL PROTECTED]:


hey

i am using regexp to inject commas into my years by searching for  
000 and

replacing with ,000 like this

var pattern:RegExp = /000/;
sYear = sYear.replace(pattern, ,000);

however, this approach will bug every multiple of 10,000 as there  
are more

zeros than the pattern expects.

is there a way of counting back from the end of the number and  
inserting
the comma (even without a regular expression)? if i use the g  
modifier in
the regexp (so var pattern:RegExp = /000/g;), it will only pick up  
the first
000 (and every multiple thereafter) instead of leaving the first 0  
(which is

expected behaviour but something i'd like to get around)

would you use an if statement to count the length of the sYear  
string or is

there a better way?

at the moment, because i know that i only need years from 15,000  
bc, i'm

doing this:

   var sYear:String = String(nYear);
   if (sYear.length  5)
   {
   if (sYear != -1)
   {
   var pattern:RegExp = /000/;
   sYear = sYear.replace(pattern,
,000);
   } else {
   var pattern:RegExp = //;
   sYear = sYear.replace(pattern,
0,000);
   }
   }

which is a bit hacky and limited

interested to hear your answer

a

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


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



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


Re: [Flashcoders] Warning: 3596: Duplicate variable definition.

2008-07-01 Thread Allandt Bik-Elliott (Receptacle)

should that be:?

var clip:* = e.target;
var buttons:Array = _menuButtons;
(e.target.buttonType == 1) ? buttons = _subMenuButtons : buttons =  
_menuButtons;




On 1 Jul 2008, at 00:03, Steven Sacks wrote:


Even better, 3 lines.

var clip:* = e.target;
var buttons:Array = _menuButtons;
if (e.target.buttonType == 1) buttons = _subMenuButtons;
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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


Re: [Flashcoders] Warning: 3596: Duplicate variable definition.

2008-07-01 Thread Allandt Bik-Elliott (Receptacle)

nice!

;)


On 1 Jul 2008, at 08:37, Steven Sacks wrote:

Why?  You already set buttons to _menuButtons.  Now you're going to  
set it again?


Besides, that ternary is not DRY because you are setting buttons =  
twice.


However, it can be compacted even more, and in 2 lines, instead of  
3, by reusing clip and a ternary in the var declaration, like so:


var clip:* = e.target;
var buttons:Array = (clip.buttonType == 1) ? _subMenuButtons:  
_menuButtons;


:)



Allandt Bik-Elliott (Receptacle) wrote:

should that be:?

var clip:* = e.target;
var buttons:Array = _menuButtons;
(e.target.buttonType == 1) ? buttons = _subMenuButtons : buttons =  
_menuButtons;

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



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


Re: [Flashcoders] scrollbar for pure AS3 project

2008-07-01 Thread Allandt Bik-Elliott (Receptacle)

take a look at
http://www.kirupa.com/forum/showthread.php?t=245468

might help - it did me (i'm overbyte in the thread)

On 1 Jul 2008, at 08:55, Gregory N wrote:


Hello all,

I'm wokring on a project in FlashDevelop 3 ans Flex 2 SDK,  with  
pure AS3

project type.
And when it came to a scrollbar, I've got a problem :-)

The matter is
- Flex component requires SWF to be mxml-based
- Flash CS3 component requires component instance in the library
- and I don't have enough time to create my own code-only  
scrollbar from

scratch.

Are there some workaround for this? Mean loading/embedding an  
external  swf

with scrollbar etc...
OR
Can someone recommend a good code-only scrollbar for AS3 project?  
Free or

commercial - both are appropriate.



--
--
Best regards,
GregoryN

http://GOusable.com
Flash components development.
Usability services.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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


[Flashcoders] urgent as3 textfield scroll problem

2008-06-30 Thread Allandt Bik-Elliott (Receptacle)

i really hope someone can help me here

i have a textfield that is set up with a defaultTextFormat and has  
several setTextFormats applied to type within it but when i try to  
overflow it and add a scrollbar, i get no scroll result.


I've looked into it and it seems that no matter how much type goes in  
(either more or less), it shows that there are 4 lines (using  
TextField.numLines) in it.


i've included the method below and commented where the issue is -  
note that there is a textformat that is applied if the elCredit  
property is set that is the thing that seems to be the problem: when  
it is added, the numLines traces to the actual number of lines (and  
the scrollbar works) but when it doesn't get used, numLines is 4  
regardless of content and the scrollbar doesn't work


please help as i'm really stumped on this issue

thankyou
a

private function createBase():void
{
elBase = new Sprite();
elBase.graphics.beginFill(commonGrey, 1);
elBase.graphics.drawRect(0, 0, elWidth, elHeight);
elBase.x = elX;
elBase.y = elY;

var dropShadow:DropShadowFilter = new 
DropShadowFilter();
dropShadow.color = 0x00;
dropShadow.blurX = 10;
dropShadow.blurY = 10;
dropShadow.angle = 135;
dropShadow.alpha = .5;
dropShadow.distance = 10;
var filtersArray:Array = new Array(dropShadow);
elBase.filters = filtersArray;

var close_btn:Sprite = new Sprite();
close_btn.buttonMode = true;
close_btn.graphics.lineStyle(1, 0x33, 1);
close_btn.graphics.beginFill(0xFF);
close_btn.graphics.drawRect(0, 0, 10, 10);
close_btn.addEventListener(MouseEvent.CLICK, 
closeBtnListener);
close_btn.x = elWidth -15;
close_btn.y = 5;

var popupNotice_txt:String = Click image to zoom 
in/out.;
			var popupNotice:SimpleTextField = new SimpleTextField(0xFF,  
12, headingFont, 5, 2, textWidth, textHeight, popupNotice_txt, true);


var txt:String  = elTitle +\n;
txt += elDate +\n;
txt += elText +\n;
if (elCredit != \nPicture credit: ) txt += elCredit;
textWidth   -= 15;


// this is the textfield

			var elTextField:SimpleTextField = new SimpleTextField(0x00,  
12, mainFont, textX, textY, textWidth, textHeight, txt);

elTextField.wordWrap = true;
elTextField.multiline = true;

var eltfScrollbar:UIScrollBar = new UIScrollBar();
eltfScrollbar.scrollTarget = elTextField;
eltfScrollbar.move(elTextField.x+elTextField.width, 
elTextField.y);
eltfScrollbar.height = elTextField.height;

var titleFormat:TextFormat = new TextFormat();
titleFormat.font = headingFont;
titleFormat.size = 16;
titleFormat.leading = 0;
titleFormat.color = 0xFF;

var dateFormat:TextFormat = new TextFormat();
dateFormat.font = subheadingFont;
dateFormat.size = 14;
dateFormat.leading = 6;
dateFormat.color = 0xFF;

var creditFormat:TextFormat = new TextFormat();
creditFormat.size = 9;
creditFormat.color = 0x33;

var titleItalicFormat:TextFormat = new TextFormat();
titleItalicFormat.font = headingItalicFont;

var bodyItalicFormat:TextFormat = new TextFormat();
bodyItalicFormat.font = mainItalicFont;


var titleLength:int = int(elTitle.length) +1;
var dateLength:int  = int(elDate.length) + titleLength 
+1;
var totalLength:int = int(txt.length);
var textLength:int  = totalLength - 
int(elCredit.length);

elTextField.setTextFormat(titleFormat, 0, titleLength);

Re: [Flashcoders] urgent as3 textfield scroll problem

2008-06-30 Thread Allandt Bik-Elliott (Receptacle)
i should probably mention that the same object is used for several  
instances but it's just the one that doesn't use the elCreditFormat  
TextFormat that fails to scroll


thanks
a


On 30 Jun 2008, at 15:10, Allandt Bik-Elliott (Receptacle) wrote:


i really hope someone can help me here

i have a textfield that is set up with a defaultTextFormat and has  
several setTextFormats applied to type within it but when i try to  
overflow it and add a scrollbar, i get no scroll result.


I've looked into it and it seems that no matter how much type goes  
in (either more or less), it shows that there are 4 lines (using  
TextField.numLines) in it.


i've included the method below and commented where the issue is -  
note that there is a textformat that is applied if the elCredit  
property is set that is the thing that seems to be the problem:  
when it is added, the numLines traces to the actual number of lines  
(and the scrollbar works) but when it doesn't get used, numLines is  
4 regardless of content and the scrollbar doesn't work


please help as i'm really stumped on this issue

thankyou
a

private function createBase():void
{
elBase = new Sprite();
elBase.graphics.beginFill(commonGrey, 1);
elBase.graphics.drawRect(0, 0, elWidth, elHeight);
elBase.x = elX;
elBase.y = elY;

var dropShadow:DropShadowFilter = new 
DropShadowFilter();
dropShadow.color = 0x00;
dropShadow.blurX = 10;
dropShadow.blurY = 10;
dropShadow.angle = 135;
dropShadow.alpha = .5;
dropShadow.distance = 10;
var filtersArray:Array = new Array(dropShadow);
elBase.filters = filtersArray;

var close_btn:Sprite = new Sprite();
close_btn.buttonMode = true;
close_btn.graphics.lineStyle(1, 0x33, 1);
close_btn.graphics.beginFill(0xFF);
close_btn.graphics.drawRect(0, 0, 10, 10);
close_btn.addEventListener(MouseEvent.CLICK, 
closeBtnListener);
close_btn.x = elWidth -15;
close_btn.y = 5;

var popupNotice_txt:String = Click image to zoom 
in/out.;
			var popupNotice:SimpleTextField = new SimpleTextField(0xFF,  
12, headingFont, 5, 2, textWidth, textHeight, popupNotice_txt, true);


var txt:String  = elTitle +\n;
txt += elDate +\n;
txt += elText +\n;
if (elCredit != \nPicture credit: ) txt += elCredit;
textWidth   -= 15;


// this is the textfield

			var elTextField:SimpleTextField = new SimpleTextField(0x00,  
12, mainFont, textX, textY, textWidth, textHeight, txt);

elTextField.wordWrap = true;
elTextField.multiline = true;

var eltfScrollbar:UIScrollBar = new UIScrollBar();
eltfScrollbar.scrollTarget = elTextField;
eltfScrollbar.move(elTextField.x+elTextField.width, 
elTextField.y);
eltfScrollbar.height = elTextField.height;

var titleFormat:TextFormat = new TextFormat();
titleFormat.font = headingFont;
titleFormat.size = 16;
titleFormat.leading = 0;
titleFormat.color = 0xFF;

var dateFormat:TextFormat = new TextFormat();
dateFormat.font = subheadingFont;
dateFormat.size = 14;
dateFormat.leading = 6;
dateFormat.color = 0xFF;

var creditFormat:TextFormat = new TextFormat();
creditFormat.size = 9;
creditFormat.color = 0x33;

var titleItalicFormat:TextFormat = new TextFormat();
titleItalicFormat.font = headingItalicFont;

var bodyItalicFormat:TextFormat = new TextFormat();
bodyItalicFormat.font = mainItalicFont;


var titleLength:int = int(elTitle.length) +1;
var dateLength:int  = int(elDate.length) + titleLength 
+1

Re: [Flashcoders] urgent as3 textfield scroll problem

2008-06-30 Thread Allandt Bik-Elliott (Receptacle)
Hi - i found a way around this (by adding a body format as a  
setTextFormat even though it replicates the defaultTextFormat) but  
i'd really like to know if anyone has had similar problems and if  
this is a bug in the player or if there's a problem with my  
implementation


thanks again
a



On 30 Jun 2008, at 15:38, Allandt Bik-Elliott (Receptacle) wrote:

i should probably mention that the same object is used for several  
instances but it's just the one that doesn't use the elCreditFormat  
TextFormat that fails to scroll


thanks
a


On 30 Jun 2008, at 15:10, Allandt Bik-Elliott (Receptacle) wrote:


i really hope someone can help me here

i have a textfield that is set up with a defaultTextFormat and has  
several setTextFormats applied to type within it but when i try to  
overflow it and add a scrollbar, i get no scroll result.


I've looked into it and it seems that no matter how much type goes  
in (either more or less), it shows that there are 4 lines (using  
TextField.numLines) in it.


i've included the method below and commented where the issue is -  
note that there is a textformat that is applied if the elCredit  
property is set that is the thing that seems to be the problem:  
when it is added, the numLines traces to the actual number of  
lines (and the scrollbar works) but when it doesn't get used,  
numLines is 4 regardless of content and the scrollbar doesn't work


please help as i'm really stumped on this issue

thankyou
a

private function createBase():void
{
elBase = new Sprite();
elBase.graphics.beginFill(commonGrey, 1);
elBase.graphics.drawRect(0, 0, elWidth, elHeight);
elBase.x = elX;
elBase.y = elY;

var dropShadow:DropShadowFilter = new 
DropShadowFilter();
dropShadow.color = 0x00;
dropShadow.blurX = 10;
dropShadow.blurY = 10;
dropShadow.angle = 135;
dropShadow.alpha = ..5;
dropShadow.distance = 10;
var filtersArray:Array = new Array(dropShadow);
elBase.filters = filtersArray;

var close_btn:Sprite = new Sprite();
close_btn.buttonMode = true;
close_btn.graphics.lineStyle(1, 0x33, 1);
close_btn.graphics.beginFill(0xFF);
close_btn.graphics.drawRect(0, 0, 10, 10);
close_btn.addEventListener(MouseEvent.CLICK, 
closeBtnListener);
close_btn.x = elWidth -15;
close_btn.y = 5;

var popupNotice_txt:String = Click image to zoom 
in/out.;
			var popupNotice:SimpleTextField = new SimpleTextField(0xFF,  
12, headingFont, 5, 2, textWidth, textHeight, popupNotice_txt, true);


var txt:String  = elTitle +\n;
txt += elDate +\n;
txt += elText +\n;
if (elCredit != \nPicture credit: ) txt += elCredit;
textWidth   -= 15;


// this is the textfield

			var elTextField:SimpleTextField = new SimpleTextField(0x00,  
12, mainFont, textX, textY, textWidth, textHeight, txt);

elTextField.wordWrap = true;
elTextField.multiline = true;

var eltfScrollbar:UIScrollBar = new UIScrollBar();
eltfScrollbar.scrollTarget = elTextField;
			eltfScrollbar.move(elTextField.x+elTextField.width,  
elTextField.y);

eltfScrollbar.height = elTextField.height;

var titleFormat:TextFormat = new TextFormat();
titleFormat.font = headingFont;
titleFormat.size = 16;
titleFormat.leading = 0;
titleFormat.color = 0xFF;

var dateFormat:TextFormat = new TextFormat();
dateFormat.font = subheadingFont;
dateFormat.size = 14;
dateFormat.leading = 6;
dateFormat.color = 0xFF;

var creditFormat:TextFormat = new TextFormat();
creditFormat.size = 9;
creditFormat.color = 0x33;

var titleItalicFormat:TextFormat = new TextFormat();
titleItalicFormat.font = headingItalicFont

Re: [Flashcoders] Drag and Snapping

2008-06-30 Thread Allandt Bik-Elliott (Receptacle)
without any context it's a little difficult to answer - could you  
post your code?



On 30 Jun 2008, at 17:57, Lehr, Theodore M (N-SGIS) wrote:


I have a mc that I am dragging... when I click on it - it snaps to 0,0
of the movie... I do not remember running into this before How  
can I
make it so it does not snap to a coordinate, but just stays where  
it is?


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




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


Re: [Flashcoders] Saffron Modeler - what happened to it

2008-06-30 Thread Allandt Bik-Elliott (Receptacle)
do these frameworks use any particular design patterns or are they  
set up differently?


a

On 30 Jun 2008, at 17:11, Sidney de Koning wrote:

there is loads of activity on sam's twitter account http:// 
twitter.com/SamuelAgesilas


S.

On Jun 30, 2008, at 6:05 PM, Jiri Heitlager wrote:

Does somebody know what happend to the saffron UML modelling tool.  
The site http://www.levelofindustry.com/

is not showing any update anymore.

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



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



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


[Flashcoders] question re: path for nested movies

2008-06-27 Thread Allandt Bik-Elliott (Receptacle)

Hi folks

i have a quick question regarding pathing for a streaming flv.

i have a banner swf that streams an flv which is loaded into another  
swf that rotates several banners randomly - so my total structure is:


html page
   |
banner player swf
   |
banner swf
   |
netstream flv

if i want to use a relative path for the flv, would i do it from the  
html page or would you just recommend that i use an absolute path to  
the flv and be done with it?


thanks
a

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


Re: [Flashcoders] question re: path for nested movies

2008-06-27 Thread Allandt Bik-Elliott (Receptacle)

thanks for the advice, guys

alz


On 27 Jun 2008, at 10:50, Kenneth Kawamoto wrote:


Use loaderInfo.url as the base and create paths relative to that.

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Allandt Bik-Elliott (Receptacle) wrote:

Hi folks
i have a quick question regarding pathing for a streaming flv.
i have a banner swf that streams an flv which is loaded into  
another swf that rotates several banners randomly - so my total  
structure is:

html page
   |
banner player swf
   |
banner swf
   |
netstream flv
if i want to use a relative path for the flv, would i do it from  
the html page or would you just recommend that i use an absolute  
path to the flv and be done with it?

thanks
a

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




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


[Flashcoders] switch statement more efficient than if...else?

2008-06-25 Thread Allandt Bik-Elliott (Receptacle)

Hi guys

quick question that came up in a conversation I had the other day -  
are switch statements more or less efficient than a series of  
if...else statements in either AS2 or AS3?


I'd always thought that the most efficient was the switch

al.z

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


Re: [Flashcoders] switch statement more efficient than if...else?

2008-06-25 Thread Allandt Bik-Elliott (Receptacle)

hey

thanks for all of your responses

al.z


On 25 Jun 2008, at 16:24, Juan Pablo Califano wrote:

I doubt there's a noticeable difference between a switch and a  
series of if

/else if statements.

In AS 3.0 bytecode, though, switches and equivalent conditionals  
are not
necessarily compiled into the same bytecode. In fact, there's a  
lookupswitch
instruction (opcode 0x1b). Of course, any switch can be implemented  
as a
series of if / else if statements, but that's up to the compiler.  
From my
(limited) experience, the Flash IDE always uses a switch bytecode  
whenever

it finds a switch construct in Actionscript code. I don't know how it
affects runtime performance, but my guess is that it doesn't have much
impact. And, thinking about it, maybe that opcode exists because  
it's an

optimized way to compile / execute a series of related conditions.

Cheers
Juan Pablo Califano


2008/6/25, eric e. dolecki [EMAIL PROTECTED]:


Switch/case is a bit quicker.

On Wed, Jun 25, 2008 at 10:12 AM, Allandt Bik-Elliott (Receptacle) 
[EMAIL PROTECTED] wrote:


Hi guys

quick question that came up in a conversation I had the other day  
- are

switch statements more or less efficient than a series of if...else
statements in either AS2 or AS3?

I'd always thought that the most efficient was the switch

al.z

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


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


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




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


[Flashcoders] expanding pages with flash and javascript

2008-06-01 Thread Allandt Bik-Elliott (Receptacle)
has anyone used or know of any really good page expanders for flash/ 
javascript - i guess it would use an external interface call - either  
as2 or as3 - i'd like to have a textfield that extends the html page  
it's in to it's total height but i'm not really good with javascript


thanks
al


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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-18 Thread Allandt Bik-Elliott (Receptacle)

wow - i'll get my coat

must have been a late one

thanks zeh


On 18 May 2008, at 00:38, Zeh Fernando wrote:


screenResX:Number = Capabilities.screenResolutionX;


Are you really doing this?

Does it have a var in front of the code?


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




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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-18 Thread Allandt Bik-Elliott (Receptacle)

okay, in spite of my typo, i'm still getting strange behaviour

If I do this:

stage.displayState  = StageDisplayState.FULL_SCREEN;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var screenScaleX:Number = Capabilities.screenResolutionX /  
stage.stageWidth;
var screenScaleY:Number = Capabilities.screenResolutionY /  
stage.stageHeight;

this.scaleX = screenScaleX;
this.scaleY = screenScaleY;

and test from the flash IDE, fullscreen doesn't work (which it  
shouldn't within flash) but the movie will scale up to the full size  
of the screen (baby steps) so everything is as it should be


but

when i export the movie to a projector and run it, the movie runs in  
full screen but doesn't scale up to the size of the screen.


however

if i use this in my code
this.scaleX = 2;
this.scaleY = 2;

ie if i hardcode the numbers and publish the projector, the movie  
scales up as it should. Is there a timing issue with  
screenResolutionX that I need to take into account?


thanks for your help so far guys
Allandt


On 18 May 2008, at 00:38, Zeh Fernando wrote:


screenResX:Number = Capabilities.screenResolutionX;


Are you really doing this?

Does it have a var in front of the code?


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




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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-18 Thread Allandt Bik-Elliott (Receptacle)

that's great - thanks a lot

a


On 18 May 2008, at 12:45, Muzak wrote:

Is there a timing issue with  screenResolutionX that I need to  
take into account?


Yes there is.
You're probably better off listening for  
FullScreenEvent.FULL_SCREEN and do the proper scaling there in the  
event handler.


http://livedocs.adobe.com/flash/9.0/main/0150.html


- Original Message - From: Allandt Bik-Elliott  
(Receptacle) [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Sunday, May 18, 2008 11:55 AM
Subject: Re: [Flashcoders] StageDisplayState.FULL_SCREEN



okay, in spite of my typo, i'm still getting strange behaviour
If I do this:
stage.displayState = StageDisplayState.FULL_SCREEN;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var screenScaleX:Number = Capabilities.screenResolutionX /   
stage.stageWidth;
var screenScaleY:Number = Capabilities.screenResolutionY /   
stage.stageHeight;

this.scaleX = screenScaleX;
this.scaleY = screenScaleY;
and test from the flash IDE, fullscreen doesn't work (which it   
shouldn't within flash) but the movie will scale up to the full  
size  of the screen (baby steps) so everything is as it should be

but
when i export the movie to a projector and run it, the movie runs  
in  full screen but doesn't scale up to the size of the screen.

however
if i use this in my code
this.scaleX = 2;
this.scaleY = 2;
ie if i hardcode the numbers and publish the projector, the movie   
scales up as it should. Is there a timing issue with   
screenResolutionX that I need to take into account?

thanks for your help so far guys
Allandt


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




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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-17 Thread Allandt Bik-Elliott (Receptacle)

anyone have any ideas about this please?

is it maybe throwing up an issue with the get method?



On 16 May 2008, at 18:48, Allandt Bik-Elliott (Receptacle) wrote:

okay - i'm trying to get this to work but  
Capabilities.screenResolutionX is a strange beast


when i run the following traces, i get the following results

			trace (screen resolution is type +typeof 
(Capabilities.screenResolutionX)); // traces number
			trace (resolution x is +Capabilities.screenResolutionX);  //  
traces 1600

trace (stage width is +stage.stageWidth);  // traces 
800
trace (this.scaleX);  // traces 1

but if i try to use the screenResolutionX as a number, i get a  
coercion error:


screenResX:Number = Capabilities.screenResolutionX;

outputs:
1067: Implicit coercion of a value of type Number to an unrelated  
type Class.

1188: Illegal assignment to class Number.

can anyone tell me why this would be and what i can do to get  
around it? I've tried casting it' as Number' but that didn't work  
and according to the typeof trace, it isn't necessary


thanks
a








On 16 May 2008, at 17:25, Romuald Quantin wrote:

I guess it is, I enclosed a quick try (open the FLA and shift +  
F12 to get

the EXE).

Here is the code:

stage.displayState = StageDisplayState.FULL_SCREEN;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
mc.x = stage.stageWidth * .5;
mc.y = stage.stageHeight * .5;
mc.width = stage.stageWidth * .8;
mc.height = stage.stageHeight * .8;

your movie is scaled to 80% of the screen, be careful as if you  
leave the
fullscreen mode, it is not working anymore, you'll need to test  
the state
and apply other settings in case the user is not in fullscreen  
anymore.


the mc is your content, centered in my try... if you don't want  
you main

centered as I did, I think you'll have to test the user resolution:
http://www.webzo.org/tutorials/flash/user-resolution-detection.php
and then calculate the 20% gap in pixels to change the width,  
height, x, y

of your content.

Well, just a hint but it might possible, I hope it helps.

Romu
www.soundstep.com



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of  
Allandt

Bik-Elliott (Receptacle)
Sent: 16 May 2008 16:42
To: Flash Coders List
Subject: Re: [Flashcoders] StageDisplayState.FULL_SCREEN

The movie was originally supposed to be fixed but the client has
asked for me to make it scale

I'd like the movie to scale to about 80% of the screen size rather
than 100% - is this possible?


On 16 May 2008, at 16:12, Romuald Quantin wrote:


If the swf size is fixed and you activate fullscreen, it should
work as
expected. Sorry I don't have any source code example but I think
I've done
it. But around the movie you'll get the color set for the SWF,
meaning if
you want you fixed SWF sitting on a nice gradient background, I
don't think
it is possible...

If I remember well, better trying to be sure.

Let us know.

Romu

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Allandt
Bik-Elliott (Receptacle)
Sent: 16 May 2008 15:52
To: flashcoders
Subject: [Flashcoders] StageDisplayState.FULL_SCREEN

is it possible to set a projector to show in fullscreen but reduce
the actual movie to, say, 80% of the total screen size?

Basically I have a projector that I've been working on but the  
client

has asked that rather than have the window not scale within the
screen (which I was using stage.scaleMode = StageScaleMode.NO_SCALE
for), they'd like the movie to scale up to the screen size. The
problem with this is that it can be rather over-powering as it's not
really been designed for this kind of view.

So my thinking is that I'd like it to scale to about 80% of the
screen size with the rest being a neutral border

is this possible?

thanks
Allandt

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

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




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




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




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


[Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-16 Thread Allandt Bik-Elliott (Receptacle)
is it possible to set a projector to show in fullscreen but reduce  
the actual movie to, say, 80% of the total screen size?


Basically I have a projector that I've been working on but the client  
has asked that rather than have the window not scale within the  
screen (which I was using stage.scaleMode = StageScaleMode.NO_SCALE  
for), they'd like the movie to scale up to the screen size. The  
problem with this is that it can be rather over-powering as it's not  
really been designed for this kind of view.


So my thinking is that I'd like it to scale to about 80% of the  
screen size with the rest being a neutral border


is this possible?

thanks
Allandt

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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-16 Thread Allandt Bik-Elliott (Receptacle)
The movie was originally supposed to be fixed but the client has  
asked for me to make it scale


I'd like the movie to scale to about 80% of the screen size rather  
than 100% - is this possible?



On 16 May 2008, at 16:12, Romuald Quantin wrote:

If the swf size is fixed and you activate fullscreen, it should  
work as
expected. Sorry I don't have any source code example but I think  
I've done
it. But around the movie you'll get the color set for the SWF,  
meaning if
you want you fixed SWF sitting on a nice gradient background, I  
don't think

it is possible...

If I remember well, better trying to be sure.

Let us know.

Romu

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of  
Allandt

Bik-Elliott (Receptacle)
Sent: 16 May 2008 15:52
To: flashcoders
Subject: [Flashcoders] StageDisplayState.FULL_SCREEN

is it possible to set a projector to show in fullscreen but reduce
the actual movie to, say, 80% of the total screen size?

Basically I have a projector that I've been working on but the client
has asked that rather than have the window not scale within the
screen (which I was using stage.scaleMode = StageScaleMode.NO_SCALE
for), they'd like the movie to scale up to the screen size. The
problem with this is that it can be rather over-powering as it's not
really been designed for this kind of view.

So my thinking is that I'd like it to scale to about 80% of the
screen size with the rest being a neutral border

is this possible?

thanks
Allandt

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

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




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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-16 Thread Allandt Bik-Elliott (Receptacle)

would the resize event fire if the stage is set to NO_SCALE?

it doesn't seem to be working for me

On 16 May 2008, at 17:11, Glen Pike wrote:


  stage.addEventListener(Event.RESIZE, redraw);


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


Re: [Flashcoders] StageDisplayState.FULL_SCREEN

2008-05-16 Thread Allandt Bik-Elliott (Receptacle)
okay - i'm trying to get this to work but  
Capabilities.screenResolutionX is a strange beast


when i run the following traces, i get the following results

			trace (screen resolution is type +typeof 
(Capabilities.screenResolutionX)); // traces number
			trace (resolution x is +Capabilities.screenResolutionX);  //  
traces 1600

trace (stage width is +stage.stageWidth);  // traces 
800
trace (this.scaleX);  // traces 1

but if i try to use the screenResolutionX as a number, i get a  
coercion error:


screenResX:Number = Capabilities.screenResolutionX;

outputs:
1067: Implicit coercion of a value of type Number to an unrelated  
type Class.

1188: Illegal assignment to class Number.

can anyone tell me why this would be and what i can do to get around  
it? I've tried casting it' as Number' but that didn't work and  
according to the typeof trace, it isn't necessary


thanks
a








On 16 May 2008, at 17:25, Romuald Quantin wrote:

I guess it is, I enclosed a quick try (open the FLA and shift + F12  
to get

the EXE).

Here is the code:

stage.displayState = StageDisplayState.FULL_SCREEN;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
mc.x = stage.stageWidth * .5;
mc.y = stage.stageHeight * .5;
mc.width = stage.stageWidth * .8;
mc.height = stage.stageHeight * .8;

your movie is scaled to 80% of the screen, be careful as if you  
leave the
fullscreen mode, it is not working anymore, you'll need to test the  
state
and apply other settings in case the user is not in fullscreen  
anymore.


the mc is your content, centered in my try... if you don't want you  
main

centered as I did, I think you'll have to test the user resolution:
http://www.webzo.org/tutorials/flash/user-resolution-detection.php
and then calculate the 20% gap in pixels to change the width,  
height, x, y

of your content.

Well, just a hint but it might possible, I hope it helps.

Romu
www.soundstep.com



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of  
Allandt

Bik-Elliott (Receptacle)
Sent: 16 May 2008 16:42
To: Flash Coders List
Subject: Re: [Flashcoders] StageDisplayState.FULL_SCREEN

The movie was originally supposed to be fixed but the client has
asked for me to make it scale

I'd like the movie to scale to about 80% of the screen size rather
than 100% - is this possible?


On 16 May 2008, at 16:12, Romuald Quantin wrote:


If the swf size is fixed and you activate fullscreen, it should
work as
expected. Sorry I don't have any source code example but I think
I've done
it. But around the movie you'll get the color set for the SWF,
meaning if
you want you fixed SWF sitting on a nice gradient background, I
don't think
it is possible...

If I remember well, better trying to be sure.

Let us know.

Romu

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Allandt
Bik-Elliott (Receptacle)
Sent: 16 May 2008 15:52
To: flashcoders
Subject: [Flashcoders] StageDisplayState.FULL_SCREEN

is it possible to set a projector to show in fullscreen but reduce
the actual movie to, say, 80% of the total screen size?

Basically I have a projector that I've been working on but the client
has asked that rather than have the window not scale within the
screen (which I was using stage.scaleMode = StageScaleMode.NO_SCALE
for), they'd like the movie to scale up to the screen size. The
problem with this is that it can be rather over-powering as it's not
really been designed for this kind of view.

So my thinking is that I'd like it to scale to about 80% of the
screen size with the rest being a neutral border

is this possible?

thanks
Allandt

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

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




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




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


[Flashcoders] alpha not working on mc with textfield

2008-05-13 Thread Allandt Bik-Elliott (Receptacle)
Hi guys - this is probably something really obvious but it's got me a  
bit stumped (sorry it's a little OT but i can't find any answers)


I have several movieclips containing a static textfield with text in  
using a font that I've already embedded for actionscript use (it has  
a * after it's name). I've motion tweened these to move across the  
screen, starting at 0 alpha and becoming 100 alpha at the end of the  
tween (so movement and alpha tween).


The problem is that the alpha doesn't seem to be working. I've  
replaced the type with a random shape and the alpha works again so it  
seems to be something to do with the embedding but I'm not sure what.


hope you can help
obie
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] alpha not working on mc with textfield

2008-05-13 Thread Allandt Bik-Elliott (Receptacle)

thanks for the response

i'm using the version with the asterisk after the name


On 13 May 2008, at 17:02, Rich Shupe wrote:

Obie, have you made sure the fields are using the embedded version  
of the
font? Just embedding the font doesn't do anything. After embedding,  
you need

to switch the font from the system version to the embedded version.

Because you mentioned several clips, you can do this globally (if  
desired)

using Find and Replace.


On 5/13/08 10:51 AM, Allandt Bik-Elliott (Receptacle) wrote:


Hi guys - this is probably something really obvious but it's got me a
bit stumped (sorry it's a little OT but i can't find any answers)

I have several movieclips containing a static textfield with text in
using a font that I've already embedded for actionscript use (it has
a * after it's name). I've motion tweened these to move across the
screen, starting at 0 alpha and becoming 100 alpha at the end of the
tween (so movement and alpha tween).

The problem is that the alpha doesn't seem to be working. I've
replaced the type with a random shape and the alpha works again so it
seems to be something to do with the embedding but I'm not sure what.

hope you can help
obie


Rich
http://www.LearningActionScript3.com


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




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


Re: [Flashcoders] Why is good to extend an Event Class

2008-05-06 Thread Allandt Bik-Elliott (Receptacle)
i used a scrollbar class from the kirupa forum that extended the  
event class to accept the amount (in percent) that the bar was  
scrolling by - this allowed both the scrollbar and the scrolling  
object to receive the percent by listening to the event




On 6 May 2008, at 17:21, Dwayne Neckles wrote:


Why is it good to extend the Event Class in your application?

I understand that you can create your own events with it that are  
specific

to your app but does anyone have any good tutorials/articles on this?
I am a visual learner and I don't get it fully just yet..
Meanwhile I'll keep searching..

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




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


Re: [Flashcoders] component skinning issue

2008-04-11 Thread Allandt Bik-Elliott (Receptacle)

wow - that's quite a wierd decision for adobe

thanks for the response - that's really helpful

best
a



On 11 Apr 2008, at 16:01, Andres Garcia wrote:

this was the function I modified (setSize values)... Must be  
similar in the component you are using... for a strange reason  
those params values are hard coded... really bad!




override protected function configUI():void {
super.configUI();

thumb = new BaseButton();
thumb.setSize(14, 20);
thumb.autoRepeat = false;
addChild(thumb);

			thumb.addEventListener 
(MouseEvent.MOUSE_DOWN,thumbPressHandler,false,0,true);


track = new BaseButton();
track.move(0, 0);
track.setSize(80, 2);
track.autoRepeat = false;
track.useHandCursor = false;

track.addEventListener(MouseEvent.CLICK,onTrackClick,false,0,true);
addChildAt(track,0);
}


On Apr 11, 2008, at 8:55 AM, Allandt Bik-Elliott (Receptacle) wrote:


hi - just a quickie here

if i change the size of a button in a component skin in my library  
(UIScrollBar in this case) and then test the movie, the button is  
stretched back to it's original size - can someone tell me what i  
should be looking at to correct this please?


thanks guys
a

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


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




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


Re: [Flashcoders] embedded fonts

2008-04-04 Thread Allandt Bik-Elliott (Receptacle)

thanks - that was helpful


On 4 Apr 2008, at 10:47, Meinte van't Kruis wrote:


as for font strangeness, this page is very helpful;

http://www.connectedpixel.com/blog/fonts/embedding

On Thu, Apr 3, 2008 at 7:13 PM, Kenneth Kawamoto  
[EMAIL PROTECTED]

wrote:

For embedded fonts you can either use the actual font name (as you  
have

discovered it already), or YourFontClass.fontName

Kenneth Kawamoto
http://www.materiaprima.co.uk/


Allandt Bik-Elliott (Receptacle) wrote:


wotcha

i have a quick query about embedded fonts.

I thought that when you used them in the movie, that you should call
them by the Class name in the linkage identifier however when I  
try to do
this, my text disappears (i have embedFonts set to true and I've  
triple
checked the names), however when i use the font's original name,  
export,
close the fonts and then open the swf, everything works as it  
should.


Was I originally wrong or is there something screwy going on with  
this?


examples:

original font: Helvetica 75 Bold
Linkage class name: Helvetica75Bold
Name used as .font property: Helvetica75Bold // causes text to
disappear
Name used as .font property: Helvetica 75 Bold // causes text to
reappear

original font: Helvetica with B selected
Linkage class name: HelveticaBold
Name used as .font property: HelveticaBold // causes text to  
disappear

Name used as .font property: Helvetica // causes text to reappear

hope you can help because this doesn't seem right to me.

thanks
a


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





--
M.A. van't Kruis
http://www.malatze.nl/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




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


[Flashcoders] is there a maximum filename length for pc?

2008-04-04 Thread Allandt Bik-Elliott (Receptacle)
i am creating a hybrid cd for mac and pc and, while the mac can take  
ridiculously long filenames, will the pc be able to see them or will  
they be truncated to 25 characters?


I don't want some of my images to become unreadable on one side or  
the other


thanks

al


Allandt Bik-Elliott
thefieldcomic.com

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


Re: [Flashcoders] is there a maximum filename length for pc?

2008-04-04 Thread Allandt Bik-Elliott (Receptacle)

ah cool - thanks for the heads up


On 4 Apr 2008, at 18:07, Ibrahim Y wrote:


this article may help you
http://labnol.blogspot.com/2006/10/limitations-with-long-file-names- 
on.html



Ibrahim

On Fri, Apr 4, 2008 at 7:32 PM, Allandt Bik-Elliott (Receptacle) 
[EMAIL PROTECTED] wrote:


i am creating a hybrid cd for mac and pc and, while the mac can take
ridiculously long filenames, will the pc be able to see them or  
will they be

truncated to 25 characters?

I don't want some of my images to become unreadable on one side or  
the

other

thanks

al


Allandt Bik-Elliott
thefieldcomic.com

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


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




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


Re: [Flashcoders] maximum length of an xml document?

2008-04-04 Thread Allandt Bik-Elliott (Receptacle)
yeh i'm using as3 - i've run a trace on the xml and it seems to pull  
it all in okay so i'm going to go with it


thanks for the input

a


On 4 Apr 2008, at 19:30, Jason Van Cleave wrote:

in my experience the problem wasn't loading it but having the  
script time

out trying to work with it.

AS3 expoentially faster if you have a choice.

On Thu, Apr 3, 2008 at 3:09 PM, Allandt Bik-Elliott (Receptacle) 
[EMAIL PROTECTED] wrote:

can anyone tell me what the maximum length i can go to is for an  
xml file

to load into flash?

i'm working on a biggie

ta
a

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


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




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


[Flashcoders] embedded fonts

2008-04-03 Thread Allandt Bik-Elliott (Receptacle)

wotcha

i have a quick query about embedded fonts.

I thought that when you used them in the movie, that you should call  
them by the Class name in the linkage identifier however when I try  
to do this, my text disappears (i have embedFonts set to true and  
I've triple checked the names), however when i use the font's  
original name, export, close the fonts and then open the swf,  
everything works as it should.


Was I originally wrong or is there something screwy going on with this?

examples:

original font: Helvetica 75 Bold
Linkage class name: Helvetica75Bold
Name used as .font property: Helvetica75Bold // causes text to  
disappear
Name used as .font property: Helvetica 75 Bold // causes text to  
reappear


original font: Helvetica with B selected
Linkage class name: HelveticaBold
Name used as .font property: HelveticaBold // causes text to disappear
Name used as .font property: Helvetica // causes text to reappear

hope you can help because this doesn't seem right to me.

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


Re: [Flashcoders] embedded fonts

2008-04-03 Thread Allandt Bik-Elliott (Receptacle)
have you tried doing what i did and using the actual font name as  
the .font property rather than the linkage class name?


it's removing the text because it can't find the font


On 3 Apr 2008, at 17:04, Stuart ((FunkDaWeb)) wrote:

I too have a wierd problem with embeded fonts! When i set  
embededFont = true; it removes the text! :o(

  - Original Message -
  From: Allandt Bik-Elliott (Receptacle)
  To: flashcoders
  Sent: Thursday, April 03, 2008 4:50 PM
  Subject: [Flashcoders] embedded fonts


  wotcha

  i have a quick query about embedded fonts.

  I thought that when you used them in the movie, that you should call
  them by the Class name in the linkage identifier however when I try
  to do this, my text disappears (i have embedFonts set to true and
  I've triple checked the names), however when i use the font's
  original name, export, close the fonts and then open the swf,
  everything works as it should.

  Was I originally wrong or is there something screwy going on with  
this?


  examples:

  original font: Helvetica 75 Bold
  Linkage class name: Helvetica75Bold
  Name used as .font property: Helvetica75Bold // causes text to
  disappear
  Name used as .font property: Helvetica 75 Bold // causes text to
  reappear

  original font: Helvetica with B selected
  Linkage class name: HelveticaBold
  Name used as .font property: HelveticaBold // causes text to  
disappear

  Name used as .font property: Helvetica // causes text to reappear

  hope you can help because this doesn't seem right to me.

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




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


[Flashcoders] maximum length of an xml document?

2008-04-03 Thread Allandt Bik-Elliott (Receptacle)
can anyone tell me what the maximum length i can go to is for an xml  
file to load into flash?


i'm working on a biggie

ta
a

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


Re: [Flashcoders] Access

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)

have you tried without the line public var mc_one:MovieClip;?

it's my understanding that instantiating it by physically dragging it  
out of the library and giving it an instance name is the declaration  
- the way you're doing it would give a local variable the name with  
no value, hence mc_one = null


a

On 2 Apr 2008, at 11:53, Stuart ((FunkDaWeb)) wrote:


Hello,

I'm having some trouble with AS3, basically if I create a movieclip  
using the Flash IDE and give it an instance name of mc_one, I'm  
unsure how to access it from an external actionscript class.


Currently on the root timeline I have...

var _mainClass:mainClass = new mainClass();

Which instantiates the mainClass and within the class I need to  
access mc_one, but obviously _root.mc_one will no longer work.


I have tried this:

/* ... */
public class mainClass {
public var mc_one:MovieClip;

public function mainClass()
{

trace(mc_one); // Outputs null

}
}

The trouble is this solution does not work, it outputs null rather  
than [Object MovieClip]


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




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


[Flashcoders] how to check if child exists

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)

hmmm - i'm a little stuck on this

i'm trying to create a pop-up (will tween but i want to get it  
working first) but i want it to kill any previous one that's up - how  
would i go about this please?


here's my current code:
CODE
private function createEventList(pbList_xl:XMLList):void
{
			if (this.contains(eventList)) removeChild(eventList); // remove  
previous eventList if it's available - this is the bit that needs fixing

var listLength:int  = pbList_xl.length();
var listentryHeight:int = 15;
var listHeight:int  = listLength * 
listentryHeight;
var listWidth:int   = 50;
			var mousePoint:Point	= new Point(root.mouseX, root.mouseY); //  
will tween from this point to a central point on the stage


var eventList:Sprite = new Sprite();
eventList.graphics.beginFill(commonGrey, 1);
eventList.graphics.drawRoundRect(0, 0, listWidth, 
listHeight, 10);
eventList.x = mousePoint.x;
eventList.y = mousePoint.y;

addChild(eventList);
}
/CODE

hope you can help

a


Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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


Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)
that's actually helped me implement a movieActive variable so i've  
decided to go down that route instead - thanks for the input


On 2 Apr 2008, at 16:35, Kenneth Kawamoto wrote:


Place outside of the function - private var eventList:Sprite;

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Allandt Bik-Elliott (Receptacle) wrote:

hmmm - i'm a little stuck on this
i'm trying to create a pop-up (will tween but i want to get it  
working first) but i want it to kill any previous one that's up -  
how would i go about this please?

here's my current code:
CODE
private function createEventList(pbList_xl:XMLList):void
{
if (this.contains(eventList)) removeChild 
(eventList); // remove previous eventList if it's available - this  
is the bit that needs fixing

var listLength:int = pbList_xl.length();
var listentryHeight:int = 15;
var listHeight:int = listLength *  
listentryHeight;

var listWidth:int= 50;
var mousePoint:Point= new Point(root.mouseX,  
root.mouseY); // will tween from this point to a central point on  
the stage

   var eventList:Sprite = new Sprite();
eventList.graphics.beginFill(commonGrey, 1);
eventList.graphics.drawRoundRect(0, 0, listWidth,  
listHeight, 10);

eventList.x = mousePoint.x;
eventList.y = mousePoint.y;
   addChild(eventList);
}
/CODE
hope you can help
a
Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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




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


Re: [Flashcoders] how to check if child exists

2008-04-02 Thread Allandt Bik-Elliott (Receptacle)
that said, i'd still like to know how to determine if a display  
object is in the current display list?


thanks
a


On 2 Apr 2008, at 16:35, Kenneth Kawamoto wrote:


Place outside of the function - private var eventList:Sprite;

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Allandt Bik-Elliott (Receptacle) wrote:

hmmm - i'm a little stuck on this
i'm trying to create a pop-up (will tween but i want to get it  
working first) but i want it to kill any previous one that's up -  
how would i go about this please?

here's my current code:
CODE
private function createEventList(pbList_xl:XMLList):void
{
if (this.contains(eventList)) removeChild 
(eventList); // remove previous eventList if it's available - this  
is the bit that needs fixing

var listLength:int = pbList_xl.length();
var listentryHeight:int = 15;
var listHeight:int = listLength *  
listentryHeight;

var listWidth:int= 50;
var mousePoint:Point= new Point(root.mouseX,  
root.mouseY); // will tween from this point to a central point on  
the stage

   var eventList:Sprite = new Sprite();
eventList.graphics.beginFill(commonGrey, 1);
eventList.graphics.drawRoundRect(0, 0, listWidth,  
listHeight, 10);

eventList.x = mousePoint.x;
eventList.y = mousePoint.y;
   addChild(eventList);
}
/CODE
hope you can help
a
Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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




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


Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Allandt Bik-Elliott (Receptacle)
ah yes - i couldn't get the mouseChildren to work before when i had  
drawn in the movieclip but now i've separated the container movieclip  
from the drawn-in shape, it' s working


thanks for your help guys

here's a copy of my code in case anyone else is interested:
CODE
// on xml load complete
private function periodCompleteListener(e:Event):void
{
periodXmlDoc = periodXmlLoader.doc;
trace (periodXmlDoc.toXMLString());

for each (var period:XML in periodXmlDoc.*)
{
createPeriodBar([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],  
[EMAIL PROTECTED]);

}
}

		private function createPeriodBar(dateStart:int, dateEnd:int,  
pbTitle:String, pbDate:String, pbList:Array = null):void

{
var pixelStart:int = yearsToPixels(dateStart);
var pixelEnd:int   = yearsToPixels(dateEnd);

var pbX:int = pixelStart;
var pbWidth:int = pixelEnd - pixelStart;

			var pbYStart:int = taTitleBarHeight + pbSpace; // start point for  
all period bars
			var pbY:int = pbYStart + pbGetY(dateStart, dateEnd) * (pbHeight 
+pbSpace);  // pbGetY(below) returns a level which is multiplied by  
the hight and the spacing


			var pbcontainer:MovieClip = new MovieClip(); // movieclip that  
holds a variable (rolloverText), textfield and shape

var pb:Shape = new Shape();

if (uint(dateEnd-dateStart)  1)
{
pb.graphics.beginFill(0xFF,.3);// white 50% 
alpha

pb.graphics.drawRoundRect(0,0,pbWidth,pbHeight,pbHeight);
pb.graphics.endFill();
pbcontainer.x = pbX;
pbcontainer.y = pbY;

var pbText:SimpleTextField = new SimpleTextField(0xFF, 14,  
headingFont, 4, -2, pbWidth-4, 25, pbTitle, false);

pbText.selectable = false;
pbText.text +=  ;
pbText.text += pbDate;
var pbf:TextFormat = new TextFormat();
pbf.font= 
subheadingFont;
pbf.size= 10;
var pbCurrentLength = 
pbTitle.length+1;
var pbDateLength= pbText.length;
pbText.setTextFormat(pbf, pbCurrentLength, 
pbDateLength);

pbcontainer.addChild(pbText);
pbcontainer.addChild(pb);
pbcontainer.mouseChildren = false;
} else
{
pb.graphics.beginFill(0xFF,.5);// white 50% 
alpha
pb.graphics.drawCircle(0,0,pbHeight/2);
pb.graphics.endFill();
pbcontainer.x = pbX;
pbcontainer.y = pbY+(pbHeight/2);

pbcontainer.addChild(pb);
}
pbcontainer.rolloverText = pbTitle + \n + pbDate;
			pbcontainer.addEventListener(MouseEvent.MOUSE_OVER,  
pbMouseOverListener);


scrollableBase.addChild(pbcontainer);
}

		// replaces the mousefollower.text with what's in the rolloverText  
variable

private function pbMouseOverListener(e:MouseEvent):void
{
mfTextField.text = e.target.rolloverText;
mouseFollower.visible = true;
}

		// this stacks the period bars automatically based on if the dates  
overlap

private function pbGetY(dateStart:int, dateEnd:int):int
{
var level:int = 0;
for (var i=0; ipreviousDateEnd_ar.length; i++)
{
if (dateStartpreviousDateEnd_ar[level])
{
previousDateEnd_ar[level] = dateEnd;
return level;
}
level++;
}
previousDateEnd_ar.push(dateEnd);

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Allandt Bik-Elliott (Receptacle)

thanks Jiri

i've just got the design patterns book so i'll be digging into that  
at some point in the near future


a

On 1 Apr 2008, at 10:40, Jiri Heitlager wrote:

I think the best way to learn about Event Bubbling is understanding  
the Composite desing pattern. This is the pattern the DisplayList  
is implementing and bubbling will make much more sense when you  
understand the workings of the Composite Pattern. At least it did  
for me.


Jiri

Steven Sacks wrote:
IMO, explaining Event Bubbling as the reason the TextField is the  
target is complicating the immediate solution he needs, which is  
mouseChildren = false.
Yes, it's Event Bubbling that's causing the target to be the  
TextField.  To understand Event Bubbling, read about it in the  
docs, or better yet, in a book (like Moock's).  But, then you MUST  
do it yourself to learn how it works.  If you don't play with it  
yourself, you will never get it no matter how much somebody  
explains it to you.  I'm fully convinced of that.  You gotta mess  
around with it to fully understand why it's so amazingly awesome.

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

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




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


Re: [Flashcoders] TextField.bottomScroll

2008-03-31 Thread Allandt Bik-Elliott (Receptacle)
yeh - put a bunch of br /'s in at the end because of this - i  
thought it was only html dynamic text that did this but i guess not.


Never found a solution
a


On 31 Mar 2008, at 14:05, Mendelsohn, Michael wrote:


Hi list...

I'm encountering a weird scenario where a TextField's bottom scroll
isn't being reported accurately.  It's tracing a number less what it
actually.  The end of the text in my TF was /r/r/r/r, and now I've
populated it to be something like /rtext/rtext/rtext/rtext, thinking
that would force the real value, but it's still inaccurate.  Anyone  
ever

encounter this?

Thanks,
- Michael M.

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




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


[Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Allandt Bik-Elliott (Receptacle)

hi guys

in actionscript 3, if i put a mouse event on a movieclip object  
containing a textfield, should the mouse event be on the movieclip or  
the textfield?


here's my code (comments added to see where the problem is occurring)
CODE
		private function createPeriodBar(dateStart:int, dateEnd:int,  
pbTitle:String, pbDate:String, pbList:Array = null):void

{
var pixelStart:int = yearsToPixels(dateStart);
var pixelEnd:int   = yearsToPixels(dateEnd);

var pbX:int = pixelStart;
var pbWidth:int = pixelEnd - pixelStart;

			var pbYStart:int = taTitleBarHeight + pbSpace; // sets the  
starting point for all periodBars
			var pbY:int = pbYStart + pbGetY(dateStart, dateEnd) * (pbHeight 
+pbSpace); // pbGetY is a separate function that automatically stacks  
the periodBars where they will fit without overlapping


			var pb:MovieClip = new MovieClip(); // was a sprite but sprites  
cannot have strings attached to them, eg my rolloverText variable


			if (uint(dateEnd-dateStart)  1) // if the difference between the  
start and end dates is more than 1

{
pb.graphics.beginFill(0xFF,.3);

pb.graphics.drawRoundRect(0,0,pbWidth,pbHeight,pbHeight);
pb.graphics.endFill();
pb.x = pbX;
pb.y = pbY;

var pbText:SimpleTextField = new SimpleTextField(0xFF, 14,  
headingFont, 4, -2, pbWidth-4, 25, pbTitle, false);
pbText.selectable = false; // tried making this non-selectable  
but it hasn't helped

pbText.text +=  ;
pbText.text += pbDate;
var pbf:TextFormat = new TextFormat();
pbf.font= 
subheadingFont;
pbf.size= 10;
var pbCurrentLength = 
pbTitle.length+1;
var pbDateLength= pbText.length;
pbText.setTextFormat(pbf, pbCurrentLength, 
pbDateLength);

pb.addChild(pbText);

} else {
// will create a dot instead of a box containing text if it will  
otherwise be too small to render a roundrect

pb.graphics.beginFill(0xFF,.5);
pb.graphics.drawCircle(0,0,pbHeight/2);
pb.graphics.endFill();
pb.x = pbX;
pb.y = pbY+(pbHeight/2);
}

pb.rolloverText = pbTitle + /n + pbDate;
pb.addEventListener(MouseEvent.MOUSE_OVER, 
pbMouseOverListener);

scrollableBase.addChild(pb);
}

private function pbMouseOverListener(e:MouseEvent):void
{
			mfTextField.text = e.target.rolloverText; // mfTextField is a  
textfield within a mousefollower
			trace (e.target); // traces simpleTextField if over a movieclip  
with a simpletextfield in otherwise traces movieclip
			trace (e.target.rolloverText); // gives error when over a  
simpletextfield but works properly when over a movieclip without, eg  
where the dates are too close and a dot is rendered instead

mouseFollower.visible = true;
}

because the movieclip isn't always the target (even tho i've set the  
mouseevent on the movieclip), i can't consistently get a reading from  
rolloverText (because it's trying to find the variable rolloverText  
in the pbText SimpleTextField)


can anyone explain why this is and what i can do to get around it  
please?


thanks a lot
a

Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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


[Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Allandt Bik-Elliott (Receptacle)

hi guys

in actionscript 3, if i put a mouse event on a movieclip object  
containing a textfield, should the mouse event be on the movieclip or  
the textfield?


here's my code (comments added to see where the problem is occurring)
CODE
		private function createPeriodBar(dateStart:int, dateEnd:int,  
pbTitle:String, pbDate:String, pbList:Array = null):void

{
var pixelStart:int = yearsToPixels(dateStart);
var pixelEnd:int   = yearsToPixels(dateEnd);

var pbX:int = pixelStart;
var pbWidth:int = pixelEnd - pixelStart;

			var pbYStart:int = taTitleBarHeight + pbSpace; // sets the  
starting point for all periodBars
			var pbY:int = pbYStart + pbGetY(dateStart, dateEnd) * (pbHeight 
+pbSpace); // pbGetY is a separate function that automatically stacks  
the periodBars where they will fit without overlapping


			var pb:MovieClip = new MovieClip(); // was a sprite but sprites  
cannot have strings attached to them, eg my rolloverText variable


			if (uint(dateEnd-dateStart)  1) // if the difference between the  
start and end dates is more than 1

{
pb.graphics.beginFill(0xFF,.3);

pb.graphics.drawRoundRect(0,0,pbWidth,pbHeight,pbHeight);
pb.graphics.endFill();
pb.x = pbX;
pb.y = pbY;

var pbText:SimpleTextField = new SimpleTextField(0xFF, 14,  
headingFont, 4, -2, pbWidth-4, 25, pbTitle, false);
pbText.selectable = false; // tried making this non-selectable  
but it hasn't helped

pbText.text +=  ;
pbText.text += pbDate;
var pbf:TextFormat = new TextFormat();
pbf.font= 
subheadingFont;
pbf.size= 10;
var pbCurrentLength = 
pbTitle.length+1;
var pbDateLength= pbText.length;
pbText.setTextFormat(pbf, pbCurrentLength, 
pbDateLength);

pb.addChild(pbText);

} else {
// will create a dot instead of a box containing text if it will  
otherwise be too small to render a roundrect

pb.graphics.beginFill(0xFF,.5);
pb.graphics.drawCircle(0,0,pbHeight/2);
pb.graphics.endFill();
pb.x = pbX;
pb.y = pbY+(pbHeight/2);
}

pb.rolloverText = pbTitle + /n + pbDate;
pb.addEventListener(MouseEvent.MOUSE_OVER, 
pbMouseOverListener);

scrollableBase.addChild(pb);
}

private function pbMouseOverListener(e:MouseEvent):void
{
			mfTextField.text = e.target.rolloverText; // mfTextField is a  
textfield within a mousefollower
			trace (e.target); // traces simpleTextField if over a movieclip  
with a simpletextfield in otherwise traces movieclip
			trace (e.target.rolloverText); // gives error when over a  
simpletextfield but works properly when over a movieclip without, eg  
where the dates are too close and a dot is rendered instead

mouseFollower.visible = true;
}

because the movieclip isn't always the target (even tho i've set the  
mouseevent on the movieclip), i can't consistently get a reading from  
rolloverText (because it's trying to find the variable rolloverText  
in the pbText SimpleTextField)


can anyone explain why this is and what i can do to get around it  
please?


thanks a lot
a

Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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


Re: [Flashcoders] using a class to load data

2008-03-28 Thread Allandt Bik-Elliott (Receptacle)

thanks jason


a


On 27 Mar 2008, at 21:30, Merrill, Jason wrote:

Yeah, I mean that's basically how I described it and would do it -  
there

might be a better way, but that way should work fine for you.

Jason Merrill
Bank of America
GTO and Risk LLD Solutions Design  Development
eTools  Multimedia

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GTO Innovative Learning Blog  subscribe.







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Allandt Bik-Elliott (Receptacle)
Sent: Thursday, March 27, 2008 4:30 PM
To: Flash Coders List
Subject: Re: [Flashcoders] using a class to load data

thanks jason - i've done this and it's working, i just wanted
you to take a look to make sure i've not done it stupidly

CODE
package
{
//package imports
import flash.events.*;
import flash.net.*;

internal class XMLLoader extends EventDispatcher
{
// class variable declarations
private var xmlDoc:XML;
private var xmlURL:String;
private var xmlLoader:URLLoader;

public static const COMPLETE:String = complete;

public function get doc():XML
{
return xmlDoc;
}

// constructor
public function XMLLoader(url:String)
{
xmlURL = url;
var urlRequest:URLRequest = new
URLRequest(xmlURL);
xmlLoader = new URLLoader();

xmlLoader.addEventListener(Event.COMPLETE, completeListener);
xmlLoader.load(urlRequest);
}

private function completeListener(e:Event):void
{
xmlDoc = new XML(xmlLoader.data);
dispatchEvent(new Event(XMLLoader.COMPLETE));
}
}
}
/CODE

and the function call is

CODE
private var xmlDoc:XML;
private var xmlurl:String;
private var xmlLoader:XMLLoader;

// call to initialiseXML() made in constructor private
function initialiseXML():void {
xmlLoader = new XMLLoader(xmlurl);  
xmlLoader.addEventListener(Event.COMPLETE, completeListener); }

private function completeListener(e:Event):void {
xmlDoc = xmlLoader.doc;
trace (xmlDoc.toXMLString()); //traces xml correctly } /CODE

a



On 27 Mar 2008, at 19:14, Merrill, Jason wrote:


Have your XMLLoader class extend EventDispatcher and have your
XMLLoader class dispatch an event when the load is

complete.  Wherever

your instance of the class is declared, add an event

listener to the

instance and write a function handler. if you need assistance with
setting that up, write back, it's pretty simple.


Jason Merrill
Bank of America
GTO and Risk LLD Solutions Design  Development eTools 

Multimedia


Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in

innovative learning

ideas and technologies?
Check out our internal  GTO Innovative Learning Blog  subscribe.







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Allandt Bik-Elliott (Receptacle)
Sent: Thursday, March 27, 2008 2:51 PM
To: flashcoders
Subject: [Flashcoders] using a class to load data

hi guys

i am trying to set up a class to handle my xml (will be

instantiated

for each xml file) but i'm running into a slight problem

here is the class so far:

CODE
package
{
//package imports
import flash.events.*;
import flash.net.*;

internal class XMLLoader
{
// class variable declarations
private var xmlDoc:XML;
private var xmlURL:String;
private var xmlLoader:URLLoader;

public function get doc():XML {return xmlDoc;}

// constructor
public function XMLLoader(url:String)
{
xmlURL = url;
var urlRequest:URLRequest = new
URLRequest(xmlURL);
xmlLoader = new URLLoader();

xmlLoader.addEventListener(Event.COMPLETE, completeListener);
xmlLoader.load(urlRequest);
}

private function completeListener(e:Event):void
{
xmlDoc = new XML(xmlLoader.data);
}
}
}
/CODE

the problem is with timing - from within the XMLLoader()

Class i can

wait for the COMPLETE event to reference the xmlDoc but

how would i

do that from an instance of the class

Re: [Flashcoders] multiple skins for V2 scrollbar

2008-03-28 Thread Allandt Bik-Elliott (Receptacle)

grab this pdf
http://livedocs.adobe.com/flash/9.0/main/flash_as2_components_help.pdf

and go to the section called Creating new component skins
QUOTE
If you want to use a particular skin for one instance of a  
component, but another skin for
another instance of the component, you must open a theme FLA file and  
create a new skin
symbol. Components are designed to make it easy to use different  
skins for different

instances. ...
/QUOTE

should be the info you need

best
a

On 28 Mar 2008, at 14:38, Mendelsohn, Michael wrote:


Hi list...

Can anyone recommend an easy way to apply varying skins to varying
instances of the V2 ScrollBar component, that's a subcomponent of  
either

the ScrollPane or TextField?

Thanks,
- Michael M.

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



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


Re: [Flashcoders] Outsourcing (was: Tweening Engines for AS3)

2008-03-28 Thread Allandt Bik-Elliott (Receptacle)
i worked at The Online Studio where a lot of their actionscript gets  
outsourced to india and like you said, it's a little bit behind but  
overall very good AS2 code




On 28 Mar 2008, at 15:03, Merrill, Jason wrote:


I'm assisting with an Actionscript outsourcing project right now with
some Flash game coders in Mumbai, so far so good, though they are a
little behind in skills - but would be interested to learn any  
cultural

things people have experienced with Flash developers in India.

Jason Merrill
Bank of America
GTO and Risk LLD Solutions Design  Development
eTools  Multimedia

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GTO Innovative Learning Blog  subscribe.


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




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


Re: [Flashcoders] Krugle?

2008-03-28 Thread Allandt Bik-Elliott (Receptacle)

looks like a good organisation tool as well as a useful search tool



On 28 Mar 2008, at 15:26, eric e. dolecki wrote:


Anyone ever use Krugle.org to search for AS source code?
I just ran into the site, and I am not sure what to think yet. For  
other
languages it might be better, but I'm currently unsure without  
spending time
in the system. The search results and tabbed interface, etc. is  
pretty sweet

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




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


[Flashcoders] using a class to load data

2008-03-27 Thread Allandt Bik-Elliott (Receptacle)

hi guys

i am trying to set up a class to handle my xml (will be instantiated  
for each xml file) but i'm running into a slight problem


here is the class so far:

CODE
package
{
//package imports
import flash.events.*;
import flash.net.*;

internal class XMLLoader
{
// class variable declarations
private var xmlDoc:XML;
private var xmlURL:String;
private var xmlLoader:URLLoader;

public function get doc():XML {return xmlDoc;}

// constructor
public function XMLLoader(url:String)
{
xmlURL = url;
var urlRequest:URLRequest = new URLRequest(xmlURL);
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, 
completeListener);
xmlLoader.load(urlRequest);
}

private function completeListener(e:Event):void
{
xmlDoc = new XML(xmlLoader.data);
}
}
}
/CODE

the problem is with timing - from within the XMLLoader() Class i can  
wait for the COMPLETE event to reference the xmlDoc but how would i  
do that from an instance of the class?


for instance if i do the following from my main class i get a null  
object error because it doesn't wait for the data to be loaded before  
trying to read it:


CODE
var xmlurl:String = path/to/xml.xml;
var xmlDoc:XMLLoader = new XMLLoader(xmlurl);
xmlDoc = xmlLoader.doc;
trace (xmlDoc.toXMLString());
/CODE

this would equally apply to an image loader, i guess

thanks in advance
a

Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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


Re: [Flashcoders] using a class to load data

2008-03-27 Thread Allandt Bik-Elliott (Receptacle)
thanks jason - i've done this and it's working, i just wanted you to  
take a look to make sure i've not done it stupidly


CODE
package
{
//package imports
import flash.events.*;
import flash.net.*;

internal class XMLLoader extends EventDispatcher
{
// class variable declarations
private var xmlDoc:XML;
private var xmlURL:String;
private var xmlLoader:URLLoader;

public static const COMPLETE:String = complete;

public function get doc():XML
{
return xmlDoc;
}

// constructor
public function XMLLoader(url:String)
{
xmlURL = url;
var urlRequest:URLRequest = new URLRequest(xmlURL);
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, 
completeListener);
xmlLoader.load(urlRequest);
}

private function completeListener(e:Event):void
{
xmlDoc = new XML(xmlLoader.data);
dispatchEvent(new Event(XMLLoader.COMPLETE));
}
}
}
/CODE

and the function call is

CODE
private var xmlDoc:XML;
private var xmlurl:String;
private var xmlLoader:XMLLoader;

// call to initialiseXML() made in constructor
private function initialiseXML():void
{
xmlLoader = new XMLLoader(xmlurl);  
xmlLoader.addEventListener(Event.COMPLETE, completeListener);
}

private function completeListener(e:Event):void
{
xmlDoc = xmlLoader.doc;
trace (xmlDoc.toXMLString()); //traces xml correctly
}
/CODE

a



On 27 Mar 2008, at 19:14, Merrill, Jason wrote:

Have your XMLLoader class extend EventDispatcher and have your  
XMLLoader

class dispatch an event when the load is complete.  Wherever your
instance of the class is declared, add an event listener to the  
instance

and write a function handler. if you need assistance with setting that
up, write back, it's pretty simple.


Jason Merrill
Bank of America
GTO and Risk LLD Solutions Design  Development
eTools  Multimedia

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GTO Innovative Learning Blog  subscribe.







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Allandt Bik-Elliott (Receptacle)
Sent: Thursday, March 27, 2008 2:51 PM
To: flashcoders
Subject: [Flashcoders] using a class to load data

hi guys

i am trying to set up a class to handle my xml (will be
instantiated for each xml file) but i'm running into a slight  
problem


here is the class so far:

CODE
package
{
//package imports
import flash.events.*;
import flash.net.*;

internal class XMLLoader
{
// class variable declarations
private var xmlDoc:XML;
private var xmlURL:String;
private var xmlLoader:URLLoader;

public function get doc():XML {return xmlDoc;}

// constructor
public function XMLLoader(url:String)
{
xmlURL = url;
var urlRequest:URLRequest = new
URLRequest(xmlURL);
xmlLoader = new URLLoader();

xmlLoader.addEventListener(Event.COMPLETE, completeListener);
xmlLoader.load(urlRequest);
}

private function completeListener(e:Event):void
{
xmlDoc = new XML(xmlLoader.data);
}
}
}
/CODE

the problem is with timing - from within the XMLLoader()
Class i can wait for the COMPLETE event to reference the
xmlDoc but how would i do that from an instance of the class?

for instance if i do the following from my main class i get a
null object error because it doesn't wait for the data to be
loaded before trying to read it:

CODE
var xmlurl:String = path/to/xml.xml;
var xmlDoc:XMLLoader = new XMLLoader(xmlurl); xmlDoc =
xmlLoader.doc; trace (xmlDoc.toXMLString()); /CODE

this would equally apply to an image loader, i guess

thanks in advance
a

Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]

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


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

Re: [Flashcoders] Tweening Engines for AS3

2008-03-27 Thread Allandt Bik-Elliott (Receptacle)

i couldn't afford to pay my bills on those prices


On 27 Mar 2008, at 16:15, Dwayne Neckles wrote:


Yea guys I I know we are off the issue topic.
but its disgusting...

i could be wrong but I feel getacoder and elance all i feel cheapen  
us as coders and flashers.. but this is a digression..





Date: Thu, 27 Mar 2008 16:24:08 +0100
From: [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Tweening Engines for AS3

sick. If you want to know for how little money projects are  
proposed and

how fast programmer people on earth can work for go there:
http://www.getacoder.com

L


Paul Andrews a écrit :
- Original Message - From: Pedro Kostelec  
[EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, March 27, 2008 9:21 AM
Subject: Re: [Flashcoders] Tweening Engines for AS3



Sorry, my fault, sometimes I forgot I am on an international list.
You would cry if you see a paycheck of a programmer from a third- 
world

country ;)

I don't get it. I am not even in university so i am not employed  
and

i have
no idea what this international list means??


People reading and posting to the list are from all over the world -
international - rather than just being in the US. In that respect  
you
can't assume that worldwide flash developers are all driving in  
shiny

new Porsches.

Paul



I am curious,
Pedro


On Wed, Mar 26, 2008 at 7:43 PM, Wagner Amaral  
[EMAIL PROTECTED]

wrote:


On Wed, Mar 26, 2008 at 2:38 PM, Steven Sacks
[EMAIL PROTECTED]
wrote:


We are programmers, we can't afford Porsches! Better change that
to bike and skate...


You're joking, right?  Talented Flash developers are in extremely

high

demand right now.  Every day I get 3-5 emails from recruiters or

companies.
 It's a seller's market and people are paying top dollar for  
AS3 and

Flex
devs.  Flash and Flex jobs are paying $75-$150/hr.  That's  
$150,000 -

$300,000 a year.  If you can't afford a Porsche, you need to find

a new
job

or grow a pair and ask for a raise.

That being said, I don't own a Porsche because I've got better

things  to

do with my money.  ;)




Sorry, my fault, sometimes I forgot I am on an international list.
You would cry if you see a paycheck of a programmer from a  
third-world

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





--
Pedro D.K.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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




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


_
In a rush?  Get real-time answers with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html? 
ocid=TXT_TAGLM_WL_Refresh_realtime_042008_ 
__

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





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


Re: [Flashcoders] Outsourcing (was: Tweening Engines for AS3)

2008-03-27 Thread Allandt Bik-Elliott (Receptacle)
it's bad enough to try to understand someone elses code when you  
speak the same language - it must be damn near impossible if  
everything's in chinese



On 27 Mar 2008, at 16:45, Kerry Thompson wrote:


Laurent wrote:

sick. If you want to know for how little money projects are  
proposed and

how fast programmer people on earth can work for go there:
http://www.getacoder.com


I found the same thing when I registered with guru.com. There are  
hundreds of jobs with a budget of $500 or less, and precious few  
worth bidding on. All my work comes from contacts--current and  
former clients, colleagues, and the like.


There is a downside to outsourcing, though. I've worked on two  
major projects, one for Disney and one for Sesame Street, that were  
initially outsourced overseas. Both projects were eventually deemed  
substandard, and completely re-written in-house.


I'm not saying the programmers overseas are substandard--I've  
worked with some fine Chinese and Indian programmers (even some  
good Europeans ;-) There are so many problems with time  
differences, cultural differences, expectations, and a host of  
other issues that it often costs more to send something overseas.


Cordially,

Kerry Thompson



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




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


Re: [Flashcoders] Custom DrawRectangle Question

2008-03-26 Thread Allandt Bik-Elliott (Receptacle)
It seems to me that that would work as a Sprite too - less memory  
overheads (not by much, mind, but it'll help if there's a lot of them)


also, would you be better off making your class variables protected  
or private? Those variables are being set by the constructor, anyway,  
and if you use get() and set() methods on them you could add tweens  
and variable checking (for instance) etc if they're changed once the  
shape is initialised



On 25 Mar 2008, at 20:55, Omar Fouad wrote:


Yeah A good method to do rectangles fast

On Tue, Mar 25, 2008 at 9:30 PM, Cor [EMAIL PROTECTED] wrote:


Mmm, sounds familiair. :-)
It has to be added to the Displaylist otherwise it isn't visible.

Cor

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Omar Fouad
Verzonden: maandag 24 maart 2008 22:01
Aan: Flash Coders List
Onderwerp: [Flashcoders] Custom DrawRectangle Question

I am creating a custom Class that draws a simple rectangle for an
application. Here is the class

DrawRectangle.as

public class DrawRectangle extends MovieClip {

   public var _w:Number;
   public var _h:Number;
   public var _x:Number;
   public var _y:Number;

   public function DrawRectangle(w:Number, h:Number, x:Number,
y:Number) {
   this._w = w;
   this._h = h;
   this._x = x;
   this._y = y;
   Init();
   }
   private function Init():void {
   var MC:MovieClip = new MovieClip();
   MC.graphics.lineStyle(1, 0xFF);
   MC.graphics.beginFill(0xFF, .3);
   MC.graphics.drawRect(_x,_y,_w,_h);
   addChild(MC);
   }

   }
}

I wrote it without the last line ( addChild(MC) ) and it didnt  
work. It

did
not work Event when In the Main Class I added the addChild() like  
this:



var M:DrawRectangle = new Rectangle(100,100,20,100);

addChild(M);


I thought The addChild should be put outside the class. And No It  
only

worked when I add the addChild() in the class and out the class... It
works
But I want to understand Why??
How can I set it to draw from the class iteself??

Thanks.


--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be  
copied,

disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date:  
25-3-2008

10:26

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date:  
25-3-2008

10:26


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date:  
25-3-2008

10:26


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





--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be  
copied,

disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




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


Re: [Flashcoders] Tweening Engines for AS3

2008-03-26 Thread Allandt Bik-Elliott (Receptacle)
i've never used tweenlite but i have used tweener and one of the  
things that blew me away was the ability to tween properties and  
variables rather than just clips/sprites


example from current project:

[CODE]
// read/write percentage value relates directly to the slider
public function get percent():Number { return slider.percent; }
public function set percent( p:Number ):void { slider.percent = p; }

 public function arrowPressed( e:MouseEvent ):void
 {
var dir:int = (e.target.name == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
	Tweener.addTween(slider,{percent:total, time: .5,  
transition:easeInOutQuad}); // Tweens set() method

}
[/CODE]

you may be able to do this with tweenlite, i don't know


On 25 Mar 2008, at 23:46, Jack Doyle wrote:

First let me say that Tweener is fantastic, and a lot of people  
rely on it
for good reason. If quantity of features is your top priority, you  
should

seriously consider using Tweener.

Let me briefly address a few of the TweenLite-related concerns  
folks have

mentioned:

SPEED
-
TweenLite's speed advantage isn't only a factor when you're doing  
hundreds

of simultaneous tweens - it can be important even with a single tween.
Imagine a button that initiates a tween when you rollover it, and  
the user
rolls their mouse on/off/on/off quickly. Even a slight pause can  
degrade the

experience. Speed is also critical for mobile devices that have slower
processors, less memory, etc.

FILE SIZE
-
File size can be a huge factor in certain scenarios, especially for  
banner
ads. But for those who don't deal with strict file size  
requirements, it's a

non-issue.

FEATURES

Bezier tweens - Coming soon (well, as soon as I can clear my over- 
filled

plate) to TweenMax which is a class that extends TweenLite, adding
non-essential features. That way, the base class will remain very  
lean 
mean, but if you need the extra features and are willing to trade  
off some

file size and performance, TweenMax will take care of you.

Rounding numbers - Possible now with TweenLite's onUpdate feature.  
It does
require some extra steps, though. If it gets added to the base  
class, every
tween takes a slight performance hit because of the added  
conditional logic

required just to see whether or not each tween needs rounding. Calling
Math.round() on every frame is expensive in terms of performance too.

Transitions/easing - There aren't fewer transition options in  
TweenLite. You
can use ANY function as long as it conforms to the standard ease  
format that

all of Adobe's and Penner's do. Elastic, Strong, Back, etc. are all
available.

You may actually find that there are a few features that the TweenLite
family of classes (TweenLite, TweenFilterLite, and TweenMax) has that
Tweener is missing, but in general, I'd say Tweener is more feature- 
packed.
It just comes a the price of file size and performance. That's not  
to say
Tweener performs poorly, though - it depends on the scenario which  
is why

this speed test might be helpful:
http://blog.greensock.com/tweening-speed-test/

So, again, this isn't a good/bad issue - they're just different  
tools that

you can choose from to get the job done. TweenLite wasn't built to be
everything to everyone, and I'm pretty sure Tweener wasn't built to  
be a
super-compact engine that's perfect for banner ads. I'd encourage  
folks to

give 'em both a shot and see what feels best.

Tweener: http://code.google.com/p/tweener/
TweenLite: http://www.TweenLite.com

Jack


-Original Message-
From: Cory Petosky [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2008 1:43 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Tweening Engines for AS3

TweenLite doesn't have bezier curve support, can't store the duration
in the options object, doesn't support auto-rounding of pixels, and
has significantly fewer transition options. I think TweenLite is great
-- if I ever need to tween 1200 things at once, I'll certainly choose
it -- but these features in Tweener make it a better choice for many
of my projects.

On Mon, Mar 24, 2008 at 1:16 PM, Steven Sacks  
[EMAIL PROTECTED]

wrote:

Tweener is proven to be significantly slower than TweenLite, and it's
 almost 300% larger (TweenLite is 3k vs Tweener's 8k).

 I'm not telling you what to do. You're welcome to your preference. I
 prefer to write better, faster, smaller, more efficient code.   
Different

 strokes for different folks, I guess.  :)


 Dave Mennenoh wrote:

I prefer Tweener, and if you've ever used Fuse you'll like it's
syntax. It's also quite small - adds about 8K.

Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/




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




___

Re: [Flashcoders] Tweening Engines for AS3

2008-03-26 Thread Allandt Bik-Elliott (Receptacle)

no total

it only really matters with flash banners where you have to keep  
below a ridiculously low filesize (usually 20-30k for expanding ones)  
to not delay the content on the site


on sites / media it doesn't really add up to that much


On 26 Mar 2008, at 13:11, Matt S. wrote:


One thing I keep seeing is all this talk of the 8k+ that Tweener, Fuse
etc add to the file size. And while I absolutely understand the need
for keeping projects as barebones tiny as possible, I guess it just
doesnt seem like that much, especially since a project that involves
heavy, repeated and complex tweening, 9 times out of 10, is chock full
o' jpegs, flvs, complex vector graphics etc, all of which might make
8k seem like the least of one's concerns. Am I missing something? Is
that 8k per tween?

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




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


[Flashcoders] referencing a public method gives unexpected result

2008-03-25 Thread Allandt Bik-Elliott (Receptacle)

Hi guys

quick question really.

I have a Scrollbar class with a public method, arrowPressed 
(e:MouseEvent), that i'm trying to call from another class,  
TimelineArea(), using objects with the same name with the lines:


left_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
scrollbar.arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
scrollbar.arrowPressed );

// note scrollbar is an instance of the Scrollbar class

the method in the Scrollbar class is as follows:

public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
	Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener tween  
added to add friction to arrow presses - God bless Zeh and chums!

}


The result of this is that both left_arrow and right_arrow in the  
TimelineArea class give a (e.target == left_arrow) = false result and  
only move the timeline forward whereas the left_arrow and right_arrow  
within the Scrollbar class give the correct result: right_arrow =  
false (moves the timeline +1), left_arrow = true (moves the timeline -1)


why would using the public method externally pass a different result  
to using it internally, please?


I've included both classes below for context

thanks for your time
a



Scrollbar Class
[CODE]
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import com.caurina.transitions.*;

public class Scrollbar extends Sprite
{
// elements
protected var slider:Slider;
protected var left_arrow:Sprite;
protected var right_arrow:Sprite;

protected var scrollSpeed:Number = .02;

// read/write percentage value relates directly to the slider
public function get percent():Number { return slider.percent; }
public function set percent( p:Number ):void  
{ slider.percent = p; }


public function Scrollbar()
{
createElements();
}

// executes when the up arrow is pressed
public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
			Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and chums!

}

protected function createElements():void
{
slider = new Slider();

left_arrow = new Sprite();
left_arrow.graphics.beginFill( 0x99, 1 );
left_arrow.graphics.moveTo(20,0);
left_arrow.graphics.lineTo(20,40);
left_arrow.graphics.lineTo(10,40);
left_arrow.graphics.curveTo(0,40,0,30);
left_arrow.graphics.lineTo(0,10);
left_arrow.graphics.curveTo(0,0,10,0);
left_arrow.graphics.lineTo(20,0);
left_arrow.graphics.endFill();

right_arrow = new Sprite();
right_arrow.graphics.beginFill( 0x99, 1 );
right_arrow.graphics.lineTo(10,0);
right_arrow.graphics.curveTo(20,0,20,10);
right_arrow.graphics.lineTo(20,30);
right_arrow.graphics.curveTo(20,40,10,40);
right_arrow.graphics.lineTo(0,40);
right_arrow.graphics.lineTo(0,0);
right_arrow.graphics.endFill();

slider.x = left_arrow.width;
right_arrow.x = slider.x + slider.width;

left_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
arrowPressed );


addChild( slider );
addChild( left_arrow );
addChild( right_arrow );
}

public override function addEventListener( type:String,  
listener:Function, useCapture:Boolean=false, priority:int=0,  
useWeakReference:Boolean=false ):void

{
if ( type === SliderEvent.CHANGE )
{
slider.addEventListener( SliderEvent.CHANGE,  
listener, useCapture, priority, useWeakReference );

return;
}
super.addEventListener( type, listener, useCapture,  
priority, useWeakReference );

}
public override function removeEventListener( type:String,  
listener:Function, useCapture:Boolean=false ):void

{
if ( type === SliderEvent.CHANGE )
{
slider.removeEventListener( SliderEvent.CHANGE,  
listener, useCapture );

return;
}
super.removeEventListener( type, listener, useCapture );
}
}
}
[/CODE]

TimelineArea Class (cut down for readability and relevance)
[CODE]
package
{

Re: [Flashcoders] referencing a public method gives unexpected result

2008-03-25 Thread Allandt Bik-Elliott (Receptacle)

replaced the Scrollbar method with this

[CODE]
// executes when the up arrow is pressed
protected function arrowPressed( e:MouseEvent ):void
{
trace (e.target.name);
var dir:int = (e.target == left_arrow) ? -1 : 1;
scrollTarget(dir);
}

public function leftBumperPressed (e:MouseEvent):void
{
var dir:int = -1;
scrollTarget(dir);
}

public function rightBumperPressed (e:MouseEvent):void
{
var dir:int = 1;
scrollTarget(dir);
}

private function scrollTarget (dir:int)
{
var total:Number = slider.percent + (dir * scrollSpeed);
			Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and chums!

}
[/CODE]

a


On 25 Mar 2008, at 12:29, Allandt Bik-Elliott (Receptacle) wrote:


Hi guys

quick question really.

I have a Scrollbar class with a public method, arrowPressed 
(e:MouseEvent), that i'm trying to call from another class,  
TimelineArea(), using objects with the same name with the lines:


left_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
scrollbar.arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
scrollbar.arrowPressed );

// note scrollbar is an instance of the Scrollbar class

the method in the Scrollbar class is as follows:

public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
	Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and  
chums!

}


The result of this is that both left_arrow and right_arrow in the  
TimelineArea class give a (e.target == left_arrow) = false result  
and only move the timeline forward whereas the left_arrow and  
right_arrow within the Scrollbar class give the correct result:  
right_arrow = false (moves the timeline +1), left_arrow = true  
(moves the timeline -1)


why would using the public method externally pass a different  
result to using it internally, please?


I've included both classes below for context

thanks for your time
a



Scrollbar Class
[CODE]
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import com.caurina.transitions.*;

public class Scrollbar extends Sprite
{
// elements
protected var slider:Slider;
protected var left_arrow:Sprite;
protected var right_arrow:Sprite;

protected var scrollSpeed:Number = .02;

// read/write percentage value relates directly to the slider
public function get percent():Number { return  
slider.percent; }
public function set percent( p:Number ):void  
{ slider.percent = p; }


public function Scrollbar()
{
createElements();
}

// executes when the up arrow is pressed
public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
			Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and  
chums!

}

protected function createElements():void
{
slider = new Slider();

left_arrow = new Sprite();
left_arrow.graphics.beginFill( 0x99, 1 );
left_arrow.graphics.moveTo(20,0);
left_arrow.graphics.lineTo(20,40);
left_arrow.graphics.lineTo(10,40);
left_arrow.graphics.curveTo(0,40,0,30);
left_arrow.graphics.lineTo(0,10);
left_arrow.graphics.curveTo(0,0,10,0);
left_arrow.graphics.lineTo(20,0);
left_arrow.graphics.endFill();

right_arrow = new Sprite();
right_arrow.graphics.beginFill( 0x99, 1 );
right_arrow.graphics.lineTo(10,0);
right_arrow.graphics.curveTo(20,0,20,10);
right_arrow.graphics.lineTo(20,30);
right_arrow.graphics.curveTo(20,40,10,40);
right_arrow.graphics.lineTo(0,40);
right_arrow.graphics.lineTo(0,0);
right_arrow.graphics.endFill();

slider.x = left_arrow.width;
right_arrow.x = slider.x + slider.width;

left_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
arrowPressed );
right_arrow.addEventListener

Re: [Flashcoders] referencing a public method gives unexpected result

2008-03-25 Thread Allandt Bik-Elliott (Receptacle)

on someone's suggestion i've replaced this with the much nicer:

[CODE]
protected function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target.name == left_arrow) ? -1 : 1;
scrollTarget(dir);
}
[/CODE]

and then i've given all of the left_arrow and right_arrows .names of  
left_arrow and right_arrow


a


On 25 Mar 2008, at 14:15, Allandt Bik-Elliott (Receptacle) wrote:


replaced the Scrollbar method with this

[CODE]
// executes when the up arrow is pressed
protected function arrowPressed( e:MouseEvent ):void
{
trace (e.target.name);
var dir:int = (e.target == left_arrow) ? -1 : 1;
scrollTarget(dir);
}

public function leftBumperPressed (e:MouseEvent):void
{
var dir:int = -1;
scrollTarget(dir);
}

public function rightBumperPressed (e:MouseEvent):void
{
var dir:int = 1;
scrollTarget(dir);
}

private function scrollTarget (dir:int)
{
var total:Number = slider.percent + (dir * scrollSpeed);
			Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and  
chums!

}
[/CODE]

a


On 25 Mar 2008, at 12:29, Allandt Bik-Elliott (Receptacle) wrote:


Hi guys

quick question really.

I have a Scrollbar class with a public method, arrowPressed 
(e:MouseEvent), that i'm trying to call from another class,  
TimelineArea(), using objects with the same name with the lines:


left_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
scrollbar.arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN,  
scrollbar.arrowPressed );

// note scrollbar is an instance of the Scrollbar class

the method in the Scrollbar class is as follows:

public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
	Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and  
chums!

}


The result of this is that both left_arrow and right_arrow in the  
TimelineArea class give a (e.target == left_arrow) = false result  
and only move the timeline forward whereas the left_arrow and  
right_arrow within the Scrollbar class give the correct result:  
right_arrow = false (moves the timeline +1), left_arrow = true  
(moves the timeline -1)


why would using the public method externally pass a different  
result to using it internally, please?


I've included both classes below for context

thanks for your time
a



Scrollbar Class
[CODE]
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import com.caurina.transitions.*;

public class Scrollbar extends Sprite
{
// elements
protected var slider:Slider;
protected var left_arrow:Sprite;
protected var right_arrow:Sprite;

protected var scrollSpeed:Number = .02;

// read/write percentage value relates directly to the slider
public function get percent():Number { return  
slider.percent; }
public function set percent( p:Number ):void  
{ slider.percent = p; }


public function Scrollbar()
{
createElements();
}

// executes when the up arrow is pressed
public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
			Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener  
tween added to add friction to arrow presses - God bless Zeh and  
chums!

}

protected function createElements():void
{
slider = new Slider();

left_arrow = new Sprite();
left_arrow.graphics.beginFill( 0x99, 1 );
left_arrow.graphics.moveTo(20,0);
left_arrow.graphics.lineTo(20,40);
left_arrow.graphics.lineTo(10,40);
left_arrow.graphics.curveTo(0,40,0,30);
left_arrow.graphics.lineTo(0,10);
left_arrow.graphics.curveTo(0,0,10,0);
left_arrow.graphics.lineTo(20,0);
left_arrow.graphics.endFill();

right_arrow = new Sprite();
right_arrow.graphics.beginFill( 0x99, 1 );
right_arrow.graphics.lineTo(10,0);
right_arrow.graphics.curveTo(20,0,20,10);
right_arrow.graphics.lineTo(20,30

Re: [Flashcoders] referencing a public method gives unexpected result

2008-03-25 Thread Allandt Bik-Elliott (Receptacle)
i'm not too up on strict equality i'm afraid - would be interested to  
hear someone's opinion


the comparison now is e.target.name == left_arrow (i've added  
left_arrow.name = left_arrow and the same for right arrow as well)



On 25 Mar 2008, at 14:28, jonathan howe wrote:


I'm interested in opinions on this, too...

Is that comparison (e.target == left_arrow) the best way to find  
out what
your target object is? ... and would strict equality make a  
difference?


-jonathan


On Tue, Mar 25, 2008 at 10:15 AM, Allandt Bik-Elliott (Receptacle) 
[EMAIL PROTECTED] wrote:


replaced the Scrollbar method with this

[CODE]
 // executes when the up arrow is pressed
 protected function arrowPressed( e:MouseEvent ):void
{
   trace (e.target.name);
 var dir:int = (e.target == left_arrow) ? -1 : 1;
scrollTarget(dir);
}

   public function leftBumperPressed (e:MouseEvent):void
   {
   var dir:int = -1;
   scrollTarget(dir);
   }

   public function rightBumperPressed (e:MouseEvent):void
   {
   var dir:int = 1;
   scrollTarget(dir);
   }

   private function scrollTarget (dir:int)
{
   var total:Number = slider.percent + (dir *
scrollSpeed);
   Tweener.addTween(slider,{percent:total,  
time:0.5});

// Tweener
tween added to add friction to arrow presses - God bless Zeh and  
chums!

   }
[/CODE]

a


On 25 Mar 2008, at 12:29, Allandt Bik-Elliott (Receptacle) wrote:


Hi guys

quick question really.

I have a Scrollbar class with a public method, arrowPressed
(e:MouseEvent), that i'm trying to call from another class,
TimelineArea(), using objects with the same name with the lines:

left_arrow.addEventListener( MouseEvent.MOUSE_DOWN,
scrollbar.arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN,
scrollbar.arrowPressed );
// note scrollbar is an instance of the Scrollbar class

the method in the Scrollbar class is as follows:

public function arrowPressed( e:MouseEvent ):void
{
  var dir:int = (e.target == left_arrow) ? -1 : 1;
  var total:Number = slider.percent + (dir * scrollSpeed);
  Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener
tween added to add friction to arrow presses - God bless Zeh and
chums!
}


The result of this is that both left_arrow and right_arrow in the
TimelineArea class give a (e.target == left_arrow) = false result
and only move the timeline forward whereas the left_arrow and
right_arrow within the Scrollbar class give the correct result:
right_arrow = false (moves the timeline +1), left_arrow = true
(moves the timeline -1)

why would using the public method externally pass a different
result to using it internally, please?

I've included both classes below for context

thanks for your time
a



Scrollbar Class
[CODE]
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import com.caurina.transitions.*;

public class Scrollbar extends Sprite
{
// elements
protected var slider:Slider;
protected var left_arrow:Sprite;
protected var right_arrow:Sprite;

protected var scrollSpeed:Number = .02;

// read/write percentage value relates directly to the  
slider

public function get percent():Number { return
slider.percent; }
public function set percent( p:Number ):void
{ slider.percent = p; }

public function Scrollbar()
{
createElements();
}

// executes when the up arrow is pressed
public function arrowPressed( e:MouseEvent ):void
{
  var dir:int = (e.target == left_arrow) ?  
-1 : 1;

  var total:Number = slider.percent + (dir *

scrollSpeed);
  Tweener.addTween(slider,{percent:total,  
time:0.5});

// Tweener

tween added to add friction to arrow presses - God bless Zeh and
chums!
}

protected function createElements():void
{
slider = new Slider();

left_arrow = new Sprite();
left_arrow.graphics.beginFill( 0x99, 1 );
  left_arrow.graphics.moveTo(20,0);
left_arrow.graphics.lineTo(20,40);
  left_arrow.graphics.lineTo(10,40);
  left_arrow.graphics.curveTo(0,40,0,30);
  left_arrow.graphics.lineTo(0,10);
  left_arrow.graphics.curveTo(0,0,10,0);
  left_arrow.graphics.lineTo(20,0);
left_arrow.graphics.endFill();

right_arrow = new Sprite();
right_arrow.graphics.beginFill( 0x99, 1 );
  right_arrow.graphics.lineTo(10,0);
  right_arrow.graphics.curveTo

Re: [Flashcoders] reparent child to halt scroll

2008-03-24 Thread Allandt Bik-Elliott (Receptacle)

i guess this one's not something you guys want to touch eh?

never mind then

a


On 21 Mar 2008, at 10:16, Allandt Bik-Elliott (Receptacle) wrote:


noone have the time to look at this one?


On 20 Mar 2008, at 15:25, Allandt Bik-Elliott (Receptacle) wrote:


hi guys

i'm a bit stuck with a project i'm working on. I have a timeline  
which all runs off a scrollbar similar to the one in the kirupa  
forum (http://www.kirupa.com/forum/showthread.php?t=245468 -  
amended to go horizontal and us Tweener to act a bit more smoothly)


at the moment, i have 2 sprites, 1 scrolls with the scrollbar and  
1 doesn't.
on the scrolling sprite i have several panels and the start of  
some ticks plus a mask for the non-scrolling textfield which is on  
the other sprite


everything works as it should with this, however - i'd like to  
push it a bit further so that the title (mainTitle) scrolls with  
the rest of the panels but when it hits the left hand side, it  
reparents to the non-scrolling sprite and stays there
you can see an example of this at http://www.bbc.co.uk/history/ 
british/launch_tl_british.shtml - which i think is a really  
elegant solution to the problem of overlong panels, designed to  
take several points of interest


i've tried having everything on the scrollable sprite and  moving  
the title backwards using a SliderEvent (custom event for the  
scrollbar) but the globalToLocal() method just gets really jumpy  
and doesn't seem to put the titles in the right place or return  
them correctly


this is my class:

CODE
package
{
//package imports
import flash.display.Sprite;

//scrollbar imports
import com.caurina.transitions.*;
import flash.geom.*;
import flash.events.*;
import flash.text.TextFormat;
import com.receptacle.utils.*;

internal class TimelineArea extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var taTitleBarY;
private var taPanelY:uint;
private var taPanelHeight:uint
private var scrollableBase:Sprite;
private var scrollbar:Scrollbar
private var stage_width:uint;
private var stage_height:uint;

private var panelY:uint;
private var panelColour:uint;
private var taTitleBarHeight:uint;
private var nonScrollableBase:Sprite;
private var commonGrey:uint;
private var subheadingFont:String;
private var headingFont:String;

// constructor
public function TimelineArea():void
{
setVars();
addTicks();
addPanels();
addPeriodBars();
addImageLandmark();
initialiseTimelineScrollBar();
}

private function setVars()
{
scrollbar = new Scrollbar();
cp = new CommonProperties();
stage_width  = cp.stage_width;
stage_height = cp.stage_height;
taTitleBarHeight = cp.taTitleBarHeight;
taTitleBarY  = cp.taTitleBarY;
taPanelY = cp.taPanelY;
taPanelHeight= cp.taPanelHeight;
commonGrey   = cp.tickColour;
headingFont  = cp.headingFont;
subheadingFont   = cp.subheadingFont;

scrollbar.x = 16;
scrollbar.y = 550-cp.titleBarHeight;

scrollableBase = new Sprite();
nonScrollableBase = new Sprite();
scrollableBase.y = 0;

addChild(scrollableBase);
addChild(nonScrollableBase);
}

private function addPanels():void
{
trace (Background panels added);

			createPanel(0, 1000, 0xB6, Prehistory, c. 1.7 million -  
4000 B.C.E.);
			createPanel(1000, 2000, 0xB65B00, Early Civilisations, c.  
1.7 million - 4000 B.C.E.);
			createPanel(3000, 2000, 0x123456, Sumfink Else, c. 1.7  
million - 4000 B.C.E.);



}

		private function createPanel(panelX:Number, panelWidth:int,  
panelColour:uint, pTitle:String, date:String):void

{
			// SimpleRectangle class (rColour:uint, rOutlineColour:uint,  
rX:Number, rY:Number, rWidth:uint, rHeight:uint)
			var

Re: [Flashcoders] books for flash programming

2008-03-24 Thread Allandt Bik-Elliott (Receptacle)

gotoandlearn.com
learnflash.com
flashkit.com

essential actionscript 3.0 (colin moock)

i'd start at these

a


On 24 Mar 2008, at 07:21, Naveen Bhaskar wrote:



I am a flash designer and I am in intermediate in programming.(AS2).

anybody pls tellme what are the good books I can refer.
or is there any good website for learning programming and also have  
good

tutorials...


thanks in advance



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


Re: [Flashcoders] reparent child to halt scroll

2008-03-21 Thread Allandt Bik-Elliott (Receptacle)

noone have the time to look at this one?


On 20 Mar 2008, at 15:25, Allandt Bik-Elliott (Receptacle) wrote:


hi guys

i'm a bit stuck with a project i'm working on. I have a timeline  
which all runs off a scrollbar similar to the one in the kirupa  
forum (http://www.kirupa.com/forum/showthread.php?t=245468 -  
amended to go horizontal and us Tweener to act a bit more smoothly)


at the moment, i have 2 sprites, 1 scrolls with the scrollbar and 1  
doesn't.
on the scrolling sprite i have several panels and the start of some  
ticks plus a mask for the non-scrolling textfield which is on the  
other sprite


everything works as it should with this, however - i'd like to push  
it a bit further so that the title (mainTitle) scrolls with the  
rest of the panels but when it hits the left hand side, it  
reparents to the non-scrolling sprite and stays there
you can see an example of this at http://www.bbc.co.uk/history/ 
british/launch_tl_british.shtml - which i think is a really elegant  
solution to the problem of overlong panels, designed to take  
several points of interest


i've tried having everything on the scrollable sprite and  moving  
the title backwards using a SliderEvent (custom event for the  
scrollbar) but the globalToLocal() method just gets really jumpy  
and doesn't seem to put the titles in the right place or return  
them correctly


this is my class:

CODE
package
{
//package imports
import flash.display.Sprite;

//scrollbar imports
import com.caurina.transitions.*;
import flash.geom.*;
import flash.events.*;
import flash.text.TextFormat;
import com.receptacle.utils.*;

internal class TimelineArea extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var taTitleBarY;
private var taPanelY:uint;
private var taPanelHeight:uint
private var scrollableBase:Sprite;
private var scrollbar:Scrollbar
private var stage_width:uint;
private var stage_height:uint;

private var panelY:uint;
private var panelColour:uint;
private var taTitleBarHeight:uint;
private var nonScrollableBase:Sprite;
private var commonGrey:uint;
private var subheadingFont:String;
private var headingFont:String;

// constructor
public function TimelineArea():void
{
setVars();
addTicks();
addPanels();
addPeriodBars();
addImageLandmark();
initialiseTimelineScrollBar();
}

private function setVars()
{
scrollbar = new Scrollbar();
cp = new CommonProperties();
stage_width  = cp.stage_width;
stage_height = cp.stage_height;
taTitleBarHeight = cp.taTitleBarHeight;
taTitleBarY  = cp.taTitleBarY;
taPanelY = cp.taPanelY;
taPanelHeight= cp.taPanelHeight;
commonGrey   = cp.tickColour;
headingFont  = cp.headingFont;
subheadingFont   = cp.subheadingFont;

scrollbar.x = 16;
scrollbar.y = 550-cp.titleBarHeight;

scrollableBase = new Sprite();
nonScrollableBase = new Sprite();
scrollableBase.y = 0;

addChild(scrollableBase);
addChild(nonScrollableBase);
}

private function addPanels():void
{
trace (Background panels added);

			createPanel(0, 1000, 0xB6, Prehistory, c. 1.7 million -  
4000 B.C.E.);
			createPanel(1000, 2000, 0xB65B00, Early Civilisations, c. 1.7  
million - 4000 B.C.E.);
			createPanel(3000, 2000, 0x123456, Sumfink Else, c. 1.7  
million - 4000 B.C.E.);



}

		private function createPanel(panelX:Number, panelWidth:int,  
panelColour:uint, pTitle:String, date:String):void

{
			// SimpleRectangle class (rColour:uint, rOutlineColour:uint,  
rX:Number, rY:Number, rWidth:uint, rHeight:uint)
			var mainTitlePanel:SimpleRectangle = new SimpleRectangle 
(0xFF, panelColour, panelX, 0, panelWidth, taTitleBarHeight

[Flashcoders] reparent child to halt scroll

2008-03-20 Thread Allandt Bik-Elliott (Receptacle)

hi guys

i'm a bit stuck with a project i'm working on. I have a timeline  
which all runs off a scrollbar similar to the one in the kirupa forum  
(http://www.kirupa.com/forum/showthread.php?t=245468 - amended to go  
horizontal and us Tweener to act a bit more smoothly)


at the moment, i have 2 sprites, 1 scrolls with the scrollbar and 1  
doesn't.
on the scrolling sprite i have several panels and the start of some  
ticks plus a mask for the non-scrolling textfield which is on the  
other sprite


everything works as it should with this, however - i'd like to push  
it a bit further so that the title (mainTitle) scrolls with the rest  
of the panels but when it hits the left hand side, it reparents to  
the non-scrolling sprite and stays there
you can see an example of this at http://www.bbc.co.uk/history/ 
british/launch_tl_british.shtml - which i think is a really elegant  
solution to the problem of overlong panels, designed to take several  
points of interest


i've tried having everything on the scrollable sprite and  moving the  
title backwards using a SliderEvent (custom event for the scrollbar)  
but the globalToLocal() method just gets really jumpy and doesn't  
seem to put the titles in the right place or return them correctly


this is my class:

CODE
package
{
//package imports
import flash.display.Sprite;

//scrollbar imports
import com.caurina.transitions.*;
import flash.geom.*;
import flash.events.*;
import flash.text.TextFormat;
import com.receptacle.utils.*;

internal class TimelineArea extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var taTitleBarY;
private var taPanelY:uint;
private var taPanelHeight:uint
private var scrollableBase:Sprite;
private var scrollbar:Scrollbar
private var stage_width:uint;
private var stage_height:uint;

private var panelY:uint;
private var panelColour:uint;
private var taTitleBarHeight:uint;
private var nonScrollableBase:Sprite;
private var commonGrey:uint;
private var subheadingFont:String;
private var headingFont:String;

// constructor
public function TimelineArea():void
{
setVars();
addTicks();
addPanels();
addPeriodBars();
addImageLandmark();
initialiseTimelineScrollBar();
}

private function setVars()
{
scrollbar = new Scrollbar();
cp = new CommonProperties();
stage_width  = cp.stage_width;
stage_height = cp.stage_height;
taTitleBarHeight = cp.taTitleBarHeight;
taTitleBarY  = cp.taTitleBarY;
taPanelY = cp.taPanelY;
taPanelHeight= cp.taPanelHeight;
commonGrey   = cp.tickColour;
headingFont  = cp.headingFont;
subheadingFont   = cp.subheadingFont;

scrollbar.x = 16;
scrollbar.y = 550-cp.titleBarHeight;

scrollableBase = new Sprite();
nonScrollableBase = new Sprite();
scrollableBase.y = 0;

addChild(scrollableBase);
addChild(nonScrollableBase);
}

private function addPanels():void
{
trace (Background panels added);

			createPanel(0, 1000, 0xB6, Prehistory, c. 1.7 million -  
4000 B.C.E.);
			createPanel(1000, 2000, 0xB65B00, Early Civilisations, c. 1.7  
million - 4000 B.C.E.);
			createPanel(3000, 2000, 0x123456, Sumfink Else, c. 1.7 million  
- 4000 B.C.E.);



}

		private function createPanel(panelX:Number, panelWidth:int,  
panelColour:uint, pTitle:String, date:String):void

{
			// SimpleRectangle class (rColour:uint, rOutlineColour:uint,  
rX:Number, rY:Number, rWidth:uint, rHeight:uint)
			var mainTitlePanel:SimpleRectangle = new SimpleRectangle(0xFF,  
panelColour, panelX, 0, panelWidth, taTitleBarHeight);

scrollableBase.addChild(mainTitlePanel);

			// SimpleTextField class (tfColour:uint, 

  1   2   3   >