Re: [Flashcoders] The Charges Against ActionScript 3.0

2008-07-17 Thread elibol
The only one that makes any sense is #2, and that is being addressed with
Loader.unloadAndStop(), except for the most part I'm kind of wary about
having the Loader class tear my loaded swfs a new one. I kind of agree with
Sacks when he more subtly articulates that this is for noobs. I was
expecting charges more along the lines of Remove auto-declare stage
instances and ever having to declare stage instances and just use
getChildByName(). - but I guess that would be a charge against the Flash.

Thats my two cents.

H

On Wed, Jul 16, 2008 at 10:46 PM, Kerry Thompson [EMAIL PROTECTED]
wrote:

 Steven Sacks wrote:

  Flash used to be a toy, and, up until Flash 8, it still could beThe
 reason
  you see so much BAD Flash is because it was SO EASY to use for even non
  programmers.

 Steven has a point (even though I cut most of his post). Remember the days
 when Flash's nickname was Skip-intro?

 The Internet has changed, and will continue to change. It has gotten more
 sophisticated. Browsers have gotten more sophisticated. Users have gotten
 more sophisticated. To keep Flash/Flex as a premier Web development tool,
 it
 has to get more sophisticated, and its users must get more sophisticated.

 Having said that, I'd like to see Flash have drag-and-drop behaviors like
 Director has. In its first decade or so, Director followed a similar path
 as
 Flash. It started out as a simple animation tool with an easy-to-use
 language, and developed into a sophisticated programmer's tool. The
 introduction of drag-and-drop behaviors brought it back into the realm of
 the designer, while remaining a sophisticated programmer's tool.

 Of course, Macromedia made a number of blunders with Director/Shockwave
 that, I hope, will not be repeated by Adobe on Flash. Making it more
 sophisticated was not one of those blunders, though.

 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 RegExp problem

2008-07-16 Thread elibol
Hi Adam,

I just wanted to note a few things, to get you on the right track here...

If you're going to extend RegExp, pass vars to the constructor, otherwise
you aren't using the super class at all.

public function CustomRegExp() {
   super((\d+)(\d{3}(\.|,|$)), gi);
}

The convert function might then look something like this:

public function convertToCurrency ($val:Number):String {
  var returnString:String = String($val.toFixed(2));
   while (returnString.match(this).length != 0) {
  returnString = (returnString.replace(this, $1,$2));
  }
  return returnString;
}


As for the reg ex, since there are no alphas involved, you probably don't
need the i flag set. Since you have g, there isn't a need for the loop. The
function only takes numbers, so you don't need to check for chars ,$. I had
to write a function that would create thousand separators for a number. I
used the following technique, and I came up with this due to my limited
knowledge on regexp, and time constraints. It isn't the most elegant
solution, but it should solve the toughest part of the conversion:

function thousandSeparator(value:Number):String {
  var va:Array = value.toString().split(.);
  va[0] = va[0].replace(new RegExp((^[0-9]{+(va[0].length%3 ==
0?3:va[0].length%3)+}|[0-9]{3}),g), ,$1).substr(1);
  return va.join(.);
}

You might want to use toFixed(2) in place of toString to get your precision
right, and then it might be a good idea to replace [0-9]'s with d...

Good luck with it,

Melih

blog.computerelibol.com

On Mon, Jul 14, 2008 at 6:49 AM, Adam Jowett [EMAIL PROTECTED]
wrote:

 Hey all,

 Just wondering if anyone more familiar with RegExp can pick what might be
 causing the convertToCurrency function below to crash the Flash IDE and/or
 browser (no problems if publishing from a straight FlashDevelop project for
 some reason). Below is firstly how I call it, and secondly the class itself:


 ...

 private var _global:Object = GlobalObject.vars;

 var currencyFormat:Function = new CustomRegExp().convertToCurrency;
 _global.convertToCurrency = currencyFormat;

 ...


 package utils.CustomRegExp
 {
   public class CustomRegExp extends RegExp
   {
   public function CustomRegExp()
   {
   }
 public function convertToCurrency ($val:Number):String
   {
   var pattern:RegExp = /(\d+)(\d{3}(\.|,|$))/gi;
   var returnString:String = String($val.toFixed(2));
 while (returnString.match(pattern).length != 0)
   {
   returnString = (returnString.replace(pattern, $1,$2));
 }
 return returnString;
   }
   }
 }


 If there is an alternative to the above I would love to see it, but still
 curious why the above would cause problems.

 Cheers
 Adam

 ___
 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 Design Patterns Book

2008-07-11 Thread elibol
Hey Terry,

I'm assuming your project is an actionscript project ( as opposed to a flex
project ). This might be what you need:

http://blog.madebyderek.com/archives/2007/01/12/as3-projects-and-the-swf-metadata-tag/

Hope this helps,

H

On Fri, Jul 11, 2008 at 12:10 PM, Terry Riney [EMAIL PROTECTED] wrote:

 Good Morning,



 I am getting deep into ActionScript 3.0 Design Patterns. Have been using
 Flex Builder.



 I am trying to follow all the sample files from this book which are written
 towards CS3. I understand the basic differences, the document class and
 all.
 But I am unsure on a few things.



 I am trying to concentrate on the Patterns and not the program I am using
 to
 test the samples files.



 One instance that comes to mind is chapter 8 where the author uses
 AlienAttack.fla/swf. I have to stop to figure out what I should do in FB to
 create *.as file with exact stage width/height. Even though I understand
 the
 stage property must not be called directly. There are other chapters where
 this must be addressed.



 The author only mentions workaround for those using FB? Has someone
 organized a site/link that steps someone through these differences in order
 that a person can concentrate on one thing (patterns) and not lose focus?



 Any help at all would be appreciated?



 Thanks,

 Terry

 ___
 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] complex button action

2007-09-17 Thread elibol
Hi,

I don't think you'll be able to accomplish a smooth solution using the
Tweener class as you will need to know the *change* for the easing effect to
look nice. You cannot know the change since the user will actually be
changing it. The way it would be done with the Tweener is to set it to ease
to each position, but this will not really work well on its own. There may
be a way to manipulate the input to get the desired effect, but you may not
want to go down that route. You could also tweak the easing algorithm to
take different parameters, but that's again a route you are probably going
to want to avoid.

I'd say abuse the Tweener and show the choppy result; show the client and
simply explain that given technical restrictions, making something smoother
is going to take more time.

There is a quick way to create a dynamic easeOut effect, but it may be alot
different than the effect you're using. This effect takes the difference in
the distance of two values and repeatedly reduces the difference by a
percentage. This creates a slowing down effect.

//assuming ball is a movieclip on the stage
ball._y = 0;
targetBallY = 100;
limit = 1; //pick a limit to stop easing
fact = 0.2; //pick a factor
function onEnterFrame(){
//get the difference
var difference = targetBallY-ball._y;
if(differencelimit) ball._y += difference*fact;
else {
ball._y += difference;
onEnterFrame = null;
}
}

On 9/17/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I have a movieClip that I move up or down based on it's curreny _y + a
 specified pixel height using Tweener code to move the movieClip smoothly.
 The action is called onRelease of an arrow movieClip.
 The client would now like it to constantly scroll onPress after holding
 the
 mousedown for say...1 or 2 seconds. Has anyone done anything like this?
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


Re: [Flashcoders] AS3 Events, Delegates and passing parameters

2007-08-30 Thread elibol
You can also use the Loader.name property to identify the image you're
loading.

To get a nicely encapsulated solution, you might want to consider
instantiating a new Loader object for each image. I would use weak
references (addEventListener(event, method, false, 0, true)). This way,
when the calling function is complete, there will be no references to the
Loader once the load method dispatches an event, and it will be marked for
garbage collection.

On 8/27/07, Dimitrios Bendilas [EMAIL PROTECTED] wrote:

 Of course!

 I can't believe it was that simple. I guess I wasn't used subclassing
 native
 classes so much.

 Thanks a lot Muzak. Troy, thanks for your reply too, I think what Muzak
 said
 was what I was looking for.

 Best regards,
 Dimitrios



 - Original Message -
 From: Muzak [EMAIL PROTECTED]
 To: flashcoders@chattyfig.figleaf.com
 Sent: Saturday, August 25, 2007 1:56 AM
 Subject: Re: [Flashcoders] AS3 Events, Delegates and passing parameters


  Create a custom class, extending Loader, that has an .id property.
 
  regards,
  Muzak
 
  - Original Message -
  From: Dimitrios Bendilas [EMAIL PROTECTED]
  To: flashcoders@chattyfig.figleaf.com
  Sent: Friday, August 24, 2007 9:42 PM
  Subject: [Flashcoders] AS3 Events, Delegates and passing parameters
 
 
  Hello everyone,
 
  I am just starting working with AS3 after many years working with AS1
 and
  AS2.
 
  I am trying to rebuild a Game/App development framework I had built in
  AS2 into AS3
  and I want to make sure I get it right from scratch.
 
  All these years I had been working with Delegates and specifically a
  custom Delegate class I had writen
  which allowed the user to pass extra parameters.
 
  Now for my new framework, I want to use the new extended event model of
  AS3, with addEventListener
  and subclassed Event objects. The problem is that I cannot find a
  solution that does not uses a Delegate object.
  I know that in AS3 callbacks are now executed with the proper scope, so
  this does not require a delegate as before,
  but I still haven't figured out how to pass parameters.
 
  Specifically, I cannot do this in situations like the following:
  Thank you,
 
  Dimitrios
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 


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

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

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

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


Re: [Flashcoders] HTML 4.0 parsing

2007-08-30 Thread elibol
You can parse it as an xml object, but other than that, I'm not sure what
you would parse it to. You cannot parse it to a DOM, but since as3
implements E4X, xml objects are very easy to work with.

On 8/27/07, Davor Bauk [EMAIL PROTECTED] wrote:

 Hello,

 Is it possible to parse HTML 4.0 natively in AS3 or  do I need to write
 (or find) a custom parser?

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

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

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

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


Re: [Flashcoders] Issue with Removing a Movie

2007-08-30 Thread elibol
You have menuExit_mc in quotes, it's being passed as a string. You need to
pass a reference to the movieclip.

On 8/30/07, Lord, Susan Ms. (CONTR) [EMAIL PROTECTED] wrote:

 Hi there, I have a set of buttons (menuExit_mc) that I load after I load
 an external swf (movie). When I click my main menu button, enacting
 mainMenu(), I want the menuExit_mc to be removed from the screen.  I am
 not sure why this is not working for me.

 Any ideas? Below is my code. Any help you can provide is appreciated.
 Thanks!


 load(movie, myLoadedClip_mc);
 attachMovie(mcMenuExit, menuExit_mc, getNextHighestDepth(),
 {_x:637.3, _y:559.8});

 function mainMenu() {
 trace(bing);
 unloadMovie(myLoadedClip_mc);
 gotoAndPlay(mainMenu);
 removeMovieClip(menuExit_mc);
 }

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

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

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

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


Re: [Flashcoders] onRollOver() not invoked for children MovieClips

2007-08-24 Thread elibol
Another solution:

Don't assign any events to the parent. Instead, create a child for that
parent and delegate that childs mouse events to the parent. Just make sure
that child has the lowest depth of the children. I think this will give you
the expected behavior.

Hope that helps,

H

On 8/24/07, Bob Wohl [EMAIL PROTECTED] wrote:

 (oops, man it's early, it's AS2... bleh..)

 When you add a rollover to a parent, it blocks all children of that mc
 from
 receiving rollOver calls since it is a part of the mc who's already
 received
 that call. So what I do is create a hitTest for the parent and then a
 onRollover for the children.

 hth
 (now back to my coffee)

 On 8/24/07, Bob Wohl [EMAIL PROTECTED] wrote:
 
  just a stab as I am not that AS3 savy, but wouldn't you want to run a
 hit
  test against the parent and rollover on the children? Just a guess.
 
 
  On 8/24/07, Alexander Farber [EMAIL PROTECTED] wrote:
  
   Hello!
  
   I have a MovieClip representing a player avatar.
   When the mouse pointer is over it, I change its
   filters from containing a shadow to a glow.
  
   Then I have a MovieClip representing a playing
   table and it works the same way.
  
   My problem starts when I put 3 player MCs
   on 1 table MC - then suddenly the player MCs
   stop working and do not react onRollOver:
  
   http://preferans.de/flash/Ellipse.swf
  
   I have (done my homework! :-) and
   prepared a simple test case here:
  
 http://preferans.de/flash/Child.as
  http://preferans.de/flash/Parent.as
 http://preferans.de/flash/TestParentChild.fla
 http://preferans.de/flash/TestParentChild.swf
  
   and I'll copy that test code at the bottom of
   this mail as well (for the archives). It has the
   same problem - when a child MC is placed
   on a parent MC, then it stops printing child.
   Only parent is printed. Any idea why?
  
   Regards
   Alex
  
   PS: Here is my test code:
  
   class Child extends MovieClip
   {
   var rect_mc:MovieClip;
  
   function Child() {
   rect_mc = this.createEmptyMovieClip('rect_mc',
   getNextHighestDepth());
   with (rect_mc) {
   beginFill(0xFF, 100);
   lineTo(0, 20);
   lineTo(20, 20);
   lineTo(20, 0);
   endFill();
   }
   }
  
   function onRollOver():Void {
   trace('child');
   }
   }
  
  
   class Parent extends MovieClip
   {
   var children:Array;
   var rect_mc:MovieClip;
  
   function Parent() {
   rect_mc = this.createEmptyMovieClip('rect_mc',
   getNextHighestDepth());
   with (rect_mc) {
   beginFill(0x00FF00, 100);
   lineTo(0, 100);
   lineTo(100, 100);
   lineTo(100, 0);
   endFill();
   }
  
   children = new Array(3);
   for (var i:Number = 0; i  3; i++)
   children[i] = rect_mc.attachMovie('Child',
   'child' + i + '_mc',
   rect_mc.getNextHighestDepth(),
   {_x: i * 30, _y: 0});
   }
  
   function onRollOver():Void {
   trace('parent');
   }
   }
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
  
 
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


Re: [Flashcoders] accessing super fields

2007-08-20 Thread elibol
In as3, variables (properties and methods) that are private are not visible
to subclasses, protected are accessible with this and super (as should be),
and public are accessible with this and super too (kind of obvious). as3
definitely rocks when it comes to variable scoping.

On 8/20/07, Mark Winterhalder [EMAIL PROTECTED] wrote:

 On 8/20/07, Hans Wichman [EMAIL PROTECTED] wrote:
  Hi Mark,
 
  why is it static?

 Uhm... because I didn't read properly, sorry. :/

  Its declared as private var not as private static var?

 I could swear it read 'static var' when I first read the mail. Now you
 made Gmail change it some how. :)

 Anyway, interesting question. I think Kerry's explanation is
 conceptually right, and even technically correct for AS3 as far as I
 understand the inner workings so far.
 But in AS2, when you do

 class SuperClass {
 private var _test:String = null;
 }

 technically you set SuperClass.prototype._test = null. So to do what
 you want to do, you can access it as this.prototype.prototype._test
 from within your child class instance.

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

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

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

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


Re: [Flashcoders] accessing super fields

2007-08-20 Thread elibol
Seems to perfect sense in as3...

On 8/20/07, Ron Wheeler [EMAIL PROTECTED] wrote:



 Hans Wichman wrote:
  Hi,
 
  okay thanks that comes as closest to an explanation as I'd like I
  guess, but.
 
  If I declare a method test() in superclass, i can call it from the
 subclass
  using super.test().
  Whether I have overwritten it or not.
 
  So why doesnt the same go for fields.
 
 
 Think about what this would mean.

 How would the methods in the superclass ever reference any variable?.
 Which _test would it use? How would the super class know that you had
 overriden _test?

 You would have to override every method to make such an idea work. Then
 you do not have extends anymore.

 Take a second and think about this. It can not work any other way.

 Ron


  I think its a bug to be honest.
 
  As Benny said, you dont need to, no i know! But appearantly it works
  different for fields than for methods.
 
  greetz
  JC
 
 
  On 8/20/07, Kerry Thompson [EMAIL PROTECTED] wrote:
 
  Hans Wichman wrote:
 
  lets say i have a superclass:
 
  class SuperClass {
   private var _test:String = null;
  }
 
  and a subclass:
 
  class SubClass {
  private function _testFunction () {
super._test = foo;
  trace (super._test);
  }
  }
 
 
  this traces undefined.
 
  If I remove the super. it works, but I like to know when I'm
 referencing
  super class fields.
 
  Actually, you're not referring to a superclass field in this instance.
  Your
  subclass inherits all the methods and variables of the superclass, so
  _test
  is a member of the object you create using SubClass.
 
  You need to use super when you have overridden a method or variable.
 For
  example, if you have an Init() method in both, and you want to run the
  superclass's Init() first, you would call super.Init();
 
  Otherwise, you treat inherited methods and vars as if they were part of
  the
  subclass--which they are. They're just inherited, not declared.
 
  Cordially,
 
  Kerry Thompson
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


Re: [Flashcoders] accessing super fields

2007-08-20 Thread elibol
make*...

On 8/20/07, elibol [EMAIL PROTECTED] wrote:

 Seems to perfect sense in as3...

 On 8/20/07, Ron Wheeler [EMAIL PROTECTED] wrote:
 
 
 
  Hans Wichman wrote:
   Hi,
  
   okay thanks that comes as closest to an explanation as I'd like I
   guess, but.
  
   If I declare a method test() in superclass, i can call it from the
  subclass
   using super.test().
   Whether I have overwritten it or not.
  
   So why doesnt the same go for fields.
  
  
  Think about what this would mean.
 
  How would the methods in the superclass ever reference any variable?.
  Which _test would it use? How would the super class know that you had
  overriden _test?
 
  You would have to override every method to make such an idea work. Then
  you do not have extends anymore.
 
  Take a second and think about this. It can not work any other way.
 
  Ron
 
 
   I think its a bug to be honest.
  
   As Benny said, you dont need to, no i know! But appearantly it works
   different for fields than for methods.
  
   greetz
   JC
  
  
   On 8/20/07, Kerry Thompson [EMAIL PROTECTED] wrote:
  
   Hans Wichman wrote:
  
   lets say i have a superclass:
  
   class SuperClass {
private var _test:String = null;
   }
  
   and a subclass:
  
   class SubClass {
   private function _testFunction () {
 super._test = foo;
   trace (super._test);
   }
   }
  
  
   this traces undefined.
  
   If I remove the super. it works, but I like to know when I'm
  referencing
   super class fields.
  
   Actually, you're not referring to a superclass field in this
  instance.
   Your
   subclass inherits all the methods and variables of the superclass, so
 
   _test
   is a member of the object you create using SubClass.
  
   You need to use super when you have overridden a method or variable.
  For
   example, if you have an Init() method in both, and you want to run
  the
   superclass's Init() first, you would call super.Init();
  
   Otherwise, you treat inherited methods and vars as if they were part
  of
   the
   subclass--which they are. They're just inherited, not declared.
  
   Cordially,
  
   Kerry Thompson
  
  
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
  
  
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
  
  
  
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 


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

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


Re: [Flashcoders] encrypt string (fast)

2007-08-16 Thread elibol
Why do you need to encrypt it? If you just need it unreadable, then why not
kill two birds with one stone and compress it?

http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/

On 8/16/07, Mick G [EMAIL PROTECTED] wrote:

 I need a way to encrypt a LARGE string (up to 100k of text) - my data is
 mostly xy coordinates so 90% numbers.

 I've tried a few AS encryption classes that I've found online and
 considering I have such a large string, they're all too slow. It doesn't
 need to be too secure - decryption speed is more import than security.

 I was thinking of just doing a simple custom character replace with
 split.join replacing each numeral 0-9 with a character, but does anyone
 have
 any other ideas on a efficient/fast way of doing this?

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

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

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

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


Re: [Flashcoders] html formatted text nodes in XML making ExternalInterface call

2007-08-15 Thread elibol
Hi Dane,

Have you tried just calling alert using ExternalInterface?

Since I'm not sure where the problem might be occuring, here's another
technique for calling javascript functions from as3:

replace
ExternalInterface.call
(MM_openBrWindow,fileNameToGo,'popupwindow','scrollbars=yes,width=760,height=400');

with
flash.net.navigateToURL(new
URLRequest('javascript:MM_openBrWindow('+fileNameToGo+',popupwindow,
scrollbars=yes,width=760,height=400);'));

Hope this helps.

On 8/15/07, Dane Williams [EMAIL PROTECTED] wrote:

 Greetings All,
 I have posted this on other Flash forums and have had no luck. Hopefully
 someone here will have some good news for me. This is for an AS3 project.
 Thanks!...

 I have a challenge that I need some help on. I have a site that is using
 Flash as a front-end reader of an XML file that is providing all content
 as
 html formatted text nodes. The information is being read into Flash and
 displaying exactly as I want it to. The problem is the anchor tags that
 are
 using event: to pass parameters to a function that includes an
 ExternalInterface call are not passing their info on to the javascript
 that
 is on the html wrapper file. I've included all the code below. Any help or
 suggestions would be greatly appreciated.

 The html info from the XML text node:
 a href=event:page.htmClick here for more information/a

 The javascript on the html wrapper:
 function MM_openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
 }

 The snippet of AS that makes the relevant calls (content_txt is the
 TextField that holds the text node html text:
 function openWindow(fileName:TextEvent):void {
 var fileNameToGo:String = fileName.text;

 ExternalInterface.call
 (MM_openBrWindow,fileNameToGo,'popupwindow','scrollb
 ars=yes,width=760,height=400');
 }
 content_txt.addEventListener(TextEvent.LINK, openWindow);

 The test site is at http://www.ddanewilliams.com/campelectric/ The file is
 rather large - I apologize. I haven't started tweaking and preloading
 anything yet. The link is on the last line of the about section.


 D. Dane Williams
 The Learning Center
 Buckman Laboratories, Inc.
 901-272-6774


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

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

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

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


Re: [Flashcoders] array copy with random order

2007-08-13 Thread elibol
This technique is dangerous for algorithms that work with how sorted the
array already is, like bubble sort. The condition that bubble sort depends
on to know when the array is sorted is whether it had to swap any numbers.
The speed of sort algorithms also depends on how many times a swap occurs. I
doubt that the adobe sort function uses bubble sort or anything of the like,
it's likely of O(N log N) complexity, which is of the fastest known, but
still slower than an array shuffle function which should be O(N).

On 8/13/07, T. Michael Keesey [EMAIL PROTECTED] wrote:

 On 8/13/07, Steven Sacks [EMAIL PROTECTED] wrote:
array2.sort ( function (){ return Math.round(Math.random()); } );
 
  That's brilliant!  :)
 
  To build upon that with all 3 outcomes (-1, 0, 1), you can use:
 
  Math.round(Math.random() * 2) - 1)

 Very interesting. But any time you use random numbers, you should be
 careful. I think this strategy may have the potential of taking a
 really long time once in a while, since the Array.sort function
 expects the compare function to return consistent results (i.e., if
 A  B then B  A, and if A == B then B == A). Of course, I'm not sure
 about this (anyone know which algorithm Array.sort uses?) and even if
 it's true, once in a while probably means something like once in a
 million times. If it's for a fun game or something, it's probably
 fine, but if it's for something with greater consequences for errors,
 you might want to take a closer look. (I missed the beginning of this
 thread, unfortunately.)

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

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

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

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


Re: [Flashcoders] Flashcoders [Object vars vs Component Params]

2007-08-08 Thread elibol
This depends on when the component you're using is instantiated. I don't
think the component will instantiate before the vars. The vars should be
available on the very first frame, meaning they are set before you're even
allowed to execute code...

Does that answer your question?

On 8/7/07, eric e. dolecki [EMAIL PROTECTED] wrote:

 Quick Q (without testing myself yet)...

 I have a component that takes params via Component Params panel
 (inspectable
 meta) - cool. But I also would like one to be able to set some of those
 params via SWFobject javascript. like:

 var so = new SWFObject(movie.swf, mymovie, 400, 200, 8,
 #336699);
 so.addVariable(variable1, value1);
 ...

 I can then have the component check a location (_root or _parent, etc)
 for those variables and then use those instead...

 I am assuming that the inspectable params are set before frame1, and
 then the vars passed into a SWF come in on frame1...

 Does this sound about right?

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

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

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

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


Re: [Flashcoders] Q: loop speed AS2 and AS3

2007-08-03 Thread elibol
I doubt there is anything faster about AVM1 over AVM2...

On 7/30/07, Andy Herrman [EMAIL PROTECTED] wrote:

 Wow.  I know Flash 9 was faster than 8, but I didn't realize it was
 that big a difference.

 Anyone know what the difference is in image processing speed?  I've
 been looking at porting an application we have to Flash that does a
 bunch of image processing (needs to be able to download raw image data
 at runtime, decompress it and then render it) but from what I heard
 from other Flash users Flash 7/8 isn't fast enough to handle that.

   -Andy

 On 7/27/07, greg h [EMAIL PROTECTED] wrote:
  Hi moveup,
 
  Here is pretty much a repeat on my response when you asked this same
  question back on 12/22/06 here on this list  ;-)
 
  Loops and then some ...
 
  Props to Mike Lyda for running the following tests over time (and to JD
 for
  originally bringing it to my attention.)
 
  Mike Lyda runs performance tests across various
  engineshttp://oddhammer.com/actionscriptperformance/(JavaScript vs.
  ActionScript vs Java)
  November 24, 2006
  Flash ActionScript performance vs JavaScript (includes Flash Player 9)
  http://oddhammer.com/actionscriptperformance/set4/
 
  JD on EP
  May 22, 2006
  AS3 performance tests
  http://weblogs.macromedia.com/jd/archives/2006/05/as3_performance.cfm
  (Note:  Mike subsequently updated the tests with the GA version of Flash
  Player 9 on November 24, 2006)
 
  Beyond, raw comparisons, last month Adobe Flex PM Matt Chotin presented
 on
  ActionScript 3 Performance tips.  Slides and Code here:
 
  ActionScript 3 Performance
 
 http://weblogs.macromedia.com/mchotin/archives/2007/06/slides_and_samp.cfm
 
  Ted Patrick presented on the same last year at MAX.  This google search
  surfaces stuff on Ted's site regarding performance:
  http://www.google.com/search?q=site%3Aonflex.org%20performance
 http://www.google.com/search?q=site%253Aonflex.org%2520performance
 
  hth,
 
  g
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


Re: [Flashcoders] Loading xml in AS 2

2007-08-03 Thread elibol
Assuming the loaded trace is not going through... Try tracing success
outside of the conditional. If you aren't getting any traces, make sure the
class is importing correctly. Double check your class path and that your
class defintion corresponds to the appropriate package. If it's just a
matter of success, then your xml doc is flawed or your path is incorrect.

On 7/30/07, Omar Fouad [EMAIL PROTECTED] wrote:

 class LoadXML {

 function LoadXML() {
 var xmlData:XML = new XML();

 xmlData.ignoreWhite= true;
 xmlData.onLoad = function (success) {
 if(success) {
 trace(loaded);
 }
 }
 xmlData.load(data.xml);
 trace(xmlData);
 }
 }
 this is not working

 --
 Omar M. Fouad - Digital Emotions
 http://www.omarfouad.net

 +2010 - 2346633 - +2012 - 261
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


Re: [Flashcoders] Couple questions re Zinc and Access

2007-08-03 Thread elibol
We've written an application using MSAccess DB. It was slow. Took longer
than it would using a webservice. What's worse is Zinc runs those commands
synchronous. Freezes the app for several seconds - until the command is
complete. There is a toggle to use the API asynchronous, but this does not
work. I did a side by side test with SQLite, and though it responds a couple
hundred milliseconds quicker, it's still pretty slow... I mean, a couple
hundred milliseconds is a long time in and of itself when you're speaking
desktop level responsibility.

This was about a year ago, so things may have changed... Just a friendly
heads up.


On 7/29/07, Troy Rollins [EMAIL PROTECTED] wrote:


 On Jul 29, 2007, at 2:37 PM, John Hattan wrote:

  FWIW, here's the page for my SQLite glue-DLL for Zinc. The Mac
  version works with mProjector, which is what I'm using for the Mac
  games (Zinc for Mac doesn't do universal binaries).

 Oh cool, I lost touch with mProjector... I hadn't realized they had
 gotten UB completed, and I see they even have a beta in place for AS3
 and FlexBuilder compatibility. Sweet, gotta check that out.

 --
 Troy
 RPSystems, Ltd.
 http://www.rpsystems.net


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

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

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

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


Re: [Flashcoders] ExternalInterface fails when accessed from vm1 and vm2

2007-08-03 Thread elibol
No, but I've witnessed bizarre behavior. Certain as1/2 coding practices
which work fine when embedded in html or run in the IDE appear to break
functionality when loaded into an avm2 shell. For example, there was a piece
of code for these as1/2 applications I was assigned to modularize that made
avm1 movies incapable of loading swfs. The piece of code was a vars property
set to _parent.someVar for TextField's instantiated by the timeline. It's
terrible code practice, and I was shocked it even worked in any case. Once I
loaded the swf which contained that TextField instance with that vars value,
avm1 applications would cease to load swfs. Fixing it was no problem...
Finding it? Oh... That was painful.

I wish I had more insight into your issue. What do you mean with your last
condition? and also uses this object?


On 7/25/07, Mark Carolin [EMAIL PROTECTED] wrote:

 Hi,

 Has anyone heard of the ExternalInterface Class failing in an AS3 file
 after
 an AS2 file has loaded into it and also uses this object?

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

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

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

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


Re: [Flashcoders] Integrating Flash SWFs with Flex

2007-08-03 Thread elibol
I would not say it works really really well... In some cases, it's actually
harder to integrate flash cs3 with flex this way than it is integrating AVM1
swf's (flash 8) with flex...

First, you can use any movieclip in a swc library so long as it's exported
in the first frame.

Second, you will only be able to add UIMovieClip (this is what the flex
component kit does) types to the stage, however, ordinary movieclips can
only be attached to UIComponent prototypes. The flex component kit just
imports a UIMovieClip class as a compiled clip and makes the target clip a
UIMovieClip subclass.

Third, don't expect any scripts to work unless they are *instantiated in
Flex*. For whatever reason, scripts are completely ignored on movieclip
instances that are instantiated by the timeline ( or not programmatically ).
Essentially, in that case, if you try to call stop on your movieclip at the
end of an animation sequence, it will not work.

Finally, you will probably not be able to use your component in flex unless
you instantiate everything programmatically. If you were to make your
component in Flex, you would need to subclass UIComponent and learn the
component framework. I would avoid this as there is quite a bit of
information you will need to gather in order to do this.

The most important consideration would probably be a simple public API.
Essentially, avoid making it capable of doing anything it doesn't need to.

On 7/30/07, Troy Rollins [EMAIL PROTECTED] wrote:


 On Jul 30, 2007, at 11:56 AM, matt stuehler wrote:

  Two questions -
 
  1. The client has asked about the feasibility of developing this in
  Flex instead of Flash. Since I'm only beginning to learn Flex, I can't
  really answer this. But my simplistic understanding is that, at a high
  level, Flex is a language for tying together individual Flash
  components into an overall UI/RIA. So, if you're building a low-level
  highly customized, unique component - Flash is the right tool for
  that, not Flex. Is this correct?

 Basically true, though unique components can be created in Flex/AS3
 as well, the process is a bit harder.

 
  2. Assuming 1. is correct, what special considerations are there for
  developing a Flash movie/widget/component that might be embedded in an
  HTML page, AND/OR used within a Flex application?

 Check out the FlexComponentKit, which I think is still on
 labs.adobe.com as a beta. It allows you to wrap MovieClips into a
 UIComponent in Flash, export them as an SWC, and reference them in
 Flex. Works really really well, and takes a lot of the effort out of
 the process of doing it in other ways.

 --
 Troy
 RPSystems, Ltd.
 http://www.rpsystems.net


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

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

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

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


Re: [Flashcoders] (OT) fscommand and air

2007-07-26 Thread elibol
Yea but it definite solves my problems.

Thank you Zarate.

On 7/26/07, Troy Rollins [EMAIL PROTECTED] wrote:


 On Jul 26, 2007, at 4:19 AM, Zárate wrote:

  If you need to creating PDFs from Flash itself, check out Alive PDF:
 
  http://www.bytearray.org/?p=104

 Personally, I was more interested in display of PDF content in a
 manner which is consistent with the rest of my applications. For
 this, *nothing* currently beats Director with the Impressario xtra.

 --
 Troy
 RPSystems, Ltd.
 http://www.rpsystems.net


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

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

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

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


Re: [Flashcoders] (OT) fscommand and air

2007-07-26 Thread elibol
Thank you John.

On 7/26/07, John Dowdell [EMAIL PROTECTED] wrote:

 I don't have the full thread here at the moment, but if no one has
 mentioned Gregg Wygonik's BlazePDF work, for creation of PDF files from
 within SWF, then here's the link:
 http://www.blazepdf.com/faq.html

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

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

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

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


Re: [Flashcoders] (OT) fscommand and air

2007-07-25 Thread elibol

Something along the lines of fscommand(exec, pdfOutput.exe source.html
target.pdf);

Or any other extension that might be useful for producing report documents
for our ROI/Value Calculator desktop products.

We are currently able to produce html reports for the desktop, but we cannot
produce pdf or ppt documents. Having these capabilities would add a lot of
value to our applications. It would additionally balance frequent technical
cases for using other OCX wrappers over AIR.

fscommand exec is the only way I could think of implementing this feature.
Is this command available in AIR? If not, why? Can we expect to see pdf and
ppt generation in subsequent versions?

On 7/25/07, John Dowdell [EMAIL PROTECTED] wrote:


 Curious, does anyone know anything about the capabilities of fscommand
in
 AIR applications?

FSCommand was originally for the plugin to communicate with its host
browser. Then later it was extended a bit to control properties of
Projectors. The current externalInterface communicates with the hosting
browser today.

But there isn't a hosting browser in AIR. What would you expect it to do,
what are you hoping to accomplish...?

jd/adobe



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

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


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

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


Re: [Flashcoders] Accessing MovieClips on a timeline from an AS3 class

2007-07-13 Thread elibol

For the most part, I agree with what Muzak has to say. It appears that if
you set an empty public setter function for the property with a private
getter, no runtime error is thrown. I'm left wondering why the virtual
machine needs to assign children of movieclips as instance named properties.
In Flex, we use getChildByName(), and if we want to we assign a child to a
property. I am working on a project at this very moment that demands complex
integration between CS3 and Flex, and I have to say, it has not been easy
coming up with a clean way to integrate these differences.

On 7/13/07, Muzak [EMAIL PROTECTED] wrote:


 Muzak - I share some of your frustrations though I see why they've done
it.

Then I'd like to hear 'why', because I can't think of anything.

Declaring instances in the class is a must (IMO).
As you said, you don't have to look at the fla to know what you're dealing
with.
Another important thing is that when declaring them as properties of the
class, using strong typing, you'll get codehints.
Assets that get automatically declared will give you no codehints at all.

 Adjusting the publish settings and setting the instances to public
 doesn't seem great.

The instances *have* to be public and *will* be public, doesn't matter if
you declare them yourself or if they're automatically
declared.
There's no way around it. Everything put on stage/timeline is public..

To make things worse, this feature can only be disabled on a document
level, not globally.
Edit  Preferences  ActionScript 3 Settings  *nada*

It can only be disabled through the Publish Settings.
So the more I look into this feature, the worse it gets..

Makes me wonder who they let into beta this time..

I've already made up my mind a while ago, I won't be doing any AS3
development with FCS3, I'll use the real thing: Flex.
The only interesting thing about FCS3 for me is creating components to be
used in Flex (using the Component Kit), which leads me to
another annoying result because of the stage-assets-will-be-public
feature:
When creating an FCS3 component to be used in Flex, with assets on stage,
those assets also become public in Flex and there's no way
around it.

sigh /

regards,
Muzak


- Original Message -
From: Sunil Jolly [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Friday, July 13, 2007 11:11 AM
Subject: RE: [Flashcoders] Accessing MovieClips on a timeline from an AS3
class


Muzak - I share some of your frustrations though I see why they've done
it.

So what do people think the best practice for this is?

I don't like the idea of not declaring the MCs/Buttons in the class
because it's a great help knowing what a class can deal with without
having to refer to the Flash file constantly.

Adjusting the publish settings and setting the instances to public
doesn't seem great.

Using getChildByName is a bit of a long solution too!

Also how would FDT (when the AS3 version is finally released!!) handle
this? Without declaring the instances they wouldn't have access to the
Flash stage before compilation would they? So I guess you'll have to
declare them for that functionality to work.

Thanks,

Sunil


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

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


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

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


Re: [Flashcoders] tween in a function doesn't working

2007-07-12 Thread elibol

I'm not sure what it could be, but you should try delegating the onRelease
function to this:

import mx.util.Delegate;

plus6_mc.plus6_btNext_mc.onRelease = Delegate.create(this,
btNext_mc_onRelease);

function btNext_mc_onRelease() {
  plus6_mc._y = -160;
  response2_mc._y = 123;
  animateIt(response2_mc)
};

The strange thing is, if this were the issue, your first code should not
work since response2_mc is not in plus6_btNext_mc's scope. My guess is that
animateIt is out of scope and that response2_mc is referenced somewhere in
plus6_btNext_mc.

One way to find out if it's scoping is to trace animateIt and response2_mc.

Hope this helps,

H

On 7/12/07, Marcelo Wolfgang [EMAIL PROTECTED] wrote:


Hi list,

I have some code that I've made that I don't understand why it is
failing, and I want your help

this works

var time = .3;
var easeType = mx.transitions.easing.Regular.easeOut;
var response2_mc:MovieClip = this.frmContato_response2_mc;
var plus6_mc:MovieClip = this.frmContato_plus6_mc;

plus6_mc.plus6_btNext_mc.onRelease = function() {
plus6_mc._y = -160;
response2_mc._y = 123;
var startY = response2_mc._y + 10;
var endY = response2_mc._y;
yTween = new mx.transitions.Tween(response2_mc, _y, easeType,
startY, endY, time, true);
alpha_Tween = new mx.transitions.Tween(response2_mc, _alpha,
easeType, 0, 100, time, true);
};

this don't

var time = .3;
var easeType = mx.transitions.easing.Regular.easeOut;
var response2_mc:MovieClip = this.frmContato_response2_mc;
var plus6_mc:MovieClip = this.frmContato_plus6_mc;

function animateIt(tgt){
var startY = tgt._y + 10;
var endY = tgt._y;
yTween = new mx.transitions.Tween(tgt, _y, easeType, startY, endY,
time, true);
alpha_Tween = new mx.transitions.Tween(tgt, _alpha, easeType, 0,
100, time, true);
}

plus6_mc.plus6_btNext_mc.onRelease = function() {
plus6_mc._y = -160;
response2_mc._y = 123;
animateIt(response2_mc)
};

I have many tweens like that, is that why I want to have a function to
just call it everytime it's need, any clues why it don't work when it's
called via function?

TIA
Marcelo Wolfgang



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

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


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

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


Re: [Flashcoders] Accessing MovieClips on a timeline from an AS3 class

2007-07-12 Thread elibol

I've been declaring classes extending MovieClip as dynamic. Using this to
get the child seems to work.

this.fullScreen;

And to get the object to cast to the proper type, I've had to have it in the
code.

FullScreen;
trace(this.fullScreen); //should trace [object FullScreen]

FYI, I've been using swc's to load MovieClips from Flash CS3. Things may
behave differently when working entirely in Flash CS3.

Also, I get namespace issues when I declare empty variables with movieclips
that already have instances of those objects. I mean essentially declaring
MovieClip extensions the old school way doesn't appear to work.

H

On 7/12/07, Sunil Jolly [EMAIL PROTECTED] wrote:


Does that work? I'm getting a namespace conflict.

Sunil

-Original Message-

Thanks all, I ended up with something like this...

package com.foo.view.playerSkins {

import flash.display.MovieClip;
import com.sky.view.playerSkins.*;

public class SkinInventory extends MovieClip{

private var fullscreen:MovieClip;

public function SkinInventory()
{
_init();
}

private function _init():void
{
fullscreen = getChild(this, fullScreen);
fullscreen = (fullscreen as FullScreen);
}

public function getChild(stage, _name:String):MovieClip
{
return stage.getChildByName(_name);
}
}
}

On 7/12/07, Sunil Jolly [EMAIL PROTECTED] wrote:

 Hi Matt,

 AS3 is slightly different.

 You need to say:
 private var fullScreen_mc:MovieClip = getChildByName(fullscreen);

 Note that the reference (fullscreen_mc) can't be the same as the name
on
 the stage (fullscreen). Also in AS3 you can actually set instance
 variables outside of functions.

 I'm quite new to AS3 so I'd be interested if there's another way to do
 this. I haven't really worked out a good naming convention for this
yet
 either - anyone have any ideas?

 Sunil

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

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


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

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


Re: [Flashcoders] breaking up long actions

2007-07-06 Thread elibol

I'm not sure you can interrupt the loop without modifying your code a little
bit... I'm also not sure what the most suitable solution would be given your
code structure, but I would say the cleanest way to do this is to break the
loop out into a function that takes a parameter for the amount of iterations
it should process for each interval. I like onEnterFrame as flash executes
code in frames, so with that in mind, you can set the function to return the
result of the test for the loop to indicate whether it has finished, and by
such, end or resume the onEnterFrame.

If you are using actionscript 2, you can also set properties on the
function. You can then track the iterator index using a function property.

function onEnterFrame() {
var resume:Boolean = operateLoop(3);
if(!resume) onEnterFrame = null;
}

function operateLoop(iterations:Number){
var iterationsI:Number = operateLoop.i+iterations;
if(iterationsIoperateLoop.max) iterationsI = operateLoop.max;
for(;operateLoop.iiterationsI;operateLoop.i++){
trace(operateLoop.i);
}
return operateLoop.ioperateLoop.max;
};

operateLoop.max = 12;
operateLoop.i = 0;

On 7/6/07, Hans Wichman [EMAIL PROTECTED] wrote:


Hi,
well it might be somewhere around that yes, and Im afraid I need them in
memory at runtime:)

greetz
JC


On 7/6/07, Mark Lapasa [EMAIL PROTECTED] wrote:

 Do you really need to have all the objects running in memory at runtime?
 If it's really really big, you might want to offload those objects to
 the backend and modify your current solution into one that paginates
 only what is needed. Are we talking like 10,000+ objects?






 Hans Wichman wrote:
  Hi list,
 
  I'm running a process on a tree of objects that require lots of
  objects to
  be created.
  This takes somewhere around 300ms on my pc, and will usually be run as
  the
  swf starts or as all classes have been loaded.
 
  300ms is enough for a stutter let alone when its run on slower pc's so
I
  want to break down the task in subtasks to have it more processor
  friendly.
 
  I know this has been discussed a few times but cant seem to find any
  resources on it.
 
  At the moment I'm thinking of using a stack of nodes to process, and
  using
  the stack and an alloted time, to complete the whole process, eg in
  pseudo:
 
  onInterval() {
if (process.isDone()) {
clearInterval and send done event
} else {
process.continue();
}
  }
 
  The problem is old but I was wondering if anyone has come up with good
  solution to this. Usually by the time we find out a process is slow,
  the way
  we built it doesnt really allow us to break it up in chunks easily,
  especially with recursive structures etc.
 
  regards,
  JC
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 


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

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

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

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


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

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


Re: [Flashcoders] least to greatest

2007-07-06 Thread elibol

Assuming you have something like this:

var list:String = 7,60,5,9,11,13,1;

var listArr:Array = list.split(,);
listArr.sort();

That should do it.

On 7/6/07, Corban Baxter [EMAIL PROTECTED] wrote:


Hey all I have a list of 10 numbers that I need to push into and array
from
least to greatest fairly often. What would be the fastest way to get this
accomplished? Or maybe just anyway to get this done would be a great help
thanks.

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

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


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

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


Re: [Flashcoders] swap depths with mask

2007-07-06 Thread elibol

Call something like this after you do the swap:

targetMC.setMask(maskMC);

This will reset the mask. Masking is tricky business. You cannot mask more
than one thing. I mention this in case you are using swapDepths to try and
cover more movieclips with your mask - it will not work... I don't think the
depth of the mask has any impact on how it works.

You might want to consider operating the masking mechanism programmatically
to begin with.

My summer is alright, thank you. Hope this helps.

H

On 7/5/07, Paul V. [EMAIL PROTECTED] wrote:


Hey guys, how is the summer treating you guys?  Quick question,  I am
running swapDepths() on a movClip and it's Mask layer. The mask doesn't work
after the swap and it is going to one level above the movClip.

So if anyone can direct me to how to fix this problem specifically that
would be great !!

Thanks,

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

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


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

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


Re: [Flashcoders] Re: Asynchronous ExternalInterface Calls From Javascript, possible?

2007-06-21 Thread elibol

Hmm, I think it checks for the crossdomain.xml file when the webservice
attempts to load/connect. Simple access to a file on a remote (sub)domain is
not allowed.

On 6/20/07, jason vancleave [EMAIL PROTECTED] wrote:


Seth Green seth.m.green at gmail.com writes:


 It turns out that the asynchronous web service call actually takes
 some extra time (like 100ms) the FIRST time you use that web service
 method.

Not to confuse the matters worse but I wonder if that has something to do
with
it looking for the a crossdomain.xml file.

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

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


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

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


Re: [Flashcoders] Any prefs for loading XML?

2007-06-21 Thread elibol

Best practice would have it load via an XML object.

I haven't coded in as2 for a while, but I believe the code is something
like:

import mx.utils.Delegate;

var xml:XML = new XML();
xml.load(./location/doc.xml);
xml.onLoad = Delegate.create(this, onLoad);

function onLoad(success:Boolean){
if(success){
trace(xml);
} else {
// your xml is junk.
}
}

hope that helps.

On 6/21/07, Dave Burnett [EMAIL PROTECTED] wrote:


Hi all, first post.

I'm a long-time AW developer and have integrated Flash into that, but not
done much ground-up Flash dev, so I know just enough to be dangerous.

Scenario:
LMS takes a couple parameters, generates an XML structure and launches
Flash
piece to consume it.

Question:
What's the most elegant way to get a .5 Mb XML structure loaded and
parsed?
I've done a bit of primary search and the options I've come across so far
are:

.load
Flashvars with URL
WDDX (It will be hosted on a LAMP setup)
Can I/would it be dumb, write the structure into the launch page as a
param
var

Thanks for any input.

Dave

_
Need a break? Find your escape route with Live Search Maps.

http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Parkcp=33.832922~-117.915659style=rlvl=13tilt=-90dir=0alt=-1000scene=1118863encType=1FORM=MGAC01

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

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


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

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


Re: [Flashcoders] Type Coercion Failed: Odd behavior.

2007-06-21 Thread elibol

As I understand, each child attempts to access their siblings via the
parent. What triggers the children to access their siblings?

On 6/21/07, Paul Chang [EMAIL PROTECTED] wrote:


Thanks for this reference. I performed a simple test and it works.

However, for my particular example, I receive an error.

var liquidObject:LiquidObject = parent.getChildAt(i) as LiquidObject;

assigns null to liquidObject.

The only thing that has worked for me so far is:

if (parent.getChildAt(i) is LiquidObject) {
trace(LiquidObject(parent.getChildAt(i)));
}

My only explanation is that I'm attempting to perform this cast
WITHIN the LiquidObject class itself.

I currently have the stated workaround, but any further insights
would be of interest to me.

Best,
Paul


On Jun 21, 2007, at 6:19 AM, Muzak wrote:

 You should always use the new as operator.

 This article might help:
 http://www.darronschall.com/weblog/archives/000211.cfm

 regards,
 Muzak


 - Original Message -
 From: Amir T Rocker [EMAIL PROTECTED]
 To: flashcoders@chattyfig.figleaf.com
 Sent: Thursday, June 21, 2007 11:39 AM
 Subject: Re: [Flashcoders] Type Coercion Failed: Odd behavior.


 Hi,

 i experienced the same behaviour using this type of cast

 var somVar = Caster( Castee );

 sometimes it works and sometimes it doesnt ...
 I tried to use the 'as' operator and that suddenly works where
 above coed failed.

 var someVar = list.getItemAt( i ) as TypeToCast;

 I hope maybe that works for you too. I havent figured the casting
 rules quite yet. So if anybody can explain it
 its really appreciated :)

 Best of luck
 Amir

 Am 04:07 AM 6/21/2007 schrieben Sie:
 Hello,

 I've created a custom class:

 LiquidObject extends Sprite

 I then create several instances of LiquidObject and add them as
 children to a parent Sprite.

 If I cycle through and trace the children as such:

 for (var i:int=0;iparent.numChildren;i++) {
 trace(parent.getChildAt(i));
 }

 Each trace shows the correct type of object:

 [object LiquidObject]

 When I tried to access a property specific to LiquidObject
 (LiquidObject.selected) it does not recognize this to be a property
 because it thinks it's dealing with a general Sprite. So, I attempt
 to coerce to type LiquidObject as such:

 for (var i:int=0;iparent.numChildren;i++) {
 trace(LiquidObject(parent.getChildAt(i)).selected);
 }

 Unfortunately, I receive an error stating that I can't coerce type
 Sprite to LiquidObject. I would think that this would be allowed
 since (a) LiquidObject extends Sprite and (b) parent.getChildAt
 (i) is
 already presenting a type LiquidObject in the trace.

 Any suggestions would be appreciated.

 Thanks in advance.
 Paul


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

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

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

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


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

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


Re: [Flashcoders] Asynchronous ExternalInterface Calls From Javascript, possible?

2007-06-20 Thread elibol

Aren't web service calls asynchronous, or am I missing something? I mean,
you typically have to set up a result function to handle the web service
response. Calling the service should not hold the function.

In any case, I'd expect you'd have to handle this like follows:

//javascript
function call(){
swfObject.call();
}

//flash
function call(){
}

function callBack(){
getURL(javascript:callBack();)
}

//javascript
function callBack(){
//this would be called when the service response is recieved.
}

On 6/20/07, Steven Sacks [EMAIL PROTECTED] wrote:


setInterval is a handy way to break scope.

Have the AS method called by JS set an interval for let's say 10ms, and
then have the method assigned to the interval take care of business.
Javascript will be free and Flash will keep on going.

-Steven


Seth Green wrote:
 I'm not calling a JS function from flash until the end of this process.
 It is the beginning of this process that I want to be made asynchronous.
  In the beginning I am calling a flash function from JS. That is the
 piece I am trying to get to be asynchronous.

 jtgxbass wrote:
 You could make use of ExternalInterface.addCallback. Therefore the JS
 function you call with ExternalInterface.call starts some process off
 then
 returns straight away. When your process is done it calls your
registered
 flash callback. Therefore you end up with asynchronous.

 All said and done, why not call the webservice straight from flash?

 On 6/19/07, Seth Green [EMAIL PROTECTED] wrote:

 I have a web app that uses a flash movie as a proxy to a web service.
 Therefore, I have javascript calling flash methods that in turn make
 requests to a web service and then route the response back to
 javascript.

 I don't need my javascript functions to wait on this calls, but
 ExternalInterface is inherently synchronous. And to my surprise I have
 found that a flash method which does nothing but make a web service
 request can take 100ms or more. This is unacceptably slow, but
 especially so since my javascript code has to hang while the flash
 method does its business.

 Does anyone have any experience with this issue, or can provide a
 workaround or hint as to how I might make these calls asynchronous?

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

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

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

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

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

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

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

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


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

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


Re: [Flashcoders] Trying to know size of loading swf

2007-06-20 Thread elibol

I believe it's a timing issue. It may take an extra frame to actually
initialize... Try running an onEnterFrame from onLoadInit to check the size
continually until it's greater than 0.

function onLoadInit(_mc:MovieClip) {

_mc.onEnterFrame = function(){
trace(this._width);
trace(this._height); //this == _mc
}

 _mc.play();

 host._visible=true;

};

hope that works... :)


On 6/20/07, natalia Vikhtinskaya [EMAIL PROTECTED] wrote:


Hi to all

I should load swfs with different sizes in host mc ( I have empty mc on
the
stage with this name)  . A window for showing them has smaller size. So I
should scale these swfs.

I thought that I can catch size of loading swf  in  onLoad Init function
and
than scale host mc.



function onLoadInit(_mc:MovieClip) {

trace(host._height)

trace(_mc._width)

   _mc.play();

   host._visible=true;

};

But it is always show size 0; Can anybody help me with this problem?
Thanks.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Mouse Velocity?

2007-06-20 Thread elibol

Try using onMouseMove/onEnterFrame to collect the mouse position. You are
sure to get changes per frame with either approach, but onMouseMove is
probably better in terms of performance.

Still use setInterval to get the data collected last from onMouseMove and
average the data to get a measurement at some rate, for example, 3 pixels
per 100 milliseconds if setInterval were set to 100.

Not sure if that's what you're looking for, hope it's of help.

On 6/20/07, eric e. dolecki [EMAIL PROTECTED] wrote:


I am calculating mouse velocity, but every now and then you get a 0 for
velocity eventhough its not 0 (setInterval prob I suspect).  Any better
approach?

var MouseX;
var MouseY;

function determineVelocity():Void
{
MouseX = _root._xmouse
MouseY = _root._ymouse
setTimeout( calc, 9 );
};

setInterval( determineVelocity, 20 );

function calc():Void
{
var newMouseX:Number = _root._xmouse;
var newMouseY:Number = _root._ymouse;

var deltaX = Math.abs(MouseX - newMouseX)
deltaY = Math.abs(MouseY - newMouseY)
dist = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY))
velocity = dist*31; // 31 = fps
trace( velocity );
};
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Does FLEX have web services?

2007-06-19 Thread elibol

yes

On 6/19/07, Pete Miller [EMAIL PROTECTED] wrote:



Does FLEX include a SOAP-based web services component?  Does it work
better than the buggy MX component (i.e. huge memory leak)?

We have shied away from Flash Remoting for the time being; I'm simply
looking to determine if there is support for SOAP web services.

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

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


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

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


Re: [Flashcoders] asfunction and single param

2007-06-19 Thread elibol

try escaping the url being passed as the param. Having two protocols
(asfunction: and http:) is probably the cause of your problem. You'll want
to unescape it from within the function as well. I think using the target
attribute as Jason mentioned is a better solution.

On 6/19/07, Raphael Villas [EMAIL PROTECTED] wrote:


Hi everyone,

I'm generating a hyperlink within a textarea component. I'd like to
do a getURL by generating HTML that includes the hyperlink, opening
up the page in a new window. So far, I have managed to generate the
link and open up the page, but not in a new window. It would be great
to use an asfunction call to a method that uses getURL with a
_blank parameter, but it doesn't seem to be working for me.

Any help is appreciated. If there's a better way to do this, do let
me know. Here's my code:

/**
* This works
**/

switch ( tNode ) {

case web :
var tURL:String = dealerNode.childNodes[y].childNodes
[0].nodeValue.trim(); //This picks up the url
var webURL:String = Website: font color='#ff'ua
href='asfunction:openInBrowser,http://; + tURL + ';
theOutput += webURL;

break;
} // Another switch statement closes the font and hyperlink tags



/**
* Here's my altered code... Since I can only pass in one parameter,
I'm defining a function to open the link in a new window, but it
doesn't work
**/

switch ( tNode ) {

case web :
var tURL:String = dealerNode.childNodes[y].childNodes
[0].nodeValue.trim(); //This picks up the url
var webURL:String = Website: font color='#ff'ua
href='asfunction:openInBrowser,http://; + tURL + ';
theOutput += webURL;

break;
}


function openInBrowser(url){
getURL(url);
trace(url); //This doesn't work either
};

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

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


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

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


Re: [Flashcoders] onRelease, onPress missing with attachmovie and DoubleClick class

2007-06-19 Thread elibol

I'm not sure what's going on, but maybe your problem might have to do with
not extending MovieClip.

Have your doubleclick class extend MovieClip.

Not sure what you mean when you say that when you remove the class,
attachmovie works with onRelease...

Sorry.

On 6/17/07, Johnny Zen [EMAIL PROTECTED] wrote:


Hi all

Forgive me, i'm learning here :)

If i use attachmovie to add a mc to he stage which has a doubleclick
class attached to the mc in the library, i cant use onRelease or
onPress.

If I remove the class, attachmovie works with onRelease etc

Why is this?

Is there a simple answer?


Kind regards


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

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


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

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


Re: [Flashcoders] asfunction and single param

2007-06-19 Thread elibol

I think now that it's a scoping issue. Make sure the function is defined in
the same class/movieclip as the textfield which contains the asfunction. You
then just have to delegate it to where you need it.

On 6/19/07, Raphael Villas [EMAIL PROTECTED] wrote:


Here is a trace from using the first strategy:
==
Website: font color='#ff'ua href='asfunction:getURL,http://
www. google.com' TARGET='_blank'www. google.com/a/u/font
==
The url still opens up in the same window as the Flash file, not a
new window.


The second strategy still doesn't work for me. It doesn't seem to be
finding the function. Here's the trace:
===
Website: font color='#ff'ua
href='asfunction:openInBrowser,http://www.google.com'www.google.com/
a/u/font
===
I've tried to remove the param and see if it can fire 'openInBrowser'
with a simple trace, but it doesn't fire.


Thanks for the feedback so far. Let me know if there are any other
thoughts on this.

:)



On Jun 19, 2007, at 12:56 PM, Merrill, Jason wrote:

 Are you assembling a string like this:

 A
 HREF=http://www.adobe.com/cfusion/knowledgebase/index.cfm?
 id=tn_14157
 TARGET=_blank

 or maybe this:

 A HREF=asfunction:myFunction,myParam TARGET=_blank

 ?  If you use HTML text, getURL() is not necessary.

 If you want to use getURL afterall, then this should work:

 A HREF=asfunction:openInBrowser,myURLMy Text/A

 function openInBrowser(url)
 {
   getURL(url, _blank);
 }

 But I don't see why the latter option would be necessary.

 Jason Merrill
 Bank of America
 GTO Learning  Leadership Development
 eTools  Multimedia Team

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

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


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

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


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

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


Re: [Flashcoders] Grid - getting neighbouring positions

2007-06-18 Thread elibol

You might repeat the algorithm for getting the first ring on each cell that
makes up that ring.

A lazy way to do it would be to exclude the cell that the ring is
originating from, and any cells that have already been found.

A better solution would be to get the angle between the center and the
particular cell and take all cells in that area using some calculation that
correlates to the rate at which the area of the cells being captured grows.
You might need a bigger sample to get a solid formula for growth.

In any case, the initial data structure is what determines the algorithm, so
it might be best to come up with a data structure that links cell neighbors
the way you need them to be on construction in order to process finding
those neighbors right from the start.

One final approach that hit me just in case you are working with movieclips:
Create a circular clip, resize it centered where you are creating the ring,
and do a hit test on all the cells. Successful hit tests mean that they fall
in the perimeter of the circle. There is a ratio that relates the circle
size to the size of each ring, resize at that rate and you will get one ring
at a time.

Good luck!

On 6/16/07, Jiri Heitlager | dadata.org [EMAIL PROTECTED] wrote:


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

I have the following grid and would like to find the neighbouring
positions of a certain point, going in a radius from in to out, covering
all the positions.

Let say I take point [2,2] then its neighbours are in the first ring
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't
got a clue on how to do that.

Can somebody help me?

Thank you,

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

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


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

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


Re: [Flashcoders] AS3 new Class from string

2007-06-18 Thread elibol

Not sure since eval() is gone.

Try keeping a reference for each class in some object and use it like a hash
map.

import Circle;
import Square;
import Triangle;

var classes:Object {
Circle:Circle
, Square:Square
, Triangle:Triangle
};

var list:Array = new Array(Circle,Square,Triangle);

for(var i=0;ilist.length;i++){
  var cls:Class = classes[list[i]];
  var instance:* = new cls();
}

It would be nice to see a less involved solution though...

On 6/18/07, Patrick Matte|BLITZ [EMAIL PROTECTED] wrote:


Hey fellows, in AS3 how can I create class instances from a list of
classes names. Take for example something like this:

import Circle;
import Square;
import Triangle;

var list:Array = new Array(Circle,Square,Triangle);

for(var i=0;ilist.length;i++){
var class = new list[i]();
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] AS3 new Class from string

2007-06-18 Thread elibol

Actually, I would do it how Jim suggested - using the getDefinitionByName
function. It's that less involved solution I did not know about. Where is
this function documented?

On 6/18/07, Jim Kremens [EMAIL PROTECTED] wrote:


There's also this:

var ClassRef:Object = getDefinitionByName(flash.display::Sprite);
var element:Sprite = new ClassRef();

That allows you to really use a string and not a class reference,
which is what I think you want...

But, as with Flash 8, the class reference must really exist in your
swf somewhere, so
you may as well do what elibol suggested...

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

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


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

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


Re: [Flashcoders] AS3 new Class from string

2007-06-18 Thread elibol

I see what you mean Jim. Maybe it's best used for classes loaded via swc
libraries.

On 6/18/07, elibol [EMAIL PROTECTED] wrote:


Actually, I would do it how Jim suggested - using the getDefinitionByName
function. It's that less involved solution I did not know about. Where is
this function documented?

On 6/18/07, Jim Kremens [EMAIL PROTECTED] wrote:

 There's also this:

 var ClassRef:Object = getDefinitionByName(flash.display::Sprite);
 var element:Sprite = new ClassRef();

 That allows you to really use a string and not a class reference,
 which is what I think you want...

 But, as with Flash 8, the class reference must really exist in your
 swf somewhere, so
 you may as well do what elibol suggested...

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

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




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

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


[Flashcoders] Senior Flex/Flash Developer

2007-03-26 Thread elibol

http://www.krop.com/jobs/b8c2d/http://www.pierinc.com/

PIER, Inc. http://www.pierinc.com/Boston, MA, USA Senior Flex/Flash
Developer

*Description*

It has always been PIER's goal to think differently about what the web is
capable of, and to push that agenda through cutting edge design and
development. PIER is now looking to expand its team of professional
developers in order to meet this challenge, and in doing so shift the way
that people think about software. PIER is seeking an experienced Flash RIA
developer who understands the new standard for application development. They
must be designed as solidly as they are programmed. We are looking for
someone with a passion for Flash development and a willingness to work in a
highly specialized team of designers, developers, and project managers to
build cutting edge products for PIER's worldwide clients.

*Responsibilities include the following:*

  - Develop dynamic data-driven interactive applications
  - Work closely in an integrated team of Project Managers, Designers,
  Interface/CSS Developers, and client staff
  - Manage multiple projects with multiple deadlines efficiently and
  effectively
  - Communicate within a team to ensure projects hit budget and time
  deadlines
  - Further PIER's process and product lines
  - Push the envelope on projects in need of cutting edge technologies
  - Help PIER continue to forge ahead into the forefront of Ajax, Flash,
  Flex and Apollo application development

*Qualifications  Skills:*

  - 5 years of studio/corporate experience
  - Expertise in ActionScript 2.0
  - Knowledge of ActionScript 3.0, Flex framework, and development
  processes
  - Knowledge of ColdFusion, XML, XHTML, JS, and Ajax a plus
  - Knowledge of database design and development a big plus

*About PIER*

Pier integrates business strategy, interactive design, and technology
development services for changing companies worldwide. Our process consists
of distilling our client's most complex challenges into a singular vision,
and executing that vision with pioneering design and development solutions.

Pier has helped clients like Microsoft, HP, Honeywell, and many others by
increasing workplace efficiency, building flexible, web-based
infrastructures, and dramatically improving customer experiences. With
S.W.A.T. style development capabilities, Pier architects complex web-based
systems, while hiding that complexity behind minimal and efficient
interfaces.
www.pierinc.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


[Flashcoders] Re: Senior Flex/Flash Developer

2007-03-26 Thread elibol

To apply, email a cover letter and resume with salary requirements and
three references to: [EMAIL PROTECTED]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] Actionscript 3.0 help w/ simple HelloWorld

2007-03-26 Thread elibol

Hi Rob,

The ability to define multiple classes in a single package was removed as of
Flex 1.5. It was removed with the class modifier *private*. There is still a
way to do it though.

First you need to change your file name to match the main class that is
being defined. The main class is the class that is within the package block.
You can then define any additional classes *outside* of the package block.
Classes outside of the package block cannot have any modifiers. The classes
are scoped to the classes within the .as file; no class outside of the .as
file can access these classes.

On 3/26/07, Rob Romanek [EMAIL PROTECTED] wrote:


Hi Ron,

Thanks for the suggestion but still no luck on my end.

It seems that on my set up I need to have a constructor named the same as
the .as file and that constructor has to be initiated prior to any of the
other classes being initiated. So I set up

public class MyPackage{
public function MyPackage{
}
}

and then can either do an import or set up the .as file as my document
class and after that I can access HelloWorld or MyClass. This seems to
follow the examples that came with the Flash 9 alpha, which all use the
document class approach and none of the .as files has more than one class
in them, even though you can put more than one class inside. So I'm still
a bit flummoxed as to how the package is working for Jason and not me, ah
well. Probably something stupid I'm doing and the light will go in a few
days.

Just to complete this I've also tried creating a folder called MyPackage
and putting the .as files in there and again without the constructor named
the same as the .as file it did not work

My understanding of 'package' is that the dot path that occurs after it is
the path to the .as file so if the MyPackage.as is sitting in the same
directory as your .fla then I would only have 'package' at the top of the
file, if it were in a directory called MyPackage then the syntax would be

package MyPackage

thanks for ideas,

Rob

On Sat, 24 Mar 2007 09:26:10 -0400, Ron Wheeler
[EMAIL PROTECTED] wrote:

 Something to try

 change
 import MyPackage.*;
 to import myPackage.HelloWorld

 import myPackage.MyClass


 See if the errors change.

 Ron

 Merrill, Jason wrote:
 I dunno, that's how I have it set up and it works fine for me - Perhaps
 your Flash 9 Preview Alpha is messed up.  I assume your publish
settings
 are all correct, - I don't know why it would do that.

 Jason Merrill
 Bank of America  GTO Learning  Leadership Development
 eTools  Multimedia Team
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Actionscript 3.0 help w/ simple HelloWorld

2007-03-26 Thread elibol

Here is a good article on class/package syntax and structure:

http://probertson.com/articles/2006/07/28/one-file-many-as3-classes/

It turns out that one class per package is a Flex limitation.

On 3/26/07, elibol [EMAIL PROTECTED] wrote:


Hi Rob,

The ability to define multiple classes in a single package was removed as
of Flex 1.5. It was removed with the class modifier *private*. There is
still a way to do it though.

First you need to change your file name to match the main class that is
being defined. The main class is the class that is within the package block.
You can then define any additional classes *outside* of the package block.
Classes outside of the package block cannot have any modifiers. The classes
are scoped to the classes within the .as file; no class outside of the .as
file can access these classes.

On 3/26/07, Rob Romanek [EMAIL PROTECTED] wrote:

 Hi Ron,

 Thanks for the suggestion but still no luck on my end.

 It seems that on my set up I need to have a constructor named the same
 as
 the .as file and that constructor has to be initiated prior to any of
 the
 other classes being initiated. So I set up

 public class MyPackage{
 public function MyPackage{
 }
 }

 and then can either do an import or set up the .as file as my document
 class and after that I can access HelloWorld or MyClass. This seems to
 follow the examples that came with the Flash 9 alpha, which all use the
 document class approach and none of the .as files has more than one
 class
 in them, even though you can put more than one class inside. So I'm
 still
 a bit flummoxed as to how the package is working for Jason and not me,
 ah
 well. Probably something stupid I'm doing and the light will go in a few
 days.

 Just to complete this I've also tried creating a folder called MyPackage

 and putting the .as files in there and again without the constructor
 named
 the same as the .as file it did not work

 My understanding of 'package' is that the dot path that occurs after it
 is
 the path to the .as file so if the MyPackage.as is sitting in the same
 directory as your .fla then I would only have 'package' at the top of
 the
 file, if it were in a directory called MyPackage then the syntax would
 be

 package MyPackage

 thanks for ideas,

 Rob

 On Sat, 24 Mar 2007 09:26:10 -0400, Ron Wheeler
 [EMAIL PROTECTED] wrote:

  Something to try
 
  change
  import MyPackage.*;
  to import myPackage.HelloWorld
 
  import myPackage.MyClass
 
 
  See if the errors change.
 
  Ron
 
  Merrill, Jason wrote:
  I dunno, that's how I have it set up and it works fine for me -
 Perhaps
  your Flash 9 Preview Alpha is messed up.  I assume your publish
 settings
  are all correct, - I don't know why it would do that.
 
  Jason Merrill
  Bank of America  GTO Learning  Leadership Development
  eTools  Multimedia Team
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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




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

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


Re: [Flashcoders] QT in IE returning null value to flash

2007-03-23 Thread elibol

Hey Bob,

Try window.movie1 for IE.


On 3/20/07, Bob Wohl [EMAIL PROTECTED] wrote:


Hello all,


I've researched quite a bit over the past week to no avail on how in
IE i get a return of null when pulling the time from a QT file but in
FireFox i get the proper time...


flash call -
myTime = ExternalInterface.call(DisTime, document.movie1);


js -
function DisTime(anObj){
   var obj = eval(anObj);
  return obj.GetTime();
   }


seems simple enough but I cannot for the life of me find out why IE
sees it as null.

Any ideas, pointers?


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

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


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

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


Re: [Flashcoders] Flash 8 textfields in a Flash 7 SWF

2007-03-22 Thread elibol

Actually, Flash Player 7 can play Flash 8 swfs. Textfields with Flash 8
featuers (like advanced anti-aliasing) will just not render. Make sure you
have no Flash 8 features applied to your textfield, or the movieclip
containing it, and it will render as it should.

I'm not sure why it was mentioned that System.capabilities.version would be
unreliable, but in case that it really is, you can use swfObject to
determine the player type.

The javascript:

var a = deconcept.SWFObjectUtil.getPlayerVersion();
var pVer = escape(String([a.major, a.minor, a.rev]));

You can then pass pVer to your swf via FlashVars or SetVariable().

Personally though, I would publish 2 versions of the website, one Flash 7
SWF and one Flash 8 SWF.

www.pierinc.com

On 3/21/07, Mick G [EMAIL PROTECTED] wrote:


You can use:

trace(System.capabilities.version);

to find the player version, then if it's  7, do a loadMovie to load your
v8
SWF.



On 3/21/07, Jake Prime [EMAIL PROTECTED] wrote:

 Hi

 I have a SWF which is published as Flash 8 purely to take advantage of
 the filter effects that can be applied to dynamic text fields. The
 problem is that I am now forced to deploy the project to Flash 7.

 I was hoping that I could do a detect within the SWF and serve up the
 nice Flash 8 text fields for the majority who can see it, and just
 have the plain old 7 ones for those who can't.

 Is there a way to do this within a single SWF?

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

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

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

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


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

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


Re: [Flashcoders] Actionscript 3.0 help w/ simple HelloWorld

2007-03-22 Thread elibol

Hi Jason,

Try setting the width and the height of the Textfield.

www.pierinc.com

On 3/22/07, Merrill, Jason [EMAIL PROTECTED] wrote:


Getting my feet wet with AS3, I just bought the AS3 cookbook and have
learned a lot already - great book.  I feel like an idiot asking this as
I'm pretty good in AS2, but with AS3, I'm not getting a simple script
working. I have the Flash 9 AS3 preview, trying to write a simple
HelloWorld class (based on an example in the book) to show a TextField:

//MyPackage.as
package MyPackage
{
//do I actually need this one?:
import flash.display.DisplayObjectContainer;

import flash.display.Sprite;
import flash.text.TextField;

public class HelloWorld extends Sprite
{
public function HelloWorld()
{
var message_txt:TextField = new TextField();
message_txt.text = Hello World;
addChild(message_txt);  //does not show!
trace(constructor runs)//traces fine
}
}
}

Then in the .fla, I put:

import MyPackage.*
var hw:HelloWorld = new HelloWorld();

The constructor traces fine in the output window, but the TextField does
not show.  What have I done wrong?  My Export settings in F9 As3 preview
are for AS 3.0 and FP9.  In later scripts, I tried moving the textfield,
changing the color, changing the stage color to be sure it wasn't
matching the textfield and this invisible, etc...(but it should show as
black Times New Roman text by default anyway...)

Thanks,

Oh, and as a side note, I use FlashDevelop 2.0.1 and have my syntax set
to AS3, but have notices code hinting doesn't always work or is
sometimes incomplete - has anyone else noticed that?  Maybe I just need
to update it.

Jason Merrill
Bank of America
GTO Learning  Leadership Development
eTools  Multimedia Team



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

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


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

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


Re: [Flashcoders] Actionscript 3.0 help w/ simple HelloWorld

2007-03-22 Thread elibol

I see,

You need to add HelloWorld to the main DisplayList.


import MyPackage.*
var hw:HelloWorld = new HelloWorld();

addChild(hw);

On 3/22/07, elibol [EMAIL PROTECTED] wrote:


Hi Jason,

Try setting the width and the height of the Textfield.

http://www.pierinc.com

On 3/22/07, Merrill, Jason [EMAIL PROTECTED] wrote:

 Getting my feet wet with AS3, I just bought the AS3 cookbook and have
 learned a lot already - great book.  I feel like an idiot asking this as
 I'm pretty good in AS2, but with AS3, I'm not getting a simple script
 working. I have the Flash 9 AS3 preview, trying to write a simple
 HelloWorld class (based on an example in the book) to show a TextField:

 //MyPackage.as
 package MyPackage
 {
 //do I actually need this one?:
 import flash.display.DisplayObjectContainer;

 import flash.display.Sprite;
 import flash.text.TextField;

 public class HelloWorld extends Sprite
 {
 public function HelloWorld()
 {
 var message_txt:TextField = new TextField();
 message_txt.text = Hello World;
 addChild(message_txt);  //does not show!
 trace(constructor runs)//traces fine
 }
 }
 }

 Then in the .fla, I put:

 import MyPackage.*
 var hw:HelloWorld = new HelloWorld();

 The constructor traces fine in the output window, but the TextField does
 not show.  What have I done wrong?  My Export settings in F9 As3 preview
 are for AS 3.0 and FP9.  In later scripts, I tried moving the textfield,

 changing the color, changing the stage color to be sure it wasn't
 matching the textfield and this invisible, etc...(but it should show as
 black Times New Roman text by default anyway...)

 Thanks,

 Oh, and as a side note, I use FlashDevelop 2.0.1 and have my syntax set
 to AS3, but have notices code hinting doesn't always work or is
 sometimes incomplete - has anyone else noticed that?  Maybe I just need
 to update it.

 Jason Merrill
 Bank of America
 GTO Learning  Leadership Development
 eTools  Multimedia Team



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

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




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

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


Re: [Flashcoders] Actionscript 3.0 help w/ simple HelloWorld

2007-03-22 Thread elibol

I should mention why I thought it was a width/height issue.

UITextField and extending components (and some other components) in the Flex
framework initialize to a width/height of 0... It really took me by surprise

.


On 3/22/07, elibol [EMAIL PROTECTED] wrote:


I see,

You need to add HelloWorld to the main DisplayList.


import MyPackage.*
var hw:HelloWorld = new HelloWorld();

addChild(hw);

On 3/22/07, elibol [EMAIL PROTECTED] wrote:

 Hi Jason,

 Try setting the width and the height of the Textfield.

  http://www.pierinc.com

 On 3/22/07, Merrill, Jason [EMAIL PROTECTED] wrote:
 
  Getting my feet wet with AS3, I just bought the AS3 cookbook and have
  learned a lot already - great book.  I feel like an idiot asking this
  as
  I'm pretty good in AS2, but with AS3, I'm not getting a simple script
  working. I have the Flash 9 AS3 preview, trying to write a simple
  HelloWorld class (based on an example in the book) to show a
  TextField:
 
  //MyPackage.as
  package MyPackage
  {
  //do I actually need this one?:
  import flash.display.DisplayObjectContainer;
 
  import flash.display.Sprite;
  import flash.text.TextField;
 
  public class HelloWorld extends Sprite
  {
  public function HelloWorld()
  {
  var message_txt:TextField = new TextField();
  message_txt.text = Hello World;
  addChild(message_txt);  //does not show!
  trace(constructor runs)//traces fine
  }
  }
  }
 
  Then in the .fla, I put:
 
  import MyPackage.*
  var hw:HelloWorld = new HelloWorld();
 
  The constructor traces fine in the output window, but the TextField
  does
  not show.  What have I done wrong?  My Export settings in F9 As3
  preview
  are for AS 3.0 and FP9.  In later scripts, I tried moving the
  textfield,
  changing the color, changing the stage color to be sure it wasn't
  matching the textfield and this invisible, etc...(but it should show
  as
  black Times New Roman text by default anyway...)
 
  Thanks,
 
  Oh, and as a side note, I use FlashDevelop 2.0.1 and have my syntax
  set
  to AS3, but have notices code hinting doesn't always work or is
  sometimes incomplete - has anyone else noticed that?  Maybe I just
  need
  to update it.
 
  Jason Merrill
  Bank of America
  GTO Learning  Leadership Development
  eTools  Multimedia Team
 
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 




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

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


Re: [Flashcoders] Annoying, (should be simple) bitwise problem

2007-03-22 Thread elibol

Give this a shot

function getRGB(c:Number):Array {
   return [c16, c8~0xFF00, c~0xF00];
}

On 3/21/07, Alias™ [EMAIL PROTECTED] wrote:


Hi guys,

This is annoying me - I'm just trying to get the seperate RGB
component values out of a hex number, then manipulate and reconstruct
them.

var col = 0xFF;

r = col  16;
g = col  8 % 255;
b = col % 255;
trace(r=+r.toString(16));
trace(g=+g.toString(16));
trace(b=+b.toString(16));

col2 = r 16 + g  8 + b;
trace(col2=+col2.toString(16));

Anyone got any idea why this isn't working right? My blue values are
doing all sorts of wierd stuff - getting smaller, flipping out etc -
is it a modulo problem maybe? Should be simple but this always gets
me...

Any help much appreciated,
Alias
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Anyway way to capture a SWF as a bitmap?

2007-03-21 Thread elibol

Hey Douglas,

To answer  your question, the technique is to create a BitmapData object
initialized to the width/height of  your movieclip, you then call draw()
passing the movieclip you want to convert.

This is something I've done in Flex. It's much easier in AS3 as there are
jpeg/png encoders out there that encode BitmapData objects into byte arrays.
The encoding phase is a little resource intensive, but once it's done, you
have a compressed object you can send and write straight to the HD without
any encoding on the server side.

www.pierinc.com

On 3/21/07, Douglas Pearson [EMAIL PROTECTED] wrote:


Anyone know if there's a way to draw the contents of a SWF to a
Bitmap/BitmapData object within Flash?

I have a SWF that involves lots of complex rendering steps and I want to
be
export it as a bitmap.  The export part should be fine (using a server to
actually save the file) if I can figure out how to get it into a
BitmapData
object so I can call getPixels() on it.

Anyone have any ideas?

Doug

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

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


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

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


Re: [Flashcoders] AS3 parseFloat issue?

2007-03-09 Thread elibol

Thank you Jim.

To clarify the problem we are discussing, when a string is parsed into a
number, and the string is representing a very large number, the number does
not yield the expected results when used in an operation. This is
demonstrated in the first modulo experiment. This issue does not exist in
AVM1 or JVM.

From previous data packing experiments, I've found that the last nibble
(4 bits) of a 64-bit Number isn't reliable when you're casting to and
from Numbers (e.g . reading 8 bytes out of a ByteArray into a Number or
doing round-trips via the toString and parseFloat methods).  I'm not
sure why this is the case--perhaps someone from Adobe can reply and
speak to this particular issue.

This seems relevant, as 6.3e+51 would require an allocation of 3 64 bit
Numbers (approx. 173) to be represented, using at least 2 sets of those 4
unreliable bits you've mentioned. Is this correct?

Is there a solution/technique for correctly representing such parsed
Numbers? The subject Number will be concerned with properly representing its
value in order to be used in any operation supported by as3.

Is it impossible to write a parseFloat function that would correctly parse
Numbers under the new Number specification?

Thank you Fumio and Jim.

Note: I posted this 2 days ago and I didn't notice that I got an
Undeliverable error. I've been getting these a lot. Not sure what the deal
is...

On 3/7/07, elibol [EMAIL PROTECTED] wrote:


To clarify the problem we are discussing, when a string is parsed into a
number, and the string is representing a very large number, the number does
not yield the expected results when used in an operation. This is
demonstrated in the first modulo experiment. This issue does not exist in
AVM1 or JVM.

On 3/7/07, elibol [EMAIL PROTECTED] wrote:

 Thank you Jim.

 From previous data packing experiments, I've found that the last nibble
 (4 bits) of a 64-bit Number isn't reliable when you're casting to and
 from Numbers (e.g . reading 8 bytes out of a ByteArray into a Number or
 doing round-trips via the toString and parseFloat methods).  I'm not
 sure why this is the case--perhaps someone from Adobe can reply and
 speak to this particular issue.

 This seems relevant, as 6.3e+51 would require an allocation of 3 64 bit
 Numbers (approx. 173) to be represented, using at least 2 sets of those 4
 unreliable bits you've mentioned. Is this correct?

 Is there a solution/technique for correctly representing such parsed
 Numbers? The subject Number will be concerned with properly representing its
 value in order to be used in any operation supported by as3.

 Is it impossible to write a parseFloat function that would correctly
 parse Numbers under this specification?

 Thank you Fumio and Jim.

 On 3/6/07, Jim Cheng [EMAIL PROTECTED] wrote:
 
  Fumio Nonaka wrote:
   2 floating point numbers are NOT close enough.  That IS the
  problem.
  
   var _str:String = 1.2e+51;
   var n:Number = parseFloat(_str);
   trace(( n-1.2e+51 )  1000);  //
  true
 
  In ActionScript 3, the native Number data type is internally
  represented
  as a IEEE-754 double-precision floating-point number.  Due to the way
  that the IEEE-754 standard defines how the bits are used to represent
  the number, the accuracy of the mantissa precision (always 52 bits, or
  16 decimal digits) changes depending on the exponent (always 11 bits).
 
  See:   http://en.wikipedia.org/wiki/IEEE_754
 
  This is to say, the close enough value that you need to compare the
  absolute difference between the two Numbers scales in magnitude with
  the
  exponent.  This can be particularly bad if you need arbitrary
  precision,
  (e.g. when doing financial or scientific calcuations), as while
  1.32e+36
  is paltry compared to 1.2e+51, no one would want to be swindled out of
  1.32e+36 dollars due to faulty floating point comparisons, hence the
  need for arbitrary precision integer libraries for such applications
  as
  was recently mentioned on this list.
 
  Fortunately however, if you don't need this kind of exact precision,
  but
  simply need to match large values originally parsed from strings to
  Numbers as per your example, there is a much better and easier way to
  compare very large Numbers in ActionScript 3--by inspecting them at
  the
  bit level following the IEEE-754 specification.
 
  From previous data packing experiments, I've found that the last
  nibble
  (4 bits) of a 64-bit Number isn't reliable when you're casting to and
  from Numbers (e.g. reading 8 bytes out of a ByteArray into a Number or
  doing round-trips via the toString and parseFloat methods).  I'm not
  sure why this is the case--perhaps someone from Adobe can reply and
  speak to this particular issue.
 
  That being said, all you really need to do for a nearly-equals Number
  comparison is a byte-by-byte comparison save for the last byte, in
  which
  case you only compare the four most significant bits.  If all bits
  aside

Re: [Flashcoders] Extending buttons interface

2007-03-09 Thread elibol

instanceof matches an objects primitive type in as1 and as2.

I believe you can do this by adding a method to the Button.prototype object.

Button.prototype.somefunc = function(){
trace(hi);
}

and from a button instance, you make invoke

buttonInstance.somefunc(); //hi


On 3/9/07, strk [EMAIL PROTECTED] wrote:


Is there a way to attach a method to all existing button instances ?
It seems that button instances are NOT instaceof Button ...
At least NOT for SWF6 .

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

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


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

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


Re: [Flashcoders] How to set the hand cursor on the datagrid

2007-03-09 Thread elibol

useHandCursor determines whether the hand cursor is used when a movieclip is
fitted with interactive handlers (onPress/onRelease).

On 3/9/07, Merrill, Jason [EMAIL PROTECTED] wrote:


How do I set the hand cursor when mousing over records in a
datagrid (AS2 V2)?

I've tried setting useHandCursor = true, but that didn't work.

How do I do it?

You might try a CellRenderer for each item, and put code in your
CellRenderer class (or movieClip) to modify the cursor.

Jason Merrill
Bank of America
Global Technology  Operations
Learning  Leadership Development
eTools  Multimedia Team



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

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


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

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


Re: [Flashcoders] Creative Suite 3 To Be Announced 3/27

2007-03-09 Thread elibol

I heard that CS3 may include Flash...

On 3/9/07, Ian Thomas [EMAIL PROTECTED] wrote:


On 3/9/07, Ian Thomas [EMAIL PROTECTED] wrote:

 Might be this (from the Photoshop CS3 Extended blurb linked off the home
page):
 New to the Photoshop family, Adobe Photoshop CS3 Extended delivers
 everything in Photoshop CS3 and more. Render and incorporate 3D images
 into your 2D composites. Stop time with easy editing of motion
 graphics on video layers. And probe your images with measurement,
 analysis, and visualization tools.

And thinking about it, if they let you edit motion graphics,
presumably that's gotta output to something useful. SWF/FLV at the
least, I'd guess. :-)

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

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


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

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


Re: [Flashcoders] AS3 parseFloat issue?

2007-03-09 Thread elibol

I stated the origin of the number and what I want to do with it. The number
is derived from a string using parseFloat, and it simply needs to serve its
purpose as an operand in an expression.

The relevant point of this discussion is that a hard coded assignment of
6.3e+51 to a Number yields different results than 6.3e+51 parsed from a
string using the top level parseFloat() function in as3.

It's a matter of consistency, not precision.

What I specifically mean: How the number is derived should not affect what
it does. The number should simply represent the value it's suppose to.

Another experiment to elaborate on this point:

var test1_str:String = 6.3e+51;
var n1:Number = parseFloat(test1_str);
var n2Split:Array = test1_str.split(e+);
var n2:Number = parseFloat(n2Split[0])*Math.pow(10, parseInt(n2Split[1]));

trace(n1);//6.30e+51
trace(n2);//6.3e+51
trace(6.30e+51 == 6.3e+51);//true
trace(n1 == n2);//false
trace(n1 == 6.3e+51);//false
trace(n2 == 6.3e+51);//true
trace(n1-6.3e+51);//1.32922799578491e+36
trace(n2-6.3e+51);//0

On 3/9/07, Ron Wheeler [EMAIL PROTECTED] wrote:


If you really have a number with 52 decimal digits of precision
required, you can not store it in a double.
I believe that a double is only good for about 16-17 digits.

What is the origin of such a number and what do you want to do with it?

You will have to write all of your own arithmetic or find a package
designed to work with large numbers with high precision.

There are probably ways to deal with this but ordinary float or double
will not do it even in JVM. You may get one test to work but there is no
assurance that with a different sequence of operations with different
numbers you will not get a different result since the hardware is
throwing away the extra precision.

Ron

elibol wrote:
 Thank you Jim.

 To clarify the problem we are discussing, when a string is parsed into a
 number, and the string is representing a very large number, the number
 does
 not yield the expected results when used in an operation. This is
 demonstrated in the first modulo experiment. This issue does not exist
in
 AVM1 or JVM.

 From previous data packing experiments, I've found that the last nibble
 (4 bits) of a 64-bit Number isn't reliable when you're casting to and
 from Numbers (e.g . reading 8 bytes out of a ByteArray into a Number or
 doing round-trips via the toString and parseFloat methods).  I'm not
 sure why this is the case--perhaps someone from Adobe can reply and
 speak to this particular issue.

 This seems relevant, as 6.3e+51 would require an allocation of 3 64 bit
 Numbers (approx. 173) to be represented, using at least 2 sets of those
4
 unreliable bits you've mentioned. Is this correct?

 Is there a solution/technique for correctly representing such parsed
 Numbers? The subject Number will be concerned with properly
 representing its
 value in order to be used in any operation supported by as3.

 Is it impossible to write a parseFloat function that would correctly
 parse
 Numbers under the new Number specification?

 Thank you Fumio and Jim.

 Note: I posted this 2 days ago and I didn't notice that I got an
 Undeliverable error. I've been getting these a lot. Not sure what the
 deal
 is...

 On 3/7/07, elibol [EMAIL PROTECTED] wrote:

 To clarify the problem we are discussing, when a string is parsed into
a
 number, and the string is representing a very large number, the
 number does
 not yield the expected results when used in an operation. This is
 demonstrated in the first modulo experiment. This issue does not
 exist in
 AVM1 or JVM.

 On 3/7/07, elibol [EMAIL PROTECTED] wrote:
 
  Thank you Jim.
 
  From previous data packing experiments, I've found that the last
 nibble
  (4 bits) of a 64-bit Number isn't reliable when you're casting to and
  from Numbers (e.g . reading 8 bytes out of a ByteArray into a
 Number or
  doing round-trips via the toString and parseFloat methods).  I'm not
  sure why this is the case--perhaps someone from Adobe can reply and
  speak to this particular issue.
 
  This seems relevant, as 6.3e+51 would require an allocation of 3 64
 bit
  Numbers (approx. 173) to be represented, using at least 2 sets of
 those 4
  unreliable bits you've mentioned. Is this correct?
 
  Is there a solution/technique for correctly representing such parsed
  Numbers? The subject Number will be concerned with properly
 representing its
  value in order to be used in any operation supported by as3.
 
  Is it impossible to write a parseFloat function that would correctly
  parse Numbers under this specification?
 
  Thank you Fumio and Jim.
 
  On 3/6/07, Jim Cheng [EMAIL PROTECTED] wrote:
  
   Fumio Nonaka wrote:
2 floating point numbers are NOT close enough.  That IS the
   problem.
   
var _str:String = 1.2e+51;
var n:Number = parseFloat(_str);
trace(( n-1.2e+51 )  1000);  //
   true
  
   In ActionScript 3, the native Number data type

Re: [Flashcoders] AS3 parseFloat issue?

2007-03-09 Thread elibol

Hmm, I understand how the first operand does not represent the parsed string
in:

trace(6.30e+51 == 6.3e+51);

And how what trace prints is just the string representation of the number...

I guess the point of the final experiment is that the solution is to parse
the float without the exponent, because the string will always be human
input, so the number would always be whatever float to the +- exponent.

Here is the Java double:

http://people.uncw.edu/tompkinsj/133/Numbers/Reals.htm

Shouldn't this make the as3 Number equal to the Java Double? Both are
represented using the IEEE 754 standard.

In Java, doubles are parsed and represented exactly up to 1.0e+308. This
goes up to the largest value the language can handle.

In as3, Numbers lose precision at about 1.0e+32.

Would it make sense to build a parseDouble function for as3? Could that be
the problem?

Do I have to do some more reading? I think so.

kk,

thank you Ron and Andy.

On 3/9/07, Andy Herrman [EMAIL PROTECTED] wrote:


Oh, and this:

parseFloat(n2Split[0])

also adds errors.  The number (6.3) probably can't be accurately
represented in float/double format, so it's not quite 6.3 (it might be
6.3005123412, for example).  So, when you then multiply it
by the power of 10 it won't be the same as when it was simply parsed
from the full string.

   -Andy

On 3/9/07, Andy Herrman [EMAIL PROTECTED] wrote:
 I think the problem here is that this:

 var n2:Number = parseFloat(n2Split[0])*Math.pow(10,
parseInt(n2Split[1]));

 is not the same as doing the math.  When you define it as a string the
 code will convert the number directly, trying to get as close as it
 can to the value.

 However, in the code you have there you're not doing the same thing as
 the string.  Math.pow is going to be using floats/doubles in order to
 calculate the power.  The instant that happens you lose accuracy, so
 before you even do the multiplication you've lost accuracy, so the
 resulting number won't be the same.  So in fact, you aren't deriving
 the same value.  This is the problem with floats.

 Also, you try to do this to show that they should be the same:
 trace(n1);//6.30e+51
 trace(n2);//6.3e+51
 trace(6.30e+51 == 6.3e+51);//true

 However, n1 != 6.30e+51.

 6.30e+51 is simply the approximation that Flash uses when
 converting it back to a string.  It maxes out at a certain number of
 digits after the decimal point, so the string representation isn't
 accurate.  As your math later shows, there would be more digits way
 back at the 36th position (where the first digit is the 51st
 position).

 I hope that helps to explain it a bit.

-Andy

 On 3/9/07, elibol [EMAIL PROTECTED] wrote:
  I stated the origin of the number and what I want to do with it. The
number
  is derived from a string using parseFloat, and it simply needs to
serve its
  purpose as an operand in an expression.
 
  The relevant point of this discussion is that a hard coded assignment
of
  6.3e+51 to a Number yields different results than 6.3e+51 parsed from
a
  string using the top level parseFloat() function in as3.
 
  It's a matter of consistency, not precision.
 
  What I specifically mean: How the number is derived should not affect
what
  it does. The number should simply represent the value it's suppose to.
 
  Another experiment to elaborate on this point:
 
  var test1_str:String = 6.3e+51;
  var n1:Number = parseFloat(test1_str);
  var n2Split:Array = test1_str.split(e+);
  var n2:Number = parseFloat(n2Split[0])*Math.pow(10,
parseInt(n2Split[1]));
 
  trace(n1);//6.30e+51
  trace(n2);//6.3e+51
  trace(6.30e+51 == 6.3e+51);//true
  trace(n1 == n2);//false
  trace(n1 == 6.3e+51);//false
  trace(n2 == 6.3e+51);//true
  trace(n1-6.3e+51);//1.32922799578491e+36
  trace(n2-6.3e+51);//0
 
  On 3/9/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  
   If you really have a number with 52 decimal digits of precision
   required, you can not store it in a double.
   I believe that a double is only good for about 16-17 digits.
  
   What is the origin of such a number and what do you want to do with
it?
  
   You will have to write all of your own arithmetic or find a package
   designed to work with large numbers with high precision.
  
   There are probably ways to deal with this but ordinary float or
double
   will not do it even in JVM. You may get one test to work but there
is no
   assurance that with a different sequence of operations with
different
   numbers you will not get a different result since the hardware is
   throwing away the extra precision.
  
   Ron
  
   elibol wrote:
Thank you Jim.
   
To clarify the problem we are discussing, when a string is parsed
into a
number, and the string is representing a very large number, the
number
does
not yield the expected results when used in an operation. This is
demonstrated in the first modulo experiment. This issue does

Re: [Flashcoders] Currency Formatter

2007-03-08 Thread elibol

Hey Martin,

A quick google search yields solutions like this:

http://www.shinstudio.com/sh.kim/?cat=6
http://www.epresenterplus.com/i18n.shtml

Try a search for as2 currency formatter

Melih

On 3/8/07, Martin Klasson [EMAIL PROTECTED] wrote:



Hi Flashcoders,

Is there anything out there already perhaps, that simply does convert a
price (a Number), into a currency-formatted string?

prettyNumber(1.25, $...)

well yeah, you know what I am after.. I want it to be able to work in
many markets,
so there is a need to be able to control whether the currency-symbol
should be before the price or after,
eventual spacing, decimals/commas and such.

Is there any actionscript-function out there that already deals with
this in a flexible way?

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

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


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

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


Re: [Flashcoders] AS3 parseFloat issue?

2007-03-06 Thread elibol

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

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

//AS3
6.30e+51
false
true
1.32922799578491e+36

It may certainly be by design, but aren't these unexpected results? as2 and
java do not behave this way. The parseFloat function is flawed.

I will post a comment on livedocs, and I've submitted the issue as a bug at
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

I am not going over board am I? I just need my program to work correctly.

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


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

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

Decrease one digit:

var test1_str:String = 6.3e+51;
var n1:Number = parseFloat(test1_str);
trace(n1 == (6.3e+51));
trace(n1-(6.3e+51));
// ActionScript 3.0
true
0
_
elibol wrote:
 Those who are interested in helping me verify the problem can run this
test
 in actionscript 2.0 and again in actionscript 3.0.

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

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

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

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


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

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


[Flashcoders] AS3 parseFloat issue?

2007-03-05 Thread elibol

Hi guys,

I've been writing some code that evaluates operations from strings, and when
doing some stress testing, I think I may have discovered a problem.

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

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

Here is the test I ran in Java, just to confirm:

String a = 6.30e+51;
String b = 23;
double c = Double.parseDouble (a)%Double.parseDouble(b);
System.out.println(c); //18
System.out.println(6.30e+51%23); //18

Clearly, the answer to this problem is 18, but as3 calculates 7 after
parsing the large number.

I feel reluctant to draw any wild conclusions, I mean, I have no idea what
the problem could be. Anyone have any clue? Is this an issue or am I missing
something?

Good day,

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

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


Re: [Flashcoders] Writing out PDFs through code

2007-03-01 Thread elibol

Check out Zinc

http://www.multidmedia.com/

and Apollo

http://labs.adobe.com/wiki/index.php/Apollo

On 3/1/07, Mendelsohn, Michael [EMAIL PROTECTED] wrote:


Hi all...

Can PDF files somehow be written to a hard drive on the fly from a Flash
exe?  (Multiple pages, custom graphics, etc.)

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

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


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

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


[Flashcoders] Form validation, stuck with old code for this old subject

2006-08-10 Thread elibol

Hi guys,

I searched the archives for some code but it's all outdated, like people
appending functions for String.prototype and such.

I was wondering if there is any code as2 that validates form fields?

Thank you,

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

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


Re: [Flashcoders] Help: Confusion and Blue with Components

2006-07-14 Thread elibol

When you call gotoAndStop(), the player needs to first enter the frame where
mcParent is, this is why it works when you use onEnterFrame.

My technique for this has been to add a function call on the frame that the
clip resides in. I may call a function like Parent.init() on frame label
'TestFrame', or just init() and delegate the init function to a more
appropriate location:

import mx.utils.Delegate;

TestMC.init = Delegate.create(this, initTestMC);

function initTestMC(){
//this will be called when init() is called from within the movieclip
}

I hope this helps,

M

On 7/12/06, Tan [EMAIL PROTECTED] wrote:


Dear list,

I have been trying to solve this problem for a good while, but I wonder if
anyone has a good way to get around it. Here is the problem (you can
download the related Flash at: http://www.acts.net/Flash/ComponentBlue.zip

I have created a component called Parent, inside Parent timeline I have my
designer to layout components Child1 and Child2, so I only have to do the
wiring.

So now I have put Parent in the movie timeline at a frame labeled
TestFrame,
so we have a structure liked followed,

TestFrame
+ Parent
  - Child1
  - Child2


For the ease of description, I have classes with the same name as Parent,
Child1 and Child2. In the timeline, the Parent instance is named as
mcParent.


So somewhere in a function I will write like:

function myFunction():Void
{
  gotoAndStop(TestFrame);

  trace( this[mcParent] ); // it returns _level0.mcParent
  trace( Parent( this[mcParent] ); // the movieclip is there, but it
returns null }


Somehow I cannot get Parent as the Parent class. If I revise logic like:

function myFunction():Void
{
  gotoAndStop(TestFrame);

  trace( this[mcParent] ); // it returns _level0.mcParent
  trace( Parent( this[mcParent] ); // the movieclip is there, but it
returns null

  this.onEnterFrame = laterFunction;
}

function laterFunction():Void
{
  this.onEnterFrame = null;
  trace( this[mcParent] ); // it returns _level0.mcParent
  trace( Parent( this[mcParent] ); // now it returns _level0.mcParent
correctly }



The similar problem exists in Child1 and Child2 inside Parent timeline. It
seems to me that the MovieClip is not converted to its associated class
until later time, so I have to split my logic into two different
functions,
whic makes the code look cumbersome and hard to manage.

A more detailed example of the problem above can be downloaded at,
http://www.acts.net/Flash/ComponentBlue.zip

Although putting components on the stage using attachMovie might solve the
problem, but I would like the designer to have the freedom to arrange the
components on the stage the way he likes, and attachMovie would take away
this freedom. I wonder if anyone has a cleaner way around this problem.

TIA!

- Tangent

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

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


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

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


Re: [Flashcoders] private constructors in AS3.0?

2006-07-09 Thread elibol

That is nice, I like how you can assign functions to compile time variables.

On 7/9/06, Cédric Néhémie [EMAIL PROTECTED] wrote:


Hi,

I've trying to create singleton, and the best way i've fund is to create
the instance direcly in the class declaration

private static var _oInstance:MyClass = getInstance();

And to check if constructor is called in code I do that :

public function MyClass ()
{
if (_oInstance == null)
throw new IllegalOperationError (MyClass is a singleton, and an
instance allready exist. Use getInstance to get a reference to the
instance);
}

In that way an instance is automatically created and every call of the
constructor will throw an error. If you don't want to have an instance
at start, but only when getInstance is called it's a bit less proper :

private static var _bInstanciable:Boolean = false;
private static var _oInstance:MyClass;

public function MyClass ()
{
if(!_bInstanciable)
   throw new IllegalOperationError (MyClass is a singleton, and an
instance allready exist. Use getInstance to get a reference to the
instance);
}
public static function getInstance ():MyClass
{
if(_oInstance == null)
{
_bInstanciable = true;
_oInstance = new MyClass();
_bInstanciable = false;
}
return _oInstance;
}
 Hi,

 This might be old stuff but I missed it completely ... I was wondering
if
 somebody can tell me the rationale about that constructors in AS3.0 must
be
 public and what happens to Singletons in AS3.0?

 Thanks,
 Sascha



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

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




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

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


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

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


Re: [Flashcoders] About OOP metodology

2006-06-30 Thread elibol

Try a compositional approach. You might design a set of classes that
reference movieclips and delegate events to the class; this would be
contrary to extending movieclips. This way you can design movieclips
specific to the site and design the code specific to the logic.

You could even abstract the technical logic from the UI completely and write
communicators/controllers that respond to events fired from the ui
(movieclips).

M.

On 6/30/06, Ricardo Sánchez [EMAIL PROTECTED] wrote:


I've just started to work in a big internet communication agency. We have
to
make 2 or 3 microsites every week. Each of which uses a very similar form
to
get user data.

All that changes from one to another is a couple of fields and the look of
it.

My question is: What's the best way to implement a re-usable class for
this
kind of work? Should I make a movieclip with all the fields and a class
binded to it and modify the clip everytime I re-use it? Or should I make a
class that loads different clips from the library?

Do I explain myself?

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

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


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

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


Re: [Flashcoders] Biased Random Particle Distribution

2006-06-30 Thread elibol

I wish there were more discussions like this...

I experimented a bit with this with some curving equations, this is what I
have to contribute:

import flash.geom.Point;
var particleAmount = 100;
var particles = [];

var radiusMin = 3;
var radiusMax = 100;

function createParticles(){
   var i = -1, l = particleAmount, a = 0, rDiff = radiusMax - radiusMin;
   while(++il){

   a = Math.pow(2, 10 * (i/l-1));
   //a = Math.sin((Math.PI/2)*i/l);
   trace(a);

   var radius = a*rDiff;

   //var theta = Math.random()*Math.PI*2;
   var theta = (i/l)*(Math.PI*2);
   //var theta = 0;

   particles.push(Point.polar(radius, theta));
   }
}

function drawParticles(){
   var i = -1, l = particles.length;
   _root.createEmptyMovieClip('emc', 1);
   _root.emc._x = Stage.width/2;
   _root.emc._y = Stage.height/2;
   _root.emc.lineStyle(1, 0x00, 100);
   //trace(particles);
   trace(particles.length);
   while(++il){
   var a = particles[i].x*3, b = particles[i].y*3, c = a, d = b + 1;
   _root.emc.moveTo(a,b);
   _root.emc.lineTo(c,d);
   }
}

createParticles();
drawParticles();

Variable a is a set of different equations that will create curves, the
equation that uses pow uses an exponential curve. The Math.sin one uses a
simple sin curve. The theta can be swaped around too to check out the effect
the equations give.

I noticed you mentioned creating a bias on the right side of a rectangle
too, I think you can do this by using a range for the x property of a point
instead of the radius.

M.

On 5/26/06, clark slater [EMAIL PROTECTED] wrote:


I need to randomly distribute a series of particles in a 2D space with a
bias towards the zero point for both dimensions. I know how to create a
biased distribution towards the center (thanks Keith peters) by averaging
a
series of throws - but I am stuck on the zero bias distribution.

Any ideas? I guess I need something like an exponential decay curve?

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

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


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

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


Re: [Flashcoders] Text link on hover

2006-06-12 Thread elibol

Hey Greg,

Yes I think it can be done with flash 7 compatibility as it's Marios
getLineMetrics solution which uses bitmapData, not the getWordRect function.
I will write the getLineMetrics function without bitmapData too.

I would definitely appreciate your help, I will get in touch with you when
I'm done with the project this is for.

M.

On 6/11/06, GregoryN [EMAIL PROTECTED] wrote:


Hello elibol,

Will your function (class?) be For Flash 8 only (as bitmapData was
mentioned)?
I think this all can be done flash 7 compatible.

Well, I'm very interested.
If you'll need some help with testing and/or making a component for
non-programmers, don't hesitate to email me.

--
Best regards,
GregoryN

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

 --- elibol wrote:
 It accually doesn't use any extra textfields, it stores the htmlText
value
 of a textfield and gets the coordinates, it then resets the tf to the
 original value. I am thinking of making this a subroutine; assigning a
 textfield some value dynamically would be done through a special
function
 that gathers spacial data before assigning the value.

 Right now the the total operation is written in 300 lines of algorithmic
 code. I am frequently coming up with optimizations, so this number is
 droping... I will make it open source when it's finished because I
 finddevelopers and designers are often upset about not being able to
measure
 rendered textfields.

 I figure this can be used for more than just text hover states. This
will
 get you a rectangle of text, and it will also get you line metrics so I
am
 thinking it will allow for some creative possibilities with typographic
 animation. It could be that a function defines the rectangle of all
letters
 in a sequence for use with just words or short sentences. I suggest
words
 and short sentences as any large body of text would cost too much in
system
 resource with too many rectangles =]

 The dude at quasimondo.com tried mimicking the getLineMetrics function
from
 Flex using bitmapData and getColorRect to measure the width of lines. It
 fails with custom anti aliasing, maybe even anti aliasing for animation.
For
 some reason converting anti aliased text to bitmap data results in a
blank
 bitmapData object...

 I wanted to run with his code but I found that it became far too
elaborate
 as I was having to put the textfield in movieclips to get it to convert
to
 bitmap data. This solution would fail too when image tags are used.

 It's a great theoretical solution but not a good practical solution.

 On 6/10/06, GregoryN [EMAIL PROTECTED] wrote:

 Hello elibol,

  Were your textfields multiline?
 No, they were just a row of links.

 What you're trying to do is really interesting :-).

 As I can guess, to work with non-monospace fonts, your getWordRect
 function should be quite smart...

 Also, the only way I can imagine so far (in about 15 min) must
 probably use a lot of duplicate textfields to get all these
 dimensions.

 What do you think, how often the need for hover event in html text
 arises?


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


  --- elibol wrote:
  Hi Greg,
 
  Yea, really is funny... Were your textfields multiline?
 
  I've tried the img tag solution, the problem is that it does not
snuggle
  between text, the tag must be either left or right justified so it's
 never
  where it should be.
 
  So far I've built a function that gets the x/y ( relative to
textfield )
 and
  w/h of a string from a textfield.
 
  getWordRect(textField, searchString)
 
  This returns a rectangle object that describes the word rectangle. I
am
  planning to use this with a mouse hotspot class I've written a while
 ago.
  This will allow me to pass the rectangle objects and create a hover
 entity
  that will broadcast the entity {id,x,y,w,h} to the hover event
handler.
 
  It's pretty fricken elaborate. I think this functionality will be
useful
 as
  Flex does not even support these kinds of functions so I will post
this
  stuff on my site soon.
 
  I plan to implement a getLineMetrics style function as the base code
 that
  the getWordRect is driven with will allow me to do this relatively
 easily.
 
  I plan to build a sub function of getWordRect that will get all word
  rectangles of a searchString.
 
  Word to the Adobe developers, I think this is functionality the
 TextField
  class in Flex should implement.
 
  I also think htmlText for TextField Objects should have a realtime
DOM.
 
  M.
 
  On 6/9/06, GregoryN [EMAIL PROTECTED] wrote:
 
  well,
 
  The only solution I can suggest (and I've used it several times) is
to
  make each of your links embedded into separate mc.
 
  But I was making just quite short html texts dynamically at runtime.
 
  Depending on situation you may have to embed an SWF within IMG tag
and
  use some kind of flashvars

Re: [Flashcoders] Help loading xml in html embed tag

2006-06-12 Thread elibol

Hey man,

Another way to do this is to add a query string to the swf you're embedding.

In HTML you do:

object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354 codebase=
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0;
width=300 height=46 id=NoxPlayer align=middle
param name=allowScriptAccess value=sameDomain /
param name=movie value=NoxPlayer.swf?xmlURL=playlist.xml /
param name=quality value=high /
param name=wmode value=transparent /
param name=devicefont value=true /
param name=bgcolor value=#00 /
embed src=NoxPlayer.swf?xmlURL=playlist.xml quality=high
wmode=transparent devicefont=true bgcolor=#00 width=300
height=46 name=NoxPlayer align=middle allowScriptAccess=sameDomain
type=application/x-shockwave-flash pluginspage=
http://www.macromedia.com/go/getflashplayer; /
/object

In AS you do:

  private var playlistURL:String = _root.xmlURL;
  private var playlistObj:jwPlaylist;
  private var playlistArray:Array;

The main idea is that when you pass variables in from an embed tag, the
variables will be properties of the _root object.

So calling _root then the name of your variable, like _root.xmlURL, will
give you your value.

M.



On 6/12/06, Merrill, Jason [EMAIL PROTECTED] wrote:


On the Flash end, there is no syntax - as I mentioned, you just call
it like any other variable - it should already exist if you have
Flashvars right in the HTML.  It's suppose to be inserted even before
frame 1 initializes.

Really, just in Flash:

trace(myVariable)

Jason Merrill
Bank of America
Learning Technology Solutions







-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Matt Mc
Sent: Monday, June 12, 2006 4:20 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Help loading xml in html embed tag

All the resources I get tell me how to put a flashvar into an embed
tag but not the
syntax for bringing the variable into my Action Script Document.

I have been working on this for almost a week now and I know it is
simple because
everyone keeps telling me so.

If I can't get this I am dead.

here is my embed tag:
object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354
codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/sw
fl
ash.cab#version=7,0,0,0 width=300 height=46 id=NoxPlayer
align=middle
param name=allowScriptAccess value=sameDomain /
param name=movie value=NoxPlayer.swf /
param name=FlashVars value=xmlURL=playlist.xml
param name=quality value=high /
param name=wmode value=transparent /
param name=devicefont value=true /
param name=bgcolor value=#00 /
embed src=NoxPlayer.swf FlashVars=xmlURL=playlist.xml
quality=high
wmode=transparent devicefont=true bgcolor=#00 width=300
height=46 name=NoxPlayer align=middle
allowScriptAccess=sameDomain
type=application/x-shockwave-flash
pluginspage=http://www.macromedia.com/go/getflashplayer; /
/object


here is how they get the xml document now.

private var playlistURL:String = playlist.xml;
private var playlistObj:jwPlaylist;
private var playlistArray:Array;

How do I make this get the playlist.xml link from the embed tag.

I can't seem to get the syntax right or something because I can't get
this to work.

If anyone can give me a detaild response or steer me to a tutorial
that will show
me the syntax to use in the action script document. Not the first
frame of the FLA

Thanks

If you want to look at the files let me know I will post them. It is
an mp3 player
but my boss wants to add the xml with dynamic links




 __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Help loading xml in html embed tag

2006-06-12 Thread elibol

Maybe you're loading the xml file relative to the swf?

If you define the xml files location relative to the swf file and the html
document you're embedding the swf file into is located in different
directory then the xml location will be incorrect.

example:

Lets say that these are the paths:

./player/player.swf
./player/playlist.xml
./index.html

If you pass './playlist.xml' as the path from where index.html is located
(as it would be the correct location relative from player.swf) and run the
index.html you should get null for your playlist.xml.

I'm doubting it's the playlist.xml path that is incorrect since you
mentioned that you've seen it work in the textfield, but maybe the paths to
the mp3s should be tested...

In the end, all paths must be defined relative to the swf.

You can email me the files if it becomes really critical: [EMAIL PROTECTED]

M.

On 6/12/06, Matt Mc [EMAIL PROTECTED] wrote:




elibol [EMAIL PROTECTED]

I really appreciate you guys helping. For some reason it is still not
working. I am going to load a zip file of the project. I just need this
playlist to be dynamic to make my boss happy before I get canned. he knows I
am not an actionscripter but he seems to think this is easy.

Perhaps it has something to do with the way the files are set up. It works
just fine untill I try to load a variable. I know it is their because I
tested it in a text box.

If anyone can help That would be great. I have a feeling I will be up all
night again.

Matthew McLemore

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

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



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

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


Re: [Flashcoders] Text link on hover

2006-06-10 Thread elibol

It accually doesn't use any extra textfields, it stores the htmlText value
of a textfield and gets the coordinates, it then resets the tf to the
original value. I am thinking of making this a subroutine; assigning a
textfield some value dynamically would be done through a special function
that gathers spacial data before assigning the value.

Right now the the total operation is written in 300 lines of algorithmic
code. I am frequently coming up with optimizations, so this number is
droping... I will make it open source when it's finished because I
finddevelopers and designers are often upset about not being able to measure
rendered textfields.

I figure this can be used for more than just text hover states. This will
get you a rectangle of text, and it will also get you line metrics so I am
thinking it will allow for some creative possibilities with typographic
animation. It could be that a function defines the rectangle of all letters
in a sequence for use with just words or short sentences. I suggest words
and short sentences as any large body of text would cost too much in system
resource with too many rectangles =]

The dude at quasimondo.com tried mimicking the getLineMetrics function from
Flex using bitmapData and getColorRect to measure the width of lines. It
fails with custom anti aliasing, maybe even anti aliasing for animation. For
some reason converting anti aliased text to bitmap data results in a blank
bitmapData object...

I wanted to run with his code but I found that it became far too elaborate
as I was having to put the textfield in movieclips to get it to convert to
bitmap data. This solution would fail too when image tags are used.

It's a great theoretical solution but not a good practical solution.

On 6/10/06, GregoryN [EMAIL PROTECTED] wrote:


Hello elibol,

 Were your textfields multiline?
No, they were just a row of links.

What you're trying to do is really interesting :-).

As I can guess, to work with non-monospace fonts, your getWordRect
function should be quite smart...

Also, the only way I can imagine so far (in about 15 min) must
probably use a lot of duplicate textfields to get all these
dimensions.

What do you think, how often the need for hover event in html text
arises?


--
Best regards,
GregoryN

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


 --- elibol wrote:
 Hi Greg,

 Yea, really is funny... Were your textfields multiline?

 I've tried the img tag solution, the problem is that it does not snuggle
 between text, the tag must be either left or right justified so it's
never
 where it should be.

 So far I've built a function that gets the x/y ( relative to textfield )
and
 w/h of a string from a textfield.

 getWordRect(textField, searchString)

 This returns a rectangle object that describes the word rectangle. I am
 planning to use this with a mouse hotspot class I've written a while
ago.
 This will allow me to pass the rectangle objects and create a hover
entity
 that will broadcast the entity {id,x,y,w,h} to the hover event handler.

 It's pretty fricken elaborate. I think this functionality will be useful
as
 Flex does not even support these kinds of functions so I will post this
 stuff on my site soon.

 I plan to implement a getLineMetrics style function as the base code
that
 the getWordRect is driven with will allow me to do this relatively
easily.

 I plan to build a sub function of getWordRect that will get all word
 rectangles of a searchString.

 Word to the Adobe developers, I think this is functionality the
TextField
 class in Flex should implement.

 I also think htmlText for TextField Objects should have a realtime DOM.

 M.

 On 6/9/06, GregoryN [EMAIL PROTECTED] wrote:

 well,

 The only solution I can suggest (and I've used it several times) is to
 make each of your links embedded into separate mc.

 But I was making just quite short html texts dynamically at runtime.

 Depending on situation you may have to embed an SWF within IMG tag and
 use some kind of flashvars to set it's behavior .
 Funny, isn't it?


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



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

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


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

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


Re: [Flashcoders] Text link on hover

2006-06-09 Thread elibol

I wish you were wrong too =[

Thanks though Mick

M.

On 6/8/06, Jim Kremens [EMAIL PROTECTED] wrote:


Wait, I know you can get hovers, but can you catch the hover 'event' and
use
it to, for example, call another function? I think that was his question,
and as far as I know, there is no 'onHover' event.  I'd like to be
wrong...

Jim Kremens


On 6/8/06, Mick G [EMAIL PROTECTED] wrote:

 Yes, you'll need to set up style in Flash...
 A:hover is supported in Flash.

 http://www.actionscript.org/tutorials/beginner/css_in_flash/index.shtml



 On 6/9/06, elibol [EMAIL PROTECTED] wrote:
 
  Does anyone know if it's possible to trigger an event with a text link
  hover
  state?
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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




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

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


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

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


Re: [Flashcoders] Text link on hover

2006-06-09 Thread elibol

Thank you for the reply David, I appreciate it.

On 6/9/06, David Bellerive [EMAIL PROTECTED] wrote:


You wish as been granted :)

You can call another actionscript function from within
a dynamic textfield by setting it's html property to
true and using asfunction within the anchor tag like
this :

tfMyTextField.html = true;
tfMyTextField.htmlText = a
href=\asfunction:fMyFunction,sMyParameter\/a;

where fMyFunction is the name of the function you want
to call when the user clicks the link and sMyParameter
is a parameter to pass to that function. Only one
parameter can be passed to the function.

 I wish you were wrong too =[

 Thanks though Mick

 M.

 On 6/8/06, Jim Kremens [EMAIL PROTECTED] wrote:

 Wait, I know you can get hovers, but can you catch
the hover 'event'
and
 use
 it to, for example, call another function? I think
that was his
question,
 and as far as I know, there is no 'onHover' event.
I'd like to be
 wrong...

 Jim Kremens


 On 6/8/06, Mick G [EMAIL PROTECTED] wrote:
 
  Yes, you'll need to set up style in Flash...
  A:hover is supported in Flash.
 
 
http://www.actionscript.org/tutorials/beginner/css_in_flash/index.shtml
 
 
 
  On 6/9/06, elibol [EMAIL PROTECTED]
wrote:
  
   Does anyone know if it's possible to trigger an
event with a text
link
   hover
   state?
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search
the archive:
  
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
  
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the
archive:
 
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 



 --
 Jim Kremens
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the
archive:

http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Text link on hover

2006-06-09 Thread elibol

Hi Greg,

Yea, really is funny... Were your textfields multiline?

I've tried the img tag solution, the problem is that it does not snuggle
between text, the tag must be either left or right justified so it's never
where it should be.

So far I've built a function that gets the x/y ( relative to textfield ) and
w/h of a string from a textfield.

getWordRect(textField, searchString)

This returns a rectangle object that describes the word rectangle. I am
planning to use this with a mouse hotspot class I've written a while ago.
This will allow me to pass the rectangle objects and create a hover entity
that will broadcast the entity {id,x,y,w,h} to the hover event handler.

It's pretty fricken elaborate. I think this functionality will be useful as
Flex does not even support these kinds of functions so I will post this
stuff on my site soon.

I plan to implement a getLineMetrics style function as the base code that
the getWordRect is driven with will allow me to do this relatively easily.

I plan to build a sub function of getWordRect that will get all word
rectangles of a searchString.

Word to the Adobe developers, I think this is functionality the TextField
class in Flex should implement.

I also think htmlText for TextField Objects should have a realtime DOM.

M.

On 6/9/06, GregoryN [EMAIL PROTECTED] wrote:


well,

The only solution I can suggest (and I've used it several times) is to
make each of your links embedded into separate mc.

But I was making just quite short html texts dynamically at runtime.

Depending on situation you may have to embed an SWF within IMG tag and
use some kind of flashvars to set it's behavior .
Funny, isn't it?


--
Best regards,
GregoryN

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

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

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


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

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


Re: [Flashcoders] about the MovieClipLoader class

2006-06-09 Thread elibol

onLoadComplete is called when the loading process is complete. onLoadInit is
called when whatever has loaded is initialized and ready to use.

The thing is that when a swf is finished loading, it takes one more frame to
initialize. The main point is that until it initializes, the swf is not
rendered and has no API.

It's about the same case with images, except when the image is done loading
it will not be rendered until it is initialized/read; this happens one frame
after the frame it was finished loading on.

The reason? Theoretically (please take note, I am making no claim) it makes
sense when you think about how the player runs code in frames. If the
current frame has a chunk of code that includes code that tests for loading
completion, then it will prepare the initialization code to execute on the
next frame.

For this to be true, it must be true that once code for the next frame is
prepared, it cannot be changed.

M.

On 6/9/06, Geoffrey Holland [EMAIL PROTECTED] wrote:


Hello,



Can someone please explain what I seem to be quirky behavior of the MCL
class which has prevented me from using it until I read about it on
another
post:



When loading an image or swf into a mc, using the MCL class,



Why does this fail (not only fail, but renders the mc unseeable):



loadListener.onLoadComplete = function(tmc:MovieClip):Void {

tmc._width = 100;

tmc._height = 100;

}



But this works:



loadListener.onLoadInit = function(tmc:MovieClip):Void {

tmc._width = 100;

tmc._height = 100;



}



Intuitively, it seems like it would be the opposite.

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

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


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

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


[Flashcoders] Text link on hover

2006-06-08 Thread elibol

Does anyone know if it's possible to trigger an event with a text link hover
state?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


[Flashcoders] Flex Dirby

2006-06-01 Thread elibol

Hey guys,

Has anyone submitted any work to the Flex Dirby?

Here is what we've submitted: http://anticipatechange.com/derby/Main.html

Greets,

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

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


Re: [Flashcoders] SeekBarHandle ???

2006-05-24 Thread elibol

Real vague post mang, maybe you want to be a bit more descriptive next time
=]

Look for the instance name using the flash debugger. You can also use a
recursive function to trace out all instance names of movieclips. Something
like this:

function traceClip(mc:MovieClip){
trace(mc._name+': '+mc);
for(var i in mc){
if(mc[i] instanceof MovieClip) arguments.callee(mc[i]);
}
}

M.

On 5/24/06, Scott Brantley [EMAIL PROTECTED] wrote:


Does anyone know how to reference the SeekBarHandle? My problem is that
I'm trying to toggle its visibility on and off and I have no way of
knowing what its instance name is.





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

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


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

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


Re: [Flashcoders] Benchmark script or CPU detection

2006-05-24 Thread elibol

You can use a frame rate detection code. There are many ways to do this
though.

Here is one reliable technique:

var lastValue:Number = new Date().valueOf();
var frameCounter:Number = 0;
var frameRate:Number = 0; //not average, just the amount of frames entered
in the last second

function onEnterFrame(){
frameCounter++;
if(new Date().valueOf() - lastValue=1000){
lastValue = new Date().valueOf();
frameRate = frameCounter;
frameCounter = 0;
trace(frameRate);
}
}

On 5/24/06, Patrick Matte [EMAIL PROTECTED] wrote:


Hi, does anybody know where i could find a script to detect a user's cpu ?

I'm currently working on an application with lots of animation which uses
a
lot of cpu power. I would like to hide those animations for the low cpu
users because the application jams...

Thanks


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

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


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

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


Re: [Flashcoders] I need your support

2006-05-23 Thread elibol

Hmm, I am told that it probably cannot be done in Safari Joeri, but let
there be hope, I will be in deep thought concering this problem. The IE
solution is used when IE is detected, so the firefox solution is what's used
rather by default. In spite of this I was expecting it to work in Opera.
Luckily, I can grab the windows compilation for Opera for debugging...

Joeri I have a question for you, does the external interface initialize with
Safari? Check for ExternalInterface.available? true/false in the test swf.

Thank you for the support guys,

M.

On 5/23/06, Ujjwal Kabra [EMAIL PROTECTED] wrote:


It does not work with Opera either.

Personally, I think that the IE solution will work only on IE, and you
should be using the firefox solution, or something very similar to it,
for all other browsers.

Ujjwal Kabra

On 5/23/06, Joeri van Oostveen [EMAIL PROTECTED] wrote:
 I can confirm that this solution does _not_ work on Safari...

 Let me know it I need to test something :), as we are looking forward
 to a back/history solution for flash sites.

 greetings
 Joeri

 On 5/22/06, elibol [EMAIL PROTECTED] wrote:
  I've written an external interface solution for back/forward/bookmark
  functionality. Before I use it, I'd really appreciate it if you guys
could
  help me get some information on the different browsers it works with.
 
  http://anticipatechange.com/pierinc/browserSupport/
 
  So far I've tested Firefox and IE, I think though that I will have to
use
  the IE solution for other (safari i think?) popular agents.
 
  Thank you!
 
  M.
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


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

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


[Flashcoders] I need your support

2006-05-22 Thread elibol

I've written an external interface solution for back/forward/bookmark
functionality. Before I use it, I'd really appreciate it if you guys could
help me get some information on the different browsers it works with.

http://anticipatechange.com/pierinc/browserSupport/

So far I've tested Firefox and IE, I think though that I will have to use
the IE solution for other (safari i think?) popular agents.

Thank you!

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

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


Re: [Flashcoders] ScrollPain

2006-05-10 Thread elibol

ScrollPain, haha. That's a good pun.

Are you sure that the target movieclip you're calling attachMovie is being
targeted correctly?

btw, I think it's invalidate() and not redraw().

M

On 5/10/06, Mike Levy [EMAIL PROTECTED] wrote:


Hi All,

I have the following code in AS2 Class files.  (no code on timelines)
The function below is a button handler for a Class that extends MovieClip.

In the button handler function, I am attaching a movieClip that has a
public
ScrollPane so that I can add content to it from this function.  When I use
attachMovie to add a button to the ScrollPane, the button does not appear.
However the 2nd time the function is called, the button does appear?

// button handler for a movieClip to create a popup style window
function dgAdd(evt:Object){
   this.attachMovie(Slice9Window,Slice9Window,
this.getNextHighestDepth());
   this[Slice9Window][pane].contentPath = mv_form_no_builder;
   var mvScroller:MovieClip =
this[Slice9Window][pane].spContentHolder;

mvScroller.attachMovie(Button,the_button,
mvScroller.getNextHighestDepth(
));
   mvScroller[the_button].label = Does this work;
   mvScroller.redraw(); // this didn't help
}

Also, spConentHolder is undocumented, but I have used this in the past.
Compiling with Flash 8 pro.

Thanks for any explanations!  I think it has something to do with the
movieClip not loading by the time I call attachMovie, but I read on
another
thread that if everything is in class files that there is no timing issues
with attachMovie.

mike

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

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


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

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


Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread elibol

=]

On 5/9/06, Tyler Wright [EMAIL PROTECTED] wrote:


I apologize, I mislead you. My EventDispatcher is no longer a problem and
the issue I face now seems to be different. I can only duplicate it making
a
component class that extends MovieClip. The issue is that the for..i..in
loop stops after a gotoAndStop.

class Test extends MovieClip
{
var list:Object;

function Test()
{
list =
{
one:one,
two:two,
three:three,
four:four,
five:five
};

for (var i in list)
{
trace(i);
gotoAndStop(list[i]);
}
}

}

If you define this class and set it up as a component in the Library you
will see that only one is traced out. Then you can comment out the
gotoAndStop(); and it loops through all 5. It behaves the same whether or
not these frames actually exist.

Tyler

On 5/9/06, Thomas Fowler [EMAIL PROTECTED] wrote:

 I would love to help on this but I need a little more context. From what
I
 can gather it looks as if you're trying to dispatch an event a series of
 events and have the corresponding listener/handler do something? Is that
 correct?

 As Kevin stated, it would be better to have a class backing these
 different
 movie clips that dispatch events that trigger another clip to do
something
 when said events occurs.

 On 5/9/06, Kevin Newman [EMAIL PROTECTED] wrote:
 
  Logically it seems as though a list of listeners should be in an
array,
  instead of a collection of object properties, but to each his own :-)
 
  You seem to have a small typo in here:
 
  for (var i in listeners)
  {
  dispatch(listeners[i].event);
  {
 
  The second curly bracket is backwards. I don't know if that is causing
  your problem though, could you give information?
 
  Also, there is an mx object that can do event
  dispatching/management/delegation:
 
  mx.events.EventDispatcher
 
 
 

http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004file=2443.html
 
 
  Kevin N.
 
 
  Tyler Wright wrote:
   I have sevaral for (var i in .. ) loops running looping through
   objects that
   get thrown (interupted OR actually go forever) when I change the
frame
   of a
   movieClip where one exists.
  
   Just as an example:
  
   for (var i in listeners)
   {
dispatch(listeners[i].event);
   {
  
   // the listener
   function setState()
   {
this.gotoAndStop(over);
   }
  
   or so, produced and endless loop (when the listeners object was
   defined on
   the movieClip using the for .. i .. in)
  
   Anyone have any ideas on fixes? I changed my listener to loop
through
   it as
   an Array (which isn't as fast and doesn't allow you to remove
 listening
   objects halfway through the process). I've run into a circumstance
   where I
   can't use an Array.
  
   Tyler
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


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

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


Re: [Flashcoders] Focus Highlight with Components

2006-05-05 Thread elibol

I think what you want is _focusrect.

It's a MovieClip property, so you would have to target the movieclip
instances that are recieving focus.

myMC._focusrect = false;

M.

On 5/3/06, John Giotta [EMAIL PROTECTED] wrote:


 datagrid.rollOverColor = yourBackgroundColor;
 datagrid.textRollOverColor = yourTextColor;

I want to get rid of the light green glow around the Datagrid when
ever the ScrollBar is focused.
Not the row roll over.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Q:del.icio.us API

2006-05-05 Thread elibol

It can be done with AS2.

The easiest way would be to build an API around the query strings.

_xml.load(http://del.icio.us/api/posts/get?tag=humor);

This technique is a bit sketchy though.

M.

On 5/4/06, Mike Britton [EMAIL PROTECTED] wrote:


Mike, can it be done with AS2?

Mike Britton



On 5/4/06, Troy Rollins [EMAIL PROTECTED] wrote:

 On May 4, 2006, at 1:01 PM, Mike Chambers wrote:

  Also, I am doing this in AS3, not AS2.

 You wouldn't happen to be doing this in AS3 on a Mac, would you
 Mike?  ;-)

 (Still waiting for a flex beta for Mac...)
 --
 Troy
 RPSystems, Ltd.
 http://www.rpsystems.net


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

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



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

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


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

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


Re: [Flashcoders] Q:del.icio.us API

2006-05-05 Thread elibol

Sorry to answer a question that was asked of someone else.

On 5/5/06, elibol [EMAIL PROTECTED] wrote:


It can be done with AS2.

The easiest way would be to build an API around the query strings.

_xml.load( http://del.icio.us/api/posts/get?tag=humor);

This technique is a bit sketchy though.

M.


On 5/4/06, Mike Britton  [EMAIL PROTECTED] wrote:

 Mike, can it be done with AS2?

 Mike Britton



 On 5/4/06, Troy Rollins [EMAIL PROTECTED] wrote:
 
  On May 4, 2006, at 1:01 PM, Mike Chambers wrote:
 
   Also, I am doing this in AS3, not AS2.
 
  You wouldn't happen to be doing this in AS3 on a Mac, would you
  Mike?  ;-)
 
  (Still waiting for a flex beta for Mac...)
  --
  Troy
  RPSystems, Ltd.
  http://www.rpsystems.net
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 


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

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




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

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


Re: [Flashcoders] Q:del.icio.us API

2006-05-05 Thread elibol

Right on about standalone.

I was thinking you could work the auth into the url,

http://username:[EMAIL PROTECTED]/api/posts/get?tag=humor

M.

On 5/5/06, Mike Chambers [EMAIL PROTECTED] wrote:


Actually, that is a little different. That would work if running the
browser, as the browser would handle the HTTP auth (it would pop up a
user / pass dialog).

However, running in standalone would not work. You would have to
manually write the appropriate headers in the request.

mike chambers

[EMAIL PROTECTED]

elibol wrote:
 It can be done with AS2.

 The easiest way would be to build an API around the query strings.

 _xml.load(http://del.icio.us/api/posts/get?tag=humor);

 This technique is a bit sketchy though.

 M.

 On 5/4/06, Mike Britton [EMAIL PROTECTED] wrote:

 Mike, can it be done with AS2?

 Mike Britton



 On 5/4/06, Troy Rollins [EMAIL PROTECTED] wrote:
 
  On May 4, 2006, at 1:01 PM, Mike Chambers wrote:
 
   Also, I am doing this in AS3, not AS2.
 
  You wouldn't happen to be doing this in AS3 on a Mac, would you
  Mike?  ;-)
 
  (Still waiting for a flex beta for Mac...)
  --
  Troy
  RPSystems, Ltd.
  http://www.rpsystems.net
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 


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

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

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

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Focus Highlight with Components

2006-05-05 Thread elibol

Oh sorry, I don't have much experience with the v2 data grid.

I think though you can pinpoint what is happening by overriding the scroll
bars onRollOver event. Maybe if you could examine the source you would find
out what the onRollOver may be delegated to. You might be able to see which
event causes the effect, and maybe from there find an externalized method to
disable it. From here though if there is no external method, you could
always just override the function.

Another way would be to just get rid of the movieclip that shows the effect,
if it's dynamically drawn though you might not be able to do this.

M.

On 5/5/06, John Giotta [EMAIL PROTECTED] wrote:


Thanks elibol, but not it.

You'd have to see it for yourself if I'm not making any sense.

I have a Datagrid in on SWF and another SWF is loading it.
Whenever the ScrollBar of the Datagrid is focused, a light green halo
forms around the entire Datagrid. That's what I want gone.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] destructors...

2006-05-04 Thread elibol

Wait though, isn't a class part of the swf compilation? Technically, you
really cannot delete it unless you load the class in via an external swf.
That might be one way of accually doing it.

M.


On 5/3/06, Andreas Rønning [EMAIL PROTECTED] wrote:


Kind of besides the point really. The real point is, in my humble
opinion, that it should be possible to do it without myClass.cleanup();
delete(myClass);
It becomes double naughty if your class instance is in an array.
It's just a question of keeping the amount of fluff down to a minimum.

This is not a critical problem. I am merely asking for people's
methodologies in self destroying classes.

- A

Ian Thomas wrote:
 Hi Andreas,
  To turn it on its head...

  What are you trying to achieve? In what circumstances do you need to
 destroy a class?

 Ian

 On 5/3/06, Andreas Rønning [EMAIL PROTECTED] wrote:

 has anyone got a good way for an as2 class to destroy itself? I know
 it's not possible, but my heart tells me someone has devised some
kind
 of good methodology.

 - A

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

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

--

- Andreas Rønning

---
Flash guy
Rayon Visual Concepts, Oslo, Norway
---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] dynamic image scroller

2006-05-01 Thread elibol

I understand, I've attached a class that I made a while ago that does just
this, you could use it if you like. Here is an example of how to use it:

import utils.*;
var _items = [container.image1, container.image2, container.image3,
container.image4, container.image5]; //these are your images
var a = new WrappingScroller(_items, container, 1, 'h', null, 'l'); // these
are your parameters
a.start(); //start the scrolling

I can think of a new way of doing it now though since flash 8, you could
have a massive jpeg with no clipping with all of your images side by side,
this could be scrolled by applying a matrix with a negative x axis
translation value ( _imageMatrix.translate(-1, 0) ).

Hope this helps,

M.

On 4/30/06, Santy Piet [EMAIL PROTECTED] wrote:


Hi,

I'm Piet from Belgium, student Multimedia and communication. I have to
build a dynamic photo scroller and I'm kinda stuck at coding the thing. This
is the purpose of my swf :

load external images (via xml) in a mc. - no problem with xml, works
perfect
then it has to begin scrolling to the left in a frame but it has to loop,
so when the last image comes in, the first one should follow on the last.
(Some in the other direction) I tried some things but can't get it to work.
The images have all the same height, but different widths. I work with the
holders and a moviecliploader.

If any of you guys can give me any advice, it would be greatly
appreciated.

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

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

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

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

Re: [Flashcoders] loading an external image into a BitmapData

2006-05-01 Thread elibol

Michael excellent response!

Are you attaching the bitmap of the drawn movieclip to a new movieclip? Are
you preloading?

M.

On 4/30/06, Michael Klishin [EMAIL PROTECTED] wrote:


grimmwerks wrote:
 What would be the quickest way of flipping images into a bitmap data?

1. Load it
2. Take a snapshot
3. Unload it or whatever...

--
Michael Antares Klishin,

(Flash + Flex + Java + Ruby)*Eclipse weblog : http://www.novemberain.com/
Email : [EMAIL PROTECTED]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


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

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


Re: [Flashcoders] Flash Maths bug???

2006-04-28 Thread elibol

There is a way to work around it though. The number of numbers between two
integers drops as the number grows, so if you represent your number by
splitting it into more variables, then the precision of your arithmetic will
grow as well.

Try this:

var a:Number = 1.9;
var b:Number = 2.2;
var c = b-a;
trace(c); //0.3

Since it's using lower numbers in the operation, 0.3 is found as the best
representation for the result.

I wrote this to parse number strings to working precisions, I think you
could use a similiar technique to do higher precision arithmetic.

function parsePrecision(a:String){
   var b = a.split('.'), l=b[1].length, b=[Number(b[0]), Number(b[1])], c =
b[1]/Math.pow(10, l);
   return b[0]0? b[0]+c:b[0]-c;

}

var s:String = -952.86;
var i:Number = parsePrecision(s);
trace(i); // -952.86
trace(i - -952.86);   // 0

I think I will have at it later today.

Hope this helps,

M.

On 4/28/06, [EMAIL PROTECTED]  [EMAIL PROTECTED] wrote:



Apologies if this is common knowledge, but I've just come across a huge
maths problem in Flash... as I've mentioned before I'm working on an online
trading system where real people make or lose real money, sometimes a huge
amount of it, so this isn't funny...

Here's some simple arithmetic..

var a:Number = 171.9;
var b:Number = 172.2;
var c:Number;
c = b - a;

Now an elementary school kid would probably give the answer 0.3
Unfortunately Flash has other ideas...

trace(c);
0.283

I'm a bit shocked to be honest. Am I imagining it?

I'm aware that AS3 introduces proper integers and floats for arithmetic,
but that doesnt address my problem now.

What says the wise Chattyfig community??

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


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

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


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

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


Re: [Flashcoders] Shared fonts nightmare

2006-04-28 Thread elibol

Nice idea. You think just one shared library would work?

Since the problem is that each platform renders the same font differently,
the presentation needs to be compiled in the same platform it was designed
in, but the source should have no effect on the presentation; atleast none
that pertain from the compiler. This approach is analogous to how the same
font on both platforms render differently.

If the process of embeding the font is the source of the problem, it can be
determined by observing the effects of not embeding the culprit font,
however, I'm under the impression that this occurs at author time. If it's
the case, then you would have to seperate the libraries.

I had this problem when I was freelancing with a company that had mac users,
and if my memory is right, then the fonts were shifted at author time.

Just tossing in my 2 cents =]

M.

On 4/28/06, Kevin Newman [EMAIL PROTECTED] wrote:


I just posted something similar a few days ago. To take care of the font
shifting you can make sure to publish the files with the fonts on the
system they were designed on. So for example if you did the design on
the pc, then the swf and the shared lib with the fonts should also be
published on the pc. If you did the design on the mac, then the final
output should also be on the mac.

I suppose you could end up with a problem where some files were designed
on the mac, and some on then pc, in this case you may never be able to
get them to line up right all the time using the same publishing
computer - so you could do a comprimise by making sure all PC designed
flas are finally published on a PC and use a PC fonts shared lib, while
all the Mac designed flas are published on the Mac, and use a Mac fonts
shared lib. It's suboptimal, but it's better than 50K on every file.

By the way I have no experience with fonts in shared libraries, so while
conceptually this solution should work, it might be overkill, since just
making sure to publish the final swf on the platform they were layed out
in, might fix the problem. In our environment, I do programming on the
PC, and the designers do layout on the Mac, so after they do the layout,
I have to program it, then send it back to them for final output to get
the fonts to line up. I'm not sure how to work in the shared font libs,
but I would bet that using two different libs (one PC and one Mac) would
fix it.

Kevin N.


Serge Jespers wrote:
 Hey guyz,

 I'm working on this project that has a shared library with some
 movieclips and fonts...
 It are those fonts that cause quite a bit of stress...

 The designer on this project is on a PC and I work on a Mac... Not
 that that should matter but I'm taking a wild guess this is the
 problem...

 The situation... Both his PC and my Mac have all the fonts... Same TTF
 files. However, if I use the shared fonts in the swf on the server,
 they come out looking like this:
 http://webkitchen.be/downloads/sharedfonts.png
 Not really what was intended...

 If I make that library again, and use my shared lib instead of the one
 on the server, the text comes out right but is shifted down by quite a
 few pixels causing the design to be screwed up...

 So yeah... Should we just drop the shared fonts and thereby add a some
 50k to each swf? Or is there something we may not have thought about?

 Thanks for your help,
 Serge




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

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


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

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


Re: [OBORONA-SPAM] RE: [Flashcoders] Are you a help vampire?

2006-04-27 Thread elibol
Shh back off man he's got it under control.

On 4/27/06, ? ??? [EMAIL PROTECTED] wrote:

 Jim Tann ?:
  http://www.osflash.org/flashcoders/as2#handling_scope_in_event_handlers
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan
  Berry
  Sent: 26 April 2006 23:53
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] Are you a help vampire?
 
  I want to offer a basic counterpoint to this: what if the question is
  just
  from a beginner, who has in fact researched a problem found the
  documentation/resources incomplete in some way? Is it just because a
  person
  is a beginner that you will not offer help?
 
  Case in point, and be patient with me. I am not by any means venting
  here,
  but I offered a question some time ago about the basic placement of
  anonymous functions like btn1.onRelease =
  function(){getURL(_root.variable_name,_blank);} and also asked about
  whether or not such a function required the _root if it was in fact on
  the
  _root timeline. I actually received some very nice assistance on this
  and I
  appreciate the poster, since though I did discover that this was true
  through experimentation myself, he did give me a short lesson on scope.
  I
  had already learned about the Delegate class, but this basic issue was
  not
  clear in my reading, so I would not know I had to use _root or Delegate
  or
  what have you. I do know some Javascript and PHP and so programming is
  not
  beyond me, but learning a new technology from the ground up is the way I
  learn generally. I like to know *all* the aspects. So please permit
  those
  who are learning and obviously trying the benefit of the doubt.
 
  Another thing is further questions on the same subject. In this same
  issue,
  I had the question are such function assignments applicable to a button
  if
  the code is placed before the button on the timeline? I got a no, of
  course, which was a basic thing I had sketchy knowledge on. What I had
  was
  an ad sent to us by a client wherein the previous coder had used on()
  handlers on the clips and I was trying to rewrite it to include the
  anonymous functions and our variables, as stated before. When I wrote in
  the
  code in a keyframe in the actions layer above where the button was
  instantiated, it worked, but when a new keyframe in the button layer
  came
  up, I had to re-enter the code there as well. This seemed like
  repetitive
  work and my further question about this was not answered.
 
  My point is, does this make me dumb? No. It would make me lazy however
  if I
  did not research this. But this basic practice of where code should be
  written and how often was not clear to me since the project was not
  working
  in subsequent frames and the documentation I had read seemed to say
  write
  and be done with it.
 
  I suppose I am both asking this general question again, to help solidify
  my
  knowledge, and also pointing out that this does not make those who try
  but
  fail stupid. All I am saying is that I appreciate all your knowledge on
  this
  subject, but please have patience with those who are trying to learn and
  distinguish them from the vampires who ask questions that are so general
  that they lack any knowledge of Flash.
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
  I suppose I am both asking this general question again, to help
  solidify my knowledge, and also pointing out that this does not make
  those who try but fail stupid. All I am saying is that I appreciate
  all your knowledge on this subject, but please have patience with
  those who are trying to learn and distinguish them from the vampires
  who ask questions that are so general that they lack any knowledge of
  Flash.
 Entirely and completely I support this comrade.

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

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

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:

Re: [Flashcoders] Is it okay to destroy a singleton?

2006-04-26 Thread elibol
There are just a few things to keep in mind when you destroy objects, you
should remove any broadcasters they are listening to (removeListener(this))
and remove any movieclips that are instantiated during the init process.
Seperate the object from the graphics when you think about your object so
that no orphan movieclips occur when you get rid of the object.

You want to make sure that removeMovieClip will invoke by setting the
movieclip depth equal to or lower than 1048575.

I usually use a die() method which takes care of these things. Maybe a base
object that might implement a die function that did common tasks would be
best, it's how I do it normally so that I don't have to write a die function
for all of my objects.

Any other relationship the object holds with the application should be
considered. I don't think you will have any problems beyond what I've
mentioned if the object is well encapsulated.

I hope this helps,

M.

On 4/26/06, Manuel Saint-Victor [EMAIL PROTECTED] wrote:

 What is the best way to destroy a Singleton?  I have a program that has a
 videoList when members are logged in - when they log out although the swf
 will still be open I would like that the list (which is a Singleton that
 they can tote around with them throughout the minisite) be destroyed-.  I
 was thinking of creating a destroy method of the singleton that would set
 the _instance value to null and therefore allow the whole creation and
 init() process to be called anew by the login but wondered if I was
 setting
 myself up for a pitfall that I didn't know about.

 Thanks,

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

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

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

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


Re: [Flashcoders] [POLL] getters setters preference

2006-04-26 Thread elibol
It's circumstancial, I have no preference. Depending on the problem, one
will solve better than the other. However, which will solve a particular
problem better is controversial.

M.

On 4/26/06, Jim Tann [EMAIL PROTECTED] wrote:

 Hello all,

 After a long time of trying to figure which method of using getters 
 setters is better I though the best way to get a good answer is to throw
 it open to the list.

 Do you prefer to use the inbuilt getter  setter functionality?
 i.e.

 public function get myProperty():Number{ return _myProperty; }
 public function set myProperty(intSet:Number):Void{ _myProperty =
 intSet; }

 or do you prefer using normal functions?
 i.e.

 public function getMyProperty():Number{ return _myProperty; }
 public function setMyProperty(intSet:Number):Void{ _myProperty = intSet;
 }

 I like the first method as it looks cleaner, but there have been issues
 with inheritance where if you overwrite either the getter or setter, but
 not both in the child class it gets ignored.

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

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

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

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


Re: [Flashcoders] Are you a help vampire?

2006-04-26 Thread elibol
Wait, huh?

.

On 4/26/06, Jordan Snyder [EMAIL PROTECTED] wrote:

 It's true that females are not as inclined to become Help Vampires.  We
 will
 ask for directions sooner than most men, but we will consider our options
 considerably before asking technical questions.  And our brains just work
 better anyway, really. :P

 Cheers!


 On 4/26/06, Robert A. Colvin [EMAIL PROTECTED] wrote:
 
  To make a decent multi-player game you will need a proxy
  server(FCS/FMS2). You could probably get away with using Jabber.
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Michael
  Stuhr
  Sent: Wednesday, April 26, 2006 3:43 PM
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] Are you a help vampire?
 
  Chris Hill schrieb:
   hi hello how do I make a multi-player game in flash its got to have
   lasers thank you
  
   eric dolecki wrote:
   I know of a few... and I am sure at a few points in the past I have
  almost
   been one :)
  
   On 4/26/06, John Dowdell [EMAIL PROTECTED] wrote:
  
   Steven Sacks wrote:
  
   http://www.slash7.com/pages/vampires
   I'm not sure, what's a help vampire...?  ;-)
  
   jd
  
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
  
  made my day ;-)
 
  micha
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 


 --
 Jordan Snyder
 Applications Developer
 Image Action LLC
 Business: http://www.imageaction.com
 Personal: http://www.myspace.com/okallie
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


Re: [Flashcoders] Are you a help vampire?

2006-04-26 Thread elibol
Wholy crap Jonathan I give you an E for (E)xcellent thesis. I didn't have
the time nor the patience to read it, so I apologize, however, I think I
should point out that nowhere in the article does it categorize anyone as
smart or stupid.

I believe this point is important to emphasize:

This is autonomous behavior. Again, we shouldn't hate the Help Vampire. Or
stake them. They know not what they do, only that they are driven to do it,
and I believe they can be saved.

M.

On 4/26/06, Jonathan Berry [EMAIL PROTECTED] wrote:

 I want to offer a basic counterpoint to this: what if the question is just
 from a beginner, who has in fact researched a problem found the
 documentation/resources incomplete in some way? Is it just because a
 person
 is a beginner that you will not offer help?

 Case in point, and be patient with me. I am not by any means venting here,
 but I offered a question some time ago about the basic placement of
 anonymous functions like btn1.onRelease =
 function(){getURL(_root.variable_name,_blank);} and also asked about
 whether or not such a function required the _root if it was in fact on the
 _root timeline. I actually received some very nice assistance on this and
 I
 appreciate the poster, since though I did discover that this was true
 through experimentation myself, he did give me a short lesson on scope. I
 had already learned about the Delegate class, but this basic issue was not
 clear in my reading, so I would not know I had to use _root or Delegate or
 what have you. I do know some Javascript and PHP and so programming is not
 beyond me, but learning a new technology from the ground up is the way I
 learn generally. I like to know *all* the aspects. So please permit those
 who are learning and obviously trying the benefit of the doubt.

 Another thing is further questions on the same subject. In this same
 issue,
 I had the question are such function assignments applicable to a button
 if
 the code is placed before the button on the timeline? I got a no, of
 course, which was a basic thing I had sketchy knowledge on. What I had was
 an ad sent to us by a client wherein the previous coder had used on()
 handlers on the clips and I was trying to rewrite it to include the
 anonymous functions and our variables, as stated before. When I wrote in
 the
 code in a keyframe in the actions layer above where the button was
 instantiated, it worked, but when a new keyframe in the button layer came
 up, I had to re-enter the code there as well. This seemed like repetitive
 work and my further question about this was not answered.

 My point is, does this make me dumb? No. It would make me lazy however if
 I
 did not research this. But this basic practice of where code should be
 written and how often was not clear to me since the project was not
 working
 in subsequent frames and the documentation I had read seemed to say write
 and be done with it.

 I suppose I am both asking this general question again, to help solidify
 my
 knowledge, and also pointing out that this does not make those who try but
 fail stupid. All I am saying is that I appreciate all your knowledge on
 this
 subject, but please have patience with those who are trying to learn and
 distinguish them from the vampires who ask questions that are so general
 that they lack any knowledge of Flash.
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


  1   2   3   >