[Flashcoders] AS2.0 - Parsing special HTML characters in CDATA - onLoad vs onData

2010-08-16 Thread Greg Ligierko
Hi everyone,

It is a bit outdated topic of AS2.0. I just wonder if somebody can
explain me why onLoad and (inderectly) onData produces different
CDATA node values. I lost a lot of time trying to figure this out,
searching the Web did not help much...

Let's consider an XML file source:
  node![CDATA[lt;]]/node


1) After loading to an XML object, when tracing the xml in its onLoad
handler, the output is:
   nodelt;/node

When trying to pass the CDATA node's nodeValue to a HTML enabled text
field (as html text), then the text field is blank. The reason is that
nodeValue returns a single character  instead of lt;, so the
html text field tries to open a html tag displaying nothing...


2) When capturing onData and creating a new XML object from raw XML
file source like this:

 xml.onLoad=function(source){
var newXML = XML(source);
trace(newXML);
 }

...then the trace outputs:
   nodeamp;lt;/node (the ampersand is converted !)

After passing CDATA node's nodeValue to an HTML text field I got:
  (less than)
... as want and expected. The nodeValue returned lt; this time
instead of the single less-than character.

I couldn't find a way to display less-than after capturing onLoad
other than writing in the xml file:
  ![CDATA[.amp;lt;]]
Is this an onLoad parsing bug of the Flash Player ? Or maybe using
onLoad is just not a good idea and should be avoided ? I have a number
of onLoad handlers around in a big project, probably all need
conversion... 

Thanks,

Greg





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


Re[2]: [Flashcoders] AS3 - Objective-C

2010-03-20 Thread Greg Ligierko
I am learning ObjC for about a month. The purpose is porting and
existing AS2 application to iphone/ipad. Having very poor C experence
I can say, that knowing C is not something essential to familiarize
and then working fore real with apple frameworks.

Before I started XCode for good, I bought some books:

1) Programming in Objective-C 2.0 (2nd Edition) by Stephen G. Kochan.
It's about complete basics of ObjC, this one explains details of the
ObjC syntax, classes, interfaces, implementation, protocols, special
characters, memory management... in general - roots.

In Kochan's book, there is an interesting paragraph related directly to
your question about C (chapter Underlaying C Language Features):
This chapter describes features of the ObjC language that you don't
necessarily need to know to write ObjC programs. In fact, most of 
these come from the underlaying C programming language. (...) some of
these features go against the grain of object oriented programming.
They can also interfere with some of strategies implemented by
Foundation framework such as memory allocation methodology or work
with character strings containing multibyte (UTF8) characters.


2) Cocoa Design Patterns Erik M. Buck
This one is great. It is like GOF translated to Apple frameworks. But
it is not as general as GOF. It is really based on the Cocoa language
features.

Kochan's book is like looking at ObjC through a microscope and Buck's
book is more like looking from a mountain into the cocoa valley :)

3,4) Two others by Dave Mark, dedicated to pure iPhone development.
They provide good intro to Interface Builder and iPhone features -
accelerometer, giro, multitouch, but most important - outlets and
delegates:
Beginning iPhone 3 Development: Exploring the iPhone SDK
More iPhone 3 Development: Tackling iPhone SDK 3 (Beginning)

g.



Tuesday, March 16, 2010 (9:36:01 PM):

 I think of the .h files as interfaces - it makes sense after that

 Sent from my iPhone

 On 16 Mar 2010, at 18:59, Eric E. Dolecki edole...@gmail.com wrote:

 I have heard that one should know C before diving into Obj-C. I did  
 not do
 that as I wanted to dive in quicker. Once you get your head around  
 memory
 management and how to manipulate NSString, etc. you'll be well on  
 your way.
 The whole .h .m thing is strange, etc. I'm not sure if it would have  
 made a
 big difference for me to learn C first or not, but I chose not to  
 and spent
 a lot of time reading tutorials and books about Obj-C. I suppose it  
 all
 depends on what kind of sponge you are.

 Eric

 On Tue, Mar 16, 2010 at 2:30 PM, .matt mattsp...@gmail.com wrote:

 So is it a fools errand to try to dive into iPhone dev without  
 knowing C
 going in? Can one bypass C and dive directly into O-C?

 .m



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


Re: [Flashcoders] Registration Point Issue

2010-02-09 Thread Greg Ligierko
All display objects have registration points (their internal 0,0
coordinates). Also bitmaps.

By default a loaded image (png) has its registration point in the
top-left corner. If you like to get rid of the improperly set
registration point then you may place the loaded image into a parent
container and align the image centrally inside its parent:

 stage - parent_container - your_image

You can do this by creating a new Sprite (or MovieClip) in the
Event.COMPLETE handler:

  function loaded(evt:Event):void
  {
   //create the parent
   var parent_container:Sprite = new Sprite();
   // ...and add it to the stage
   addChild(parent_container)
  
   var loaderInfo:LoaderInfo = evt.target as LoaderInfo;
   var displayObject:DisplayObject = loaderInfo.content;
   displayObject.width = 150;
   displayObject.height = 150;

   // instead, move the parent
   //displayObject.x = 1000;
   //displayObject.y = 208;
   parent_container.x = 1000;
   parent_container.y = 208;

   //note that the displayObject is added to parent_container
   parent_container.addChild(displayObject);

   // now, place the displayObject's center over its parent
   // (0,0) point, by moving half width and half height in
   // top-left direction
   displayObject.x = -displayObject.width / 2;
   displayObject.y = -displayObject.height / 2;

   // see what you get:
   trace('parent_container.x: ' + parent_container.x);
   trace('parent_container.y: ' + parent_container.y);
   trace('displayObject.x: ' + displayObject.x);
   trace('displayObject.y: ' + displayObject.y);

   //..
   
   //.. continue with tween etc. but (!) perform all operations on
   // the parent container:
   parent_container.alpha = 0;
   TweenLite.to(parent_container, 1, {x:65, y:117, scaleX:0.5,
   scaleY:0.5, rotation:520, alpha:1});
 }

g


Tuesday, February 09, 2010 (12:55:49 PM) beno- wrote:

 Hi;
 I have this code:

 package
 {
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;
 import flash.display.Loader;
 import flash.display.LoaderInfo;
 import flash.display.DisplayObject;
 import flash.net.URLRequest;
 import flash.display.Shape;
 import flash.geom.*;
 import flash.display.Bitmap;
 import flash.display.BitmapData;
 import flash.filters.GlowFilter;
 import flash.filters.BitmapFilterQuality;
 import flash.geom.Rectangle;
 import com.greensock.*;
import com.greensock.easing.*;
 import SpinningWorld;
  public class GlobalSolutions extends MovieClip
{
   //Import Library Assests
 public var mySpinningWorld:SpinningWorld;
 public var radius:int = 500;
 public var textureMap:BitmapData;
 public var myLogo:Bitmap;
   public function GlobalSolutions()
   {
  init();
   }

   public function init():void
   {
 mySpinningWorld = new SpinningWorld();
 mySpinningWorld.x = -500;
 mySpinningWorld.y = -500;
 mySpinningWorld.alpha = 0;
 addChild(mySpinningWorld);
 TweenLite.to(mySpinningWorld, 1, {x:-100, y:0, scaleX:0.4, scaleY:0.4,
 alpha:1});
 loadImage();
 }

 private function loadImage():void
 {
 var path:String = images/logo.png;
 var req:URLRequest = new URLRequest(path);
 var loader:Loader = new Loader();
 loader.load(req);
 loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
 }

 function loaded(evt:Event):void
 {
 var loaderInfo:LoaderInfo = evt.target as LoaderInfo;
 var displayObject:DisplayObject = loaderInfo.content;
 displayObject.width = 150;
 displayObject.height = 150;
 displayObject.x = 1000;
 displayObject.y = 208;
 addChild(displayObject);
 displayObject.alpha = 0;
 TweenLite.to(displayObject, 1, {x:65, y:117, scaleX:0.5, scaleY:0.5,
 rotation:520, alpha:1});
 }
}
 }

 For some reason, logo.png describes an arc as it spins on its axis,
 similar to, say, the Earth spinning on its axis while simultaneously
 rotating around the Sun. The gent from greensock tells me this is because
 I've misplaced my registration point, but this graphic doesn't have a
 registration point as far as I can see. So what gives? How do I get rid of
 the arcing?
 TIA,
 beno

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


Re: [Flashcoders] Registration Point Issue

2010-02-09 Thread Greg Ligierko
(sorry for direct addressing previous mail)

1) Do not instantiate objects in properties declaration list. Its 99%
cases bad.

Keep it like this:

package {

  //...

  public class GlobalSolutions extends MovieClip
  {
   //... (no instance, only declaration of class property)
   private var parent_container:Sprite;
   //...
  
   private function loadImage():void
   {
// Instantiate it here BUT don't declare a new variable
// Just use the class property. No var no :Sprite ok ?
parent_container = new Sprite();
addChild(parent_container)
//...
   }

2) Later, I can see you write (in loaded()):

   displayObject.alpha = 0;
   TweenLite.to(parent_container, 1, {x:65, y:117, scaleX:0.5, scaleY:0.5, 
rotation:520, alpha:1});

So, displayObject has constantly alpha=0 and it is not visible (it is
not passed to the tween, so its alpha does not change). By intention I
wrote: 

   parent_container.alpha = 0; //(not displayObject = ...)

because later you tween both position, scale and alpha of one object - 
parent_container.

Parent's alpha, has nothing to do with the displayObject's alpha. The
displayObject is inside the parent but their properties (x,y,alpha
etc.) are still separate.

So, finally these two lines should be:

  parent_container.alpha = 0;
  TweenLite.to(parent_container, 1, {x:65, y:117, scaleX:0.5, scaleY:0.5, 
rotation:520, alpha:1}); }

g


Tuesday, February 09, 2010 (1:47:06 PM) beno - wrote:


On Tue, Feb 9, 2010 at 8:24 AM, Greg Ligierko gre...@l-d5.com wrote:

All display objects have registration points (their internal 0,0
coordinates). Also bitmaps.

By default a loaded image (png) has its registration point in the
top-left corner. If you like to get rid of the improperly set
registration point then you may place the loaded image into a parent
container and align the image centrally inside its parent:

 stage - parent_container - your_image

You can do this by creating a new Sprite (or MovieClip) in the
Event.COMPLETE handler:


 function loaded(evt:Event):void
 {
  //create the parent
  var parent_container:Sprite = new Sprite();
  // ...and add it to the stage
  addChild(parent_container)


  var loaderInfo:LoaderInfo = evt.target as LoaderInfo;
  var displayObject:DisplayObject = loaderInfo.content;
  displayObject.width = 150;
  displayObject.height = 150;

  // instead, move the parent
  //displayObject.x = 1000;
  //displayObject.y = 208;
  parent_container.x = 1000;
  parent_container.y = 208;

  //note that the displayObject is added to parent_container
  parent_container.addChild(displayObject);

  // now, place the displayObject's center over its parent
  // (0,0) point, by moving half width and half height in
  // top-left direction
  displayObject.x = -displayObject.width / 2;
  displayObject.y = -displayObject.height / 2;

  // see what you get:
  trace('parent_container.x: ' + parent_container.x);
  trace('parent_container.y: ' + parent_container.y);
  trace('displayObject.x: ' + displayObject.x);
  trace('displayObject.y: ' + displayObject.y);

  //..

  //.. continue with tween etc. but (!) perform all operations on
  // the parent container:
  parent_container.alpha = 0;
  TweenLite.to(parent_container, 1, {x:65, y:117, scaleX:0.5,

  scaleY:0.5, rotation:520, alpha:1});
 }


Well now that makes a lot of sense! However, here's what's traced:

parent_container.x: 100
parent_container.y: 208
displayObject.x: -75
displayObject.y: -75

and the object doesn't show up. I've been playing with values for the x and y 
of displayObject but with no satisfactory results. Just to be on the safe side, 
the code follows. Please advise once again.
TIA,
beno

package
{
 import flash.display.Sprite;
 import flash.events.Event;
   import flash.events.ProgressEvent;
   import flash.events.Event;
   import flash.events.MouseEvent;
   import flash.display.MovieClip;
 import flash.display.Loader;
 import flash.display.LoaderInfo;
 import flash.display.DisplayObject;
 import flash.net.URLRequest;
 import flash.display.Shape;
 import flash.geom.*;
 import flash.display.Bitmap;
 import flash.display.BitmapData;
 import flash.filters.GlowFilter;
 import flash.filters.BitmapFilterQuality;
 import flash.geom.Rectangle;
 import com.greensock.*;
   import com.greensock.easing.*;
 import SpinningWorld;
 
 public class GlobalSolutions extends MovieClip
   {
  //Import Library Assests
  public var mySpinningWorld:SpinningWorld;
  public var radius:int = 500;
  public var textureMap:BitmapData;
  public var myLogo:Bitmap;
  var parent_container:Sprite = new Sprite();
  
  public function GlobalSolutions()
  {
 init();
  }
   
  public

Re: [Flashcoders] Registration Point Issue

2010-02-09 Thread Greg Ligierko
Thanks.

g

Tuesday, February 09, 2010 (3:36:30 PM) Henrik Andersson wrote:

 Allow me to explain why it is bad. It is due to the object only being
 created once. Not once per instance of the class, but once total. This
 is clearly going to cause issues for any class that is used more than once.


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


Re: [Flashcoders] Registration Point Issue

2010-02-09 Thread Greg Ligierko
I tested this:

package {
public class MyClass {

   private static var instNum:Number = 0;

   public var someObj:Object = new Object();

   public function MyClass() {
   someObj.name = Sun + MyClass.instNum++;
   }
}
}

and tracing later gives:

var mc1:MyClass = new MyClass();
var mc2:MyClass = new MyClass();
trace(mc1.someObj.name:  + mc1.someObj.name); //outputs mc1.someObj.name: Sun0
trace(mc2.someObj.name:  + mc2.someObj.name); //outputs mc1.someObj.name: Sun1
trace(mc1.someObj.name:  + mc1.someObj.name); //outputs mc1.someObj.name: Sun0
trace(mc2.someObj.name:  + mc2.someObj.name); //outputs mc1.someObj.name: Sun1

... so seems to give two separate objects, one for each instance. But
perhaps issues would appear in sub classes. I don't know.

g


Tuesday, February 09, 2010 (3:36:30 PM) Henrik Andersson wrote:

 Allow me to explain why it is bad. It is due to the object only being
 created once. Not once per instance of the class, but once total. This
 is clearly going to cause issues for any class that is used more than once.


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


Re: [Flashcoders] MouseMove - performance issues

2010-02-01 Thread Greg Ligierko
If the code must be really called for each mouse move, then I have no
solutions . However if it is not crucial to execute all code for each
event, then perhaps you could add an incremental flag and execute code
for some of the events only, eg:

 events_count = 0
 
 MOUSE MOVE
 if((events_count++ % 5) == 0) { then execute code } else { wait next event }

To make sure that something is changed after user releases the screen,
then you can call code execution on mouse UP (if last count did not):

 MOUSE UP
 if(events_cout  0  (events_count % 5) != 0) { then execute code }

The bigger modulo (here 5), the more noticeable may be the
unresponsiveness to the user, but the faster refresh.

I know it is a brutal overcome.

g
 

Monday, February 01, 2010 (2:23:40 PM) Glen Pike wrote:

 Hi,

 I am noticing a performance issue creeping into my application todo
 with mouse movement.

 We have a touchscreen with custom sliders to control stuff via a few
 AS3 classes then an XML socket.

 The sliders use a thumb which applies an MOUSE_MOVE listener to 
 the stage when the thumb receives a MOUSE_DOWN event and removes it when
 the stage / thumb gets a MOUSE_UP event.

 If someone moves the slider quickly, over a period of time, the 
 screen update becomes more and more delayed and when you release the 
 slider. it bounces around for ages after you let go, the longer and 
 faster you move it for, the longer it takes to stop.

 Now some of this bottleneck is due to the amount of code that gets
 called each mouse move, which I understand.  What I could do with does
 anyone have any tips or techniques for reducing the bottleneck or 
 handling the mouse movement events differently.

 e.g.  Do I need to start looking at ENTER_FRAME or timer based 
 events, or something else.

 From what I understand, FlashPlayer will handle the mouse events as
 the OS sends them - the problem is not apparent on Windows running dual
 Xeon 5150's, but deploying on an AMD Athlon Dual core 5000+ running 
 Gentoo + FP10 (10.0.32.18?) the FlashPlayer don't like it, no sirree.

 TIA.

 Glen


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


Re: [Flashcoders] WIRED hates Flash

2010-01-29 Thread Greg Ligierko
So, what about iPhone and CS5 ? Isn't going to be the same path with
iPad and just matter of time ?
g


Friday, January 29, 2010 (2:53:24 PM) artur wrote:

 i have an agency client who i get a lot of flash work from.

 however they are not technically saavy and they're
 EASILY swayed when they read filth like this!

 they simply freak out and want to stop making flash websites all-together.
 WTF?!

 so i need to make a STRONG case here.

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



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


Re: [Flashcoders] Rotation

2010-01-26 Thread Greg Ligierko
Another resource about teewning and Flash animation basics:
http://animation.about.com/od/flashbasicstweening/Flash_Basics_Tweening.htm

g

Tuesday, January 26, 2010 (3:04:21 PM) - beno wrote:

 On Tue, Jan 26, 2010 at 9:17 AM, Geografiek geograf...@geografiek.nlwrote:

 Hi Beno,
 This might help:
 http://chattyfig.figleaf.com/mailman/listinfo/flashnewbie


 On second thought, forget flashnewbie. 3 posts so far this year. Hardly an
 active list. Other suggestions?
 beno


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


Re: [Flashcoders] Design pattern?

2010-01-18 Thread Greg Ligierko
I do not have the feeling how user interacts with the buttons. I am
just guessing that each button will be clicked many times in one
sequence and after reaching the desired state (a,b,c,...c,d,a,B) user
will move the cursor to a next button (or close the window).

If this is the scenario, then maybe a mixture of - on roll out event -
and timer would be effective (still low traffic and save guarantee).

g


Monday, January 18, 2010 (4:30:38 PM) Paul Andrews wrote:

 A lot of unnecessary traffic to and load upon the remote database server.


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


Re: [Flashcoders] Design pattern?

2010-01-18 Thread Greg Ligierko
If I did, then for sure there is a better method :)

I did not play with the onBeforeUnload JS event and don't know whether
overriding its handler could work with ExternalInterface. Perhaps you
already considered this. The JS dialog might be annoying but this
could be another alternative.
http://pro-thoughts.blogspot.com/2006/03/onbeforeunload-event.html

g

Monday, January 18, 2010 (6:29:08 PM) Paul Andrews wrote:

 Greg Ligierko wrote:
 I do not have the feeling how user interacts with the buttons. I am
 just guessing that each button will be clicked many times in one
 sequence and after reaching the desired state (a,b,c,...c,d,a,B) user
 will move the cursor to a next button (or close the window).

 If this is the scenario, then maybe a mixture of - on roll out event -
 and timer would be effective (still low traffic and save guarantee).
   
 You've more or less described my original plan!
 g




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


Re: [Flashcoders] What is your policy on loading files?

2010-01-15 Thread Greg Ligierko
I agree with Glenn... it depends on size, particular example and is
often a speculation before the project starts running. If this is
going to be a micro-engine, why not add a set of modes and use one
depending on site. However this would mean a lot of work and testing.

Perhaps a more elastic approach could be using simple 0/1 flags in XML
attributes saying whether the asset it defines should be loaded
instantly or wait for a request. This would mean just handling two
modes from the engine's perspective.

g




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


[Flashcoders] Declaring Function Variables

2010-01-08 Thread Greg Ligierko
...Or if you like to perform a recursion (particular case of nesting).
I do not belive there is a good way to re-declare a variable inside
the scope of one function.

(?) You could comment out vars, copy/paste them with active code and
uncomment when needed; it is more a text editor issue:
//var x:Number;
//var y:Number;
//var a:Number;
a = x + y;

I think that splitting long function bodies into separate short ones
is a better idea. All local variables may be declared (and not
re-declared) inside these short functions:
var x = calcA( calB() + calcC() ) / calcD();

g

Friday, January 08, 2010 (1:18:45 PM) Cor wrote:

 OOOh, indeed, that would be a bad choice.

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Andrews
 Sent: vrijdag 8 januari 2010 13:16
 To: Flash Coders List
 Subject: Re: [Flashcoders] Declaring Function Variables

 Cor wrote:
 Mmmm, I have never experienced any problems with it.
   
 It just means you havent used the same variable in a loop with nested 
 functions that are also using the variable.
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
 Andrews
 Sent: vrijdag 8 januari 2010 12:47
 To: Flash Coders List
 Subject: Re: [Flashcoders] Declaring Function Variables

 Cor wrote:
   
 Declaring it within a function will make the variable LOCAL (= usage in
 
 that
   
 function only).
 You only declare it outside, once and (re)use it as often as you like.
   
 
 I would advise that it's best to avoid doing that. Most of the time it 
 won't give you a problem, but then you'll spend some time trying to find 
 out why that function call is messing up the loop count of the code it's 
 called in.
   
 HTH
 Cor

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David
 
 Benman
   
 Sent: vrijdag 8 januari 2010 12:16
 To: Flash Coders List
 Subject: [Flashcoders] Declaring Function Variables

 What's the best practice for declaring reused variables within a  
 function in AS3? For example, if you use count several times in your  
 function, if you declare it at the start of your function, var  
 count:Number; it makes it harder to cut and paste your code for use  
 elsewhere but you get errors if redeclare it (like you could in AS2)  
 throughout your script.


 David Benman
 Interactive Developer
 d...@dbenman.com
 http://www.dbenman.com
 (508) 954-1202 (cell)
 (315) 637-8487 (home office)



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 No virus found in this incoming message.
 Checked by AVG - www.avg.com 
 Version: 9.0.725 / Virus Database: 270.14.129/2605 - Release Date:
 
 01/07/10
   
 08:35:00

 ___
 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
 No virus found in this incoming message.
 Checked by AVG - www.avg.com 
 Version: 9.0.725 / Virus Database: 270.14.129/2605 - Release Date:
 01/07/10
 08:35:00

 ___
 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
 No virus found in this incoming message.
 Checked by AVG - www.avg.com 
 Version: 9.0.725 / Virus Database: 270.14.129/2605 - Release Date: 01/07/10
 08:35:00

 ___
 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] A utility to extract Actionscript from an FLA, and create .as files

2010-01-06 Thread Greg Ligierko
This resource probably appeared on the list some time ago.
It is a good start point if you like to recombine a JSFL:
http://dynamicflash.com/jsfl/#Library

I can see oyFashDoc.jsfl file builds XML tracing results to the
output screen, which is finally saved as an XML file. You should
probably just reformat all trace() sentences you find around.

hth
Greg

Wednesday, January 06, 2010 (9:11:18 PM) Matt Stuehler wrote:

 All,

 I'm inheriting a rather large Flash application in which all of the
 Actionscript is stored in the FLA. Specifically, the FLA has dozens of
 movie clips, and each clip has it's own Actionscript (typically on the
 first frame).

 Is there any way to extract all of the Actionscript into separate .as
 files and replace the Actionscript in the FLA with an #include
 [filename].as directive?

 I've come across the oyFashDoc.jsfl Flash extension which does some of
 what I'm looking for (it scrapes all the Actionscript, but into a
 single XML file).

 I don't know much about JSFL; otherwise, I'd try modding that script
 myself. Hopefully, someone has already done it...

 Many thanks in advance for any insight or advice!

 Cheers,
 Matt


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


Re: [Flashcoders] Loading and resizing images despite wrong crossdomain.xml

2009-12-28 Thread Greg Ligierko
Alexander,

I don't know if your question is still up-to-date. I do not have much
experience in AS3 external content loading, but this should be similar
to AS2.0 

You can load any images without any security grants from any domain
you like. The restriction is added to objects that are related to the
container were you load your content.

In case of using external domain images a good idea is loading them
into a nested container, which has a Sprite or MovieClip parent. To
resize the image you can resize its parent container.

 Stage - some_container[MC] - image_parent_container[MC] - drop_zone[MC]

The drop_zone is were you load the external content, e.g. an image.
The image_parent is completely accessible to your code so you can
scale it, fade it, mask it etc. If the parent container holds only
your drop_zone, then any operation on its size will be mapped to the
drop_zone.

hth
g


Friday, December 25, 2009 (7:11:51 PM) Alexander Farber wrote:

 Oh, I think I start to understand:
 my Event.INIT callback _is_ being called.

 But once it tries to access Loader.content
 for resizing the loaded image,
 then I get the SecurityError.


 On Fri, Dec 25, 2009 at 6:22 PM, Alexander Farber
 alexander.far...@gmail.com wrote:
 I have an AS3 game hosted at my site http://preferans.de
 which displays resized avatars of gamers. It works ok.

 To attract more users, I've added support for the users of
 http://vkontakte.ru (the russian Facebook clone, 50 mio. users)
 to play at my site without additional registration.

 The http://vkontakte.ru/crossdomain.xml of course
 doesn't list my site or any wildcards and never will.

 Still I'm able to load vkontakte.ru avatars with
 Loder.load() and I see the loading progress by
 monitoring ProgressEvent.PROGRESS events.

 However the other events - IOErrorEvent.IO_ERROR,
 SecurityErrorEvent.SECURITY_ERROR and
 Event.INIT are never called and so I can't resize them.

 And also I get the error message in the FP10:

 SecurityError: Error #2123: Security sandbox violation:
 Loader.content: http://preferans.de/Pref.swf cannot access
 http://cs4161.vkontakte.ru/u62184775/a_9b2f2703.jpg. No policy files
 granted access.
       at flash.display::Loader/get content()
       at User/handleInit()

 Can anyone please explain what's happening to me?

 1) Why can I still load unresized images, eventhough
     my site isn't listed in crossdomain.xml?

 2) Why isn't SecurityErrorEvent.SECURITY_ERROR
    being called?

 3) Can I somehow try/catch the error message?
     I don't know where to put it around.

 I use LoaderContext(true) and even understand that
 the crossdomain.xml is mostly for situations when
 corporate users are surfing outside their intranets.
 I've read, but don't understand the Adobe doc
 http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/LoaderContext.html#checkPolicyFile
 good enough...

 My complete code is at: http://pastebin.com/m3a4732ce

 Thank you
 Alex


 ___
 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] Bizarre Issue

2009-12-15 Thread Greg Ligierko
It's hard to say...

A few questions:
- do you see all contents when you remove fading completely, i.e. when
you set 100% alpha at the beginning  ?
- did you try starting fade with alpha 50% ?
- what kind of event do you use for fading, enter frame or a
timer/interval ?
- are images loaded into the movie or are they library items or are
they bitmapdata (copied loaded images) ?
- if images are loaded, they are they completely initialized before
showing ?

From my experience disappearing mcs may be a problem with setting
their depth (that can be already occupied by other mcs or a
subsequently attached/created movie clip gets into their depth ).

Also, if alpha property of the images gets NaN, they may be invisible.

Images can be wrongly resized (width of height is NaN or 0 and the
image disappears)...

g



 Tuesday, December 15, 2009 (2:55:13 PM) Lehr, Theodore wrote:

 I have a weird issue that I will attempt to explain - if no one
 gets it and does not reply - I understand


 So I have the same MC that is used say 50 times - each on their own layer

 These MC have dynamic text boxes and images... they ALL start out with alpha 
 = 0...

 Some have their alpha changed to 100%... none the less... when the
 alpha is changed ONLY the first 23 layers show everything - layers
 24 and above only show the dynamic text - they do not show the images...

 Any reason why?? Sounds like a bug... but it very well could be me




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


[Flashcoders] What IDE on Mac ?

2009-12-14 Thread Greg Ligierko
I grown up with PC, Windows and in work I am completely happy with
FlashDevelop + CS3. For some time I am also a happy MacBook user, but
it is hard for me to swap with AS2/AS3 coding to Mac. So far I could
not establish a comfortable work environment on Mac. 

I read about two options:
- adapting Xcode to ActionSript (seems complex),
- Eclypse with ActionScript plugin.

I had no success in adapting Xcode and I did not even tried installing
Eclypse. I would like to know your opinion on which option is more
efficient and more comparable to Win based FlashDevelop + CS3 IDE. For
work, I need badly code snippets and syntax check. Runtime debugging
is not crucial for me.

Tia,
Greg

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


Re: [Flashcoders] What IDE on Mac ?

2009-12-14 Thread Greg Ligierko
Thanks a lot. I am downloading the trial in this moment.

The price of FDT Professional and Enterprise are rather high. Would
you still recommend the cheaper Pure version ? I can see it does not
support High-Speed Search and Type Hierarchy.

g

Monday, December 14, 2009 (1:13:08 PM) Steven Sacks wrote:

 FDT is pretty much your best choice.


 On 12/14/2009 3:53 AM, Greg Ligierko wrote:
 I grown up with PC, Windows and in work I am completely happy with
 FlashDevelop + CS3. For some time I am also a happy MacBook user, but
 it is hard for me to swap with AS2/AS3 coding to Mac. So far I could
 not establish a comfortable work environment on Mac.

 I read about two options:
 - adapting Xcode to ActionSript (seems complex),
 - Eclypse with ActionScript plugin.

 I had no success in adapting Xcode and I did not even tried installing
 Eclypse. I would like to know your opinion on which option is more
 efficient and more comparable to Win based FlashDevelop + CS3 IDE. For
 work, I need badly code snippets and syntax check. Runtime debugging
 is not crucial for me.

 Tia,
 Greg


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


Re: [Flashcoders] What IDE on Mac ?

2009-12-14 Thread Greg Ligierko
Thanks a lot. FDT looks impressive. I am testing the trial and seems to
be very powerful. Auto creation of props and methods is cool. What is
also important, very easy to install and set up.

g


Monday, December 14, 2009 (3:14:28 PM) Steven Sacks wrote:

 If you want to see an example of FDT in action, check out the Robot Legs Hello
 World video tutorial.  John doesn't touch the mouse once throughout the
 tutorial.  It's pretty insane how much you can do in FDT without the mouse. 
 I'm
 a die-hard FlashDevelop user and even I'm impressed.

 http://pv3d.org/2009/11/18/robotlegs-hello-world-video-tutorial/
 ___


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


Re: [Flashcoders] Back On Course, Still Problems

2009-12-09 Thread Greg Ligierko
Well... Code without braces may look a bit confusing, but that depends
on what somebody is used to and just what you like. An example when I
often bypass braces is setting default values for AS2 function
arguments: 

function funName(arg1:Number, arg2:Object):Object
{
   if(isNaN(arg1)) arg1 = 0;
   if(arg2 == null) arg2 = {};

   //... rest of code
}

This has no sense in AS3 because it provides a new syntax for setting
default values fun(arg:Number=0):void.

Another example:
function funName2(flag:Number):Number
{
   if(isNaN(flag)) return someValue;
   return someOtherValue;
}

You mention using braces without somewhere to emphasize the code. I
think it is just somebodies preference how he highlights separated
logic

Usually separated logic should be done just by writing a separate
method but when there are performance issues (calling a new method
leads to redeclaration of variables) or when this part of code sets a
group of new variables (separate method returns only one value, unless
it returns an array or object - again performance issue), this may
have sense. Still, I prefer adding a commented bar or a short limerick
instead or braces.

Greg





Wednesday, December 09, 2009 (6:18:42 AM):

 Yes, your correct.
 I always use braces.
 It looks aesthetically pleasing to me and helps me separate things.

 BTW, what is the point of braces if you dont need them, except the  
 separation of your code part.
 Are they needed in some situations over others?

 Karl




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


Re: [Flashcoders] Re:Trying to set multiple images to 'export for AS' with JSFL

2009-12-09 Thread Greg Ligierko
If you haven't seen this already:
http://code.google.com/p/fueljsfl/
There is a set of interesting JSFL scripts for various purposes. Also
manipulation of bitmap items. But I cannot bet there is the exact case.
g


Wednesday, December 09, 2009 (12:48:52 AM) napisano:

 Thanks guys.
 I found a partial solution, which is changing all bitmap names with JSFL and
 then clicking 600 times to assign a class name which by default is the
 symbol name. Easier than setting the name by hand for each symbol, but still
 a bit dumb.


 2009/12/2 Cedric Muller flashco...@benga.li

 but it isn't a MovieClip, is it ?
 A MovieClip can contain a (or multiple) Bitmaps, but a Bitmap cannot
 contain a MovieClip, so are these really the same ?
 and if you take lots of them: lots of Bitmaps are better than lots of
 MovieClips.
 ... or you can convert a MovieClip to Bitmap, but the opposite would be
 quite hard.

 But I may be caught in a landslide, and I don't know where I'll end  I
 answer without knowing what the inital question was. Pun me!


  Craig Bowman wrote:

 It's NOT a bug. A bitmap can't be assigned the attributes you want
 directly
 and never has. It must be wrapped inside a symbol, like a MovieClip.


 Not true, there is a fully working Bitmap symbol type just for this.




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


Re[2]: [Flashcoders] Back On Course, Still Problems

2009-12-09 Thread Greg Ligierko
Paul,
You are perfectly right. The case of Beno's piece:

 if (e.target.currentFrame == 40) TweenMax.to(mcHandInstance2, 2, {x:200, 
startAt:{totalProgress:1}}).reverse();

...is clearly a proof of what you say, because it already produced
confusion. 

Greg

Wednesday, December 09, 2009 (1:30:22 PM) Paul Andrews:



 Greg Ligierko wrote:
 Well... Code without braces may look a bit confusing, but that depends
 on what somebody is used to and just what you like. An example when I
 often bypass braces is setting default values for AS2 function
 arguments: 

 function funName(arg1:Number, arg2:Object):Object
 {
if(isNaN(arg1)) arg1 = 0;
if(arg2 == null) arg2 = {};

//... rest of code
 }

 This has no sense in AS3 because it provides a new syntax for setting
 default values fun(arg:Number=0):void.

 Another example:
 function funName2(flag:Number):Number
 {
if(isNaN(flag)) return someValue;
return someOtherValue;
 }
   
 The only problem with this (and yes, I have like everyone else coded 
 like that), is that it doesn't explicitly indicate the intention of the
 code.

 If the function is written as:

 if(isNaN(flag)){
 return someValue;
 } else {
 return someOtherValue;
 }

 Then the intention to return one or the other depending on the test is
 very explicit. Maybe it doesn't matter for these trivial examples, but
 the intent can be less obvious when the code is more complex.

 I think every body uses the shortcuts (me too) for conditional 
 statements, but I think often it's really bad practice and it's often 
 proven as bad practice when begginers can't debug their code because it
 looks right.

 I start off by writing.

 if (i==6) doThis();

 Well already I've messed up any visual clues about the nesting of code
 conditionals when I scan the page because my doThis() isn't indented
 equally with other conditional code.
 Lets put that right.

 if (i==6)
  doThis();

 Now the visual appearance of the code makes me instantly see that the 
 call to doThis is nested in conditional code - it's indented to the right.
 No problem, now right?

 A month later I realise there's a bug and it should really be 
 doThis();doThat() if i equals 6.

 In my hurry I now make this update:

 if (i==6)
  doThis();
  doThat();

 And it looks right, but now my code is behaving even more badly. 
 Scanning through the code doesn't give an instant clue because this wil
 be buried amongst a load of other stuff.. Only later do I realise that
 while my indents look right, the actual interpretation is:

 if (i==6)
  doThis();
 doThat();

 ..something I didn't intend.

 Now, if I was in the habit of writing my conditionals with braces and 
 indenting my code, I would be very, very unlikely to make this simple error.

 So I should habitualy write:

 if (i==6) {
  doThis();
 }

 or (depending on your own preferences)
 if (i==6)
 {
  doThis();
 }

 Then I can't go wrong when I come to add extra code:
 if (i==6)
 {
  doThis();
  doThat();
 }

 So, in essence, adding braces even when they aren't needed will make you
 less likely to make accidental mistakes in the future.

 Paul



 You mention using braces without somewhere to emphasize the code. I
 think it is just somebodies preference how he highlights separated
 logic

 Usually separated logic should be done just by writing a separate
 method but when there are performance issues (calling a new method
 leads to redeclaration of variables) or when this part of code sets a
 group of new variables (separate method returns only one value, unless
 it returns an array or object - again performance issue), this may
 have sense. Still, I prefer adding a commented bar or a short limerick
 instead or braces.

 Greg





 Wednesday, December 09, 2009 (6:18:42 AM):

   
 Yes, your correct.
 I always use braces.
 It looks aesthetically pleasing to me and helps me separate things.
 

   
 BTW, what is the point of braces if you dont need them, except the  
 separation of your code part.
 Are they needed in some situations over others?
 

   
 Karl
 




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

   

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




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


Re: [Flashcoders] Back On Course, Still Problems

2009-12-09 Thread Greg Ligierko
Using just a set of functions is not oop. It's rather procedural
programming. However it works, it is difficult to reuse or make
something really large scale or cooperate with other programmers
basing on procedural code. You can write procedural-AS3, but there is
not point of doing that. And you would have to place all library item
on the stage, name them (properties - instance name) and do stuff
with them.

Beno...
The difference is that in oop you have various classes that may (but
not necessarily) construct their instance objects. Classes have their own
methods (functions of classes) and their own properties (like
variables of classes). Any object constructed by a class has all
these methods and properties.

In AS2 and AS3 both methods and properties may be private or public
(there are more than that two in AS3, but basically let's consider
private and public).

Now you can consider a class called Dog. The class Dog has methods
startBarking() and stopBarking(). Its instance can do all that its
class define: 


 var instanceOfDog : Dog = new Dog();
//(instance name)^  (type)^   (class)^

 instanceOfDog.startBarking();

 /// and somewhere later

 instanceOfDog.stopBarking();

... and you can create another instance of Dog, but the new instance is a
completely separate object (they do not bark at once, for example).

---

Local variables are those that you create temporally in a function/method
body. Other functions/methods do not see these variables. They are
visible only in the scope of one function/method after being declared
until the function ends:

function fun1()
{
   // here nobody has seen rolf yet...
   
   var rolf:Dog = new Dog();   //of course you have to import
//your Dog class before instantiating it

   // (.) here the compiler sees rolf because has a reference to it
   // in the computer memory.
}
function fun2()
{
   // in this function (or method) nobody knows about rolf's
   // existance...
}

... I have to end here. This is a longer story. Use google to reach
tutorials about AS3 object oriented programming basics.


g


Wednesday, December 09, 2009 (4:50:44 PM) beno- wrote:

 On Wed, Dec 9, 2009 at 11:27 AM, Matt S. mattsp...@gmail.com wrote:

 On Wed, Dec 9, 2009 at 10:20 AM, beno - flashmeb...@gmail.com wrote:
  You are correct. I don't fully understand classes, although I doubt I'm
 far
  from it. I will google what you have suggested. Thank you!
 

 Didnt you say: I have many years working with python? Were you able
 to do that without touching oop or classes, beno?


 I'm ashamed to admit it, yes. I might very well be working in classes and
 what I'm doing in python could very well be oop, but I've never studied it
 as such and I obviously need to. I write all sorts of things like:

 def whatever(var, var2):
   stuff here

 and call that from other functions. If that's classes and oop, then I've
 been all over that for years. I dunno :-}

 We're OT again caution
 beno
 ___
 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] Minimizing Code: Logic Issue

2009-12-08 Thread Greg Ligierko
What kind of method do you use in findValue() to compare the
movieclips ? If you are using _name then it might be to short string:

var mc = createEmptyMovieClip(aaa,0);
trace(mc: +mc);
trace(mc: +mc._name);
trace(mc: +String(mc));

outputs:
mc: _level0.aaa
mc: aaa
mc: _level0.aaa


Maybe you could paste findValue()...



g

Tuesday, December 08, 2009 (1:35:47 PM) Lehr, Theodore wrote:

 ALSO: (and this might be impacting my results... when I used
 this.nm it did not work at all... so I took this. out and just used
 nm, while it works they are all suing the last array member

 
 From: flashcoders-boun...@chattyfig.figleaf.com
 [flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike 
 [postmas...@glenpike.co.uk]
 Sent: Monday, December 07, 2009 5:48 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Minimizing Code: Logic Issue

 Hi,

 Not sure what your findValue function does, but I am guessing you
 are looking for the name in an array of names

 Anyway, you could create an array of names that you are going to use
 and loop throught these to attach your onRollover / onRollout
 functionality.  To make if work for each clip, you can attach the
 current name to your clip so it can use it in the onRollover function,
 etc.

 Something like below might work:


 //Create your array somehow - this is just for show
 var myFiftyClips:Array = [, AAAB, ... AABX];

 var len:Number = myFiftyClips.length;  //don't have to do this if
 you don't want to...

 //Loop through the clips
 for(var i:Number = 0; i  len;i++) {

//Grab the name we are going to use
var nm:String = myFiftyClips[i];

//now we can start accessing our clips using the name as an index...
_root[nm]._alpha = 0;

//Because this is AS2, you can dynamically attach properties to
 your movieclip, so assign the name as a variable of the clip so the clip
 can find it later...
_root.mc1[nm].mc2.nm = nm;

_root.mc1[nm].mc2.onRollover = function() {
   trace(Hello I am onRollover for  + this +  my name is  +
 this.nm);
   if(findValue(this.nm, arrayName) == 1) {
  //hey presto, you can still access stuff!
  _root[this.nm]._alpha = 100;
   }
}

_root.mc1[nm].onRollout = function() {
   _root[this.nm]._alpha = 0;
}
 }

 Lehr, Theodore wrote:
 OK - imagine:

 _root.._alpha = 0;
 _root.mc1..mc2.onRollOver = function() {
 if (findValue(, arrayName) == 1) {
 _root.._alpha = 100;
 }
 }
 _root.mc1..mc2.onRollOut = function() {
 _root.._alpha=0;
 }


 Now, I have to repeat this code like 50 times for 50 different movies with 
 the '' being replaced by a different instance name My thought was to 
 put the 's into an array and loop through that - but as I am finding the 
 code is not called until the event (i.e. onRollOver and thus the last array 
 member is the active one... Is there anyway to minimize the code instead of 
 havign to repeat this 50 times - I am sure I am approaching this from the 
 wrong direction
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 --

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

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


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


Re: [Flashcoders] Back On Course, Still Problems

2009-12-08 Thread Greg Ligierko
I don't think, because braces are not required when the there is only
one statement ended with semicolor:

//code
if(something) doSomething(); // semicolon ends the scope here...
//code

... the second brace was ending the myLeftHand() method.


I think that that the problem with this line was that mcHandInstance2
was neither defined as a class property nor as a local variable.

I think Beno does not see difference between local variables (google:
local variables tutorial) and class properties (google: class
properties tutorial).

g

Tuesday, December 08, 2009 (10:07:34 PM) Karl DeSaulniers wrote:

 Well I know why this code was not working.

 if (e.target.currentFrame == 40) TweenMax.to(mcHandInstance2, 2,
 {x:200, startAt:{totalProgress:1}}).reverse();
  }

 Because it should read.

 if (e.target.currentFrame == 40) { TweenMax.to(mcHandInstance2, 2,
 {x:200, startAt:{totalProgress:1}}).reverse();
  }

 You missed the first {
 Don know if that fixes everything or just this line.
 Karl

 Sent from losPhone

 On Dec 8, 2009, at 1:18 PM, beno - flashmeb...@gmail.com wrote:

 On Tue, Dec 8, 2009 at 3:02 PM, Gregory Boudreaux gjboudre...@fedex.com 
 wrote:

 What is setting e in your code?


 I have no idea. This is what was suggested to me on this list once  
 upon a
 time. I presume that's the problem. The idea was to make the mc run  
 when the
 code entered a certain frame, as you can see by the commented-out  
 line and
 the trace:

  public function myLeftHand(e:Event=null):void
{
if (e.target.currentFrame == 10) { trace(yes) };
var mcHandInstance2A:mcHand = new mcHand();
addChild(mcHandInstance2A);
mcHandInstance2A.x = 800;
mcHandInstance2A.y = 200;
 //if (e.target.currentFrame == 40) TweenMax.to(mcHandInstance2, 2,
 {x:200, startAt:{totalProgress:1}}).reverse();
  }

 What should it be? How do I tie it in to the rest of the code?
 TIA,
 beno
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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


Re[2]: [Flashcoders] Back On Course, Still Problems

2009-12-08 Thread Greg Ligierko
Karl,

That is perfectly valid for AS2, for example:

for(var k in myArray) trace(val:  + myArray[k]);

...works both AS2 and AS3.

Even a combo...

if(someBoolean) for(var k in myArray) myClass(myArray[k]).doSomething();

Just one line and the semicolon ; (required).

Man can save a pair of braces for later :)

Greg


Tuesday, December 08, 2009 (11:36:17 PM):

 Greg,
 I see your point.
 I am more familiar with AS2, so oops.
 I will be migrating soon. I promise.

 Karl


 On Dec 8, 2009, at 3:50 PM, Greg Ligierko wrote:

 I don't think, because braces are not required when the there is only
 one statement ended with semicolor:

 //code
 if(something) doSomething(); // semicolon ends the scope here...
 //code

 ... the second brace was ending the myLeftHand() method.


 I think that that the problem with this line was that mcHandInstance2
 was neither defined as a class property nor as a local variable.

 I think Beno does not see difference between local variables (google:
 local variables tutorial) and class properties (google: class
 properties tutorial).

 g

 Tuesday, December 08, 2009 (10:07:34 PM) Karl DeSaulniers wrote:

 Well I know why this code was not working.

 if (e.target.currentFrame == 40) TweenMax.to(mcHandInstance2, 2,
 {x:200, startAt:{totalProgress:1}}).reverse();
  }

 Because it should read.

 if (e.target.currentFrame == 40) { TweenMax.to 
 (mcHandInstance2, 2,
 {x:200, startAt:{totalProgress:1}}).reverse();
  }

 You missed the first {
 Don know if that fixes everything or just this line.
 Karl

 Sent from losPhone

 On Dec 8, 2009, at 1:18 PM, beno - flashmeb...@gmail.com wrote:

 On Tue, Dec 8, 2009 at 3:02 PM, Gregory Boudreaux  
 gjboudre...@fedex.com
 wrote:

 What is setting e in your code?


 I have no idea. This is what was suggested to me on this list once
 upon a
 time. I presume that's the problem. The idea was to make the mc run
 when the
 code entered a certain frame, as you can see by the commented-out
 line and
 the trace:

  public function myLeftHand(e:Event=null):void
{
if (e.target.currentFrame == 10) { trace(yes) };
var mcHandInstance2A:mcHand = new mcHand();
addChild(mcHandInstance2A);
mcHandInstance2A.x = 800;
mcHandInstance2A.y = 200;
 //if (e.target.currentFrame == 40) TweenMax.to 
 (mcHandInstance2, 2,
 {x:200, startAt:{totalProgress:1}}).reverse();
  }

 What should it be? How do I tie it in to the rest of the code?
 TIA,
 beno
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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

 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com

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


--

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


Re: [Flashcoders] Back On Course, Still Problems

2009-12-07 Thread Greg Ligierko
Beno, Jason mentions trace. This one is really essential.

You can use trace inside any part for code, it is inside methods or
directly in frame code. Add these trace lines to your code and start
playing with them:

public function Main():void
{
   trace(Who I am ? I must be:  + this);

   trace(The following are my properties... );
   for(var k in this)
   {
 trace(   + k +  has value  + this[k]);
   }
   trace(That's all nice. Perhaps somebody calls now the init() method.);

   // probably you need to call init() here..
}
public function init():void
{
// if you do not see the following trace text in the output
// window, this means the init() method was never called

trace(Some part of code called init() and now I entered the the init() 
method... Let's see what we got here !);

hatAndFace();
eyeball1();
eyeball2();
myRightHand();

var mcHandInstance2:mcHand = new mcHand();

trace(We have a new instance of mcHand. Let's see its value, so 
mcHandInstance2 is  + mcHandInstance2);

addChild(mcHandInstance2)
mcHandInstance2.addFrameScript(20, myLeftHand)
//

}

Now... instead of using the addFrameScript(), try this, step by step:
- doubleclick the mcHand (or whatever the hands name is) in the
Flash IDE Library.
- click right-click on the 20th frame of you hand animation and select
- press F9 (- you should see now the actions window for that 20th frame)
- write this.stop(); in the frame's code,
- go back to your .as code and comment out (//) the addFrameScript... line
- add init(); in the scope of Main() function,
- save,
- compile

In free time ... please try to press F1 in Flash IDE and just start
reading. Read about the timelines, debugging, and native classes that
you will like to use in your work. Try Help examples. Analyze them.
Pay particular attention to chapters:
1. Using Flash
2. Programming ActionScript 3.0
3. ActionScript 3.0 Language and Components Reference

Most issues you are asking about are described in a detailed way
there just in the Flash Help. Google is another really powerful option
to get into Flash in general and AS3 in particular.


Greg




Monday, December 07, 2009 (5:43:37 PM) Jason Merrill wrote:

 Well gee after that intro, let me jump all over helping you.  You should
 know people here are volunteering their free time and that's the price
 you pay when someone offers to help for free.  For free.  Free that is.
 I saw a LOT of people here trying to help you over the past few weeks,
 you had some threads that frankly, went on annoyingly long, and several
 things were Google-able.  

 I don't see any traces in your code, you might start by using the trace
 feature to see if things like this statement:  if
 (e.target.currentFrame == 40) even runs before bothering the list with
 your question.  Heck, put some traces inside of  myLeftHand to see if
 it runs.  I have no idea why you're inserting frame scripts, I don't
 have any history on what your reasons for that is, so if you're going to
 re-post and ask questions again, start by clearly explaining your
 problem, and above all, play nice.

 Jason Merrill 

  Bank of  America  Global Learning 
 Learning  Performance Soluions

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






 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of beno -
 Sent: Monday, December 07, 2009 11:30 AM
 To: Flash Coders List
 Subject: [Flashcoders] Back On Course, Still Problems

 Hi;
 First, a bit of a rant. A lister here offered to help me by looking
 directly
 at my code and resolving my problem. That was 10 days ago. I was
 patient. I
 kept in touch with him. He kept saying he'd get to it. He never did. The
 result is that I am now 10 days further behind on a project I'm now 2.5
 months behind on. The moral of the story is that if you're not sincerely
 going to help, do not offer to help, because you're just creating even
 more problems.

 Ok, I tried googling wherever we were on this without success, so I'm
 starting where I knew the problem was. Here is an abbreviated version of
 my
 code:

 package
 {
  import flash.events.Event;
  import flash.events.MouseEvent;
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
   {
   public var mcHandInstance2:mcHand;
   public function Main():void
 {
   }
   public function init():void {
 hatAndFace();
 eyeball1();
 eyeball2();
 myRightHand();
 var mcHandInstance2:mcHand = new mcHand();
 addChild(mcHandInstance2)
 mcHandInstance2.addFrameScript(20, myLeftHand)
 //myLeftHand();
   }
   private function myLeftHand(e:Event=null):void
 {
 var mcHandInstance2:mcHand = new mcHand();
 

Re[2]: [Flashcoders] Still Infinitely Looping

2009-11-26 Thread Greg Ligierko
Few words defending enterframe...

AS1 required manual initialization of broadcaster objects while
Movieclip events where simple: on(release), on(enterframe)...

AS2 provides EventDispatcher class. Using it may be considered as
somehow more advanced technique. 
But AS2 still allows using such shortcuts as:
- mc.onPress=function(){...}
- mc.onReleaseOutside=function(){...}
- mc.onEnterFrame=function(){...}
... which is very handy, simple to understand and follow; not only
for beginners. 

AS3 forces all coders, including beginners to use events listening for
most user interaction cases, mouse clicks, key pressing and also
(user independent) controlling animation progress. Perhaps that is how
Adobe understood good practices and I wouldn't ever like to discuss
whether it's cool or not cool. Some criticize this approach as
favoring experienced coders.

Anyway, in my opinion handling enter_frame should not be
considered as a kind of sorcery/voodoo, particularly when somebody
wishes to learn more that drawing figures on the stage.

I think that with the release of AS3, controlling events dispatching
and listening becomes a rather basic and essential skill for a coder.
Sooner or later, Beno has to start using them (rather sooner).

Beno - a step by step tutorial for simple frames control with
enterframe:
http://www.bellaonline.com/articles/art54385.asp

*
I do not argue that adding code to stage is handy. It is a lot and I
am adding stop() very often to stop hand-made animations at some
point. But it is a shortcut that should be used (often) when somebody
is more familiar with the area. 

Greg



November 25, 2009 (10:20:45 PM) Karl DeSaulniers wrote:

 You could do the stop frame in script.

 If(mc._currentfame == 20) {
 this.mc.stop();
 }

 But listen to them about the enterFrame. I learned the hard way too  
 and what they are telling you is the right way and best way for you.
 GL

 Karl

 Sent from losPhone

 On Nov 25, 2009, at 2:57 PM, Paul Andrews p...@ipauland.com wrote:

 beno - wrote:
 On Wed, Nov 25, 2009 at 3:36 PM, Barry Hannah ba...@shift.co.nz  
 wrote:


 Try:

 public function myLeftHand(e:Event=null):void {
   //
 }


 The myLeftHand method is being called when an event fires, so the  
 event
 must be passed in as a method parameter. Event=null allows the  
 event
 to be optional - so you could also call it without dispatching an  
 event.



 This worked.

 Yes, but just be aware that this technique works for this case, but  
 would make your code more complex if your event handling function  
 actually used the event parameter. Personally I would avoid this  
 technique for event handlers.

 Whomever told you to use enterframe to have something happen on  
 frame 20
 made a mistake. It's a valid way to get it working, I personally  
 think
 an enterframe loop is a waste of resource for that case and, more
 importantly, I just don't think you're there yet. Go back to  
 putting an
 action on the timeline at frame 20.



 You have a good point, of course. But I am going to do this anyway.  
 I will
 be calling this mc many times. Besides, I firmly believe that the  
 right
 way to do this is calling the event as I enter frames.
 It's not the right way for this situation.

 Enterframe operations are expensive. The more code that the flash  
 player is executing the greater the load on the processor. For the  
 trivial example that you have, it doesn't matter, but generally  
 think hard if enterframe is the right solution.

 In this case you are needlessly watching a movieclip to stop it at  
 frame 20, when you could simply add a stop action to the timeline.  
 Since that's all that you need to have the movieclip do, there's  
 utterly no point in making life complicated for no reason. If you  
 had a sophisticated behaviour (say stopping the movieclip at an  
 arbitrary frame), I might have some sympathy with the approach, but  
 otherwise it's complication for no reason. I have used the technique  
 on imported MovieClips that I have no access to, so it's a useful  
 technique but totally unnecessary here.

 In programming in general and flash in particular, simplicity is  
 preferable to complexity. Only make things as complex as they need  
 to be for the job and no more. There is a much mentioned anagram:  
 KISS - Keep It Simple Stupid, which makes the point most eloquently.

 Frame 20 awaits your stop() command.

 I think you may be learning some more things about flash but may be  
 picking up bad habits already.

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


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] A variable nodemapid= makes embed gone (IE and FF)

2009-11-24 Thread Greg Ligierko
Solved... (teddy bear helped gain)

The case that made me post to the list is such a coincidence, that was
hard to reproduce on other computers.

I use freeware MacAfee for virus protection. One of its services -
McAfee Redirector Service is capable of changing HTML contents (others
than localhost). But of course not for all cases and in fact this was
the first occurrence I noticed.

So far I found that it fights out any string in embed  src=. /
containing nodemapid= variable. It strips out the whole embed tag
producing something like:

  object!-- --/object

After turning off the McAfee Red. Serv., page sources in FF and IE
(Win/Pc) look as expected; no stripping, i.e.:

objectembed src=nodemapid=/embed/object


There might be other variable names that are blocked by McAfee, so
in case of strange behavior in HTML sources, specifically related to
embedding objects, controls etc. I would suggest checking virus
scanners and related software (nothing new in this, but it is easy to
forget this direction).

Best,

Greg




Monday, November 23, 2009 (10:24:37 PM):

 Continuing... I tested my two links with Mac version of FF. Both work
 fine - no stripping embed, so the issue is probably only PC IE/FF
 related (assuming it is not my PC and only my PC).

 g


 Monday, November 23, 2009 (8:59:58 PM) Greg Ligierko wrote:

 Thanks,
 Yes I am aware of the swfObject.

 We are working on an Flash application that can be embedded from
 external hosts, by any user, and we do not like to force users to
 store additional JS, like swfObject at their hosts. Instead we prefer
 to relay on the official nested objectembed thing. I am aware of
 weakness of this solution, but this is still not the point of my mail.

 I just discovered that on my PC (both FF and IE) any page that uses
 objectembed src=...nodemapid=.//object ends up with
 stripped off embed tag.

 Of course I can  change the variable nodemapid name to something else.
 But I just would like to inspect if it is really possible, that a
 variable nodemapid can cause different behavior (i.e. stripping out
 embed under some browsers) than any other variable name.

 The small HTMLs I linked in my first mail are not meant to embed
 anything real, but just to test the nodemapid variable, which is
 driving me crazy. And possibly this is only my local computer
 behavior. I did not found anything related on google. In fact
 nodemapid gives less than 300 results ;)

 Greg



 Monday, November 23, 2009 (8:44:57 PM) Nathan Mynarcik wrote:

 Hopefully I am understanding what you are trying to do. Have you
 thought of using swfobject for your flash files? I think this would
 be the best way to handle what you are trying to do. You can then
 add your nomapid to the parameters of your flash movie and should work 
 with all browsers.

 code.google.com/p/swfobject

 --Original Message--
 From: Greg Ligierko
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flashcoders
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] A variable nodemapid= makes embed gone (IE and 
 FF)
 Sent: Nov 23, 2009 1:29 PM

 I have a strange issue with a http variable in embed tag and I would
 appreciate much if you test two links with short HTML code.

 I prepared two ultra-thin HTMLs.

 http://www.l-d5.com/sn/embed8.htm
 its source code is:
 objectembed src=nodemapid=//object

 http://www.l-d5.com/sn/embed9.htm
 its source code is:
 objectembed src=nodemapidq=//object  (note the q character)

 Now... for embed8.htm, IE7 and FF(3.5.5) show source (view page source):
 object!--  --/object   (removed embed)

 While for embed9.htm, both browsers show the expected source:
 objectembed src=nodemapidq=//object

 Safari shows full code for both files.

 Can you see this too ? Or perhaps this is some local issue of my PC ?

 Thanks,

 Greg


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


 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com




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





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


Re: [Flashcoders] addChild and Array problem

2009-11-24 Thread Greg Ligierko
I have no answer to the problem, but maybe recreating the shuffled
array manually could help. I mean creating a new array and filling its
items with a for loop + one extra item.

This is not directly related but I experienced onece wrong sorting
when using sortOn() method. I do not trust completely on array class
methods. 

g



Tuesday, November 24, 2009 (7:35:50 AM) Sajid Saiyed wrote:

 Hi,
 Not sure if this is what is causing my problem.

 I have an array called __viewsArray
 Then I created 3 new movieclips which I added to the Array.

 Like this:

 __viewsArray = new Array();
 __view1MC = new MovieClip();
 __view2MC = new MovieClip();
 __view3MC = new MovieClip();
 addChild(__view1MC);
 addChild(__view2MC);
 addChild(__view3MC);

 __viewsArray.push(__view1MC);
 __viewsArray.push(__view2MC);
 __viewsArray.push(__view3MC);

 Now, I create new instances of Loader and add them to the three viewMC's.
 .
 myLoader = new Loader();
 myLoader.name = MC;
 myLoader.load(fileRequest);
 ...
 // I am removing the code of the loader listener, but u can be
 sure that I am checking for the load event to complete here...
 ...
 __viewsArray[i].addChild(myLoader);
 .

 So far so good.
 When I loop through the __viewsArray, I can do the :

  __viewsArray[j].getChildByName(MC);

 no errors.

 Now, I decide to shuffle the array.

 So I did:

 var tempArray = __viewsArray.pop();
 __viewsArray.unshift(tempArray);

 Now when I loop through the array, I get a null object reference.

 Is it because I am shuffling the array or is it due to something else?
 Cant figure this one out :(

 Thanks for any help.
 ___
 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] Still Infinitely Looping

2009-11-24 Thread Greg Ligierko
I am not much into this topic, but ...
you do not have to drag Library instance to the stage to get into its
timeline. If you mark the item (e.g. mcHand) in the library and press
right mouse button, there is Edit (the same if you doubleclick the
item). 

As soon as you are in the edit mode of the library item, then the
only timeline you can see is an internal timeline of this item (it
is not the main timeline). You can select the first frame, press F9
(or actions) and add this.stop().

But... I don't think adding code to timeline is a good idea. I would
rather try to stop the looping tween here:

   public function rightHand():void
   {
  var mcHandInstance1:mcHand = new mcHand();
  addChild(mcHandInstance1);
  mcHandInstance1.x = 400;
  mcHandInstance1.y = 200;

  mcHandInstance1.stop(); // --- here
   }

As I mentioned, I not into this topic, so I may be completely wrong.

g


Tuesday, November 24, 2009 (7:09:56 PM) napisano:

 On Tue, Nov 24, 2009 at 8:15 AM, Paul Andrews p...@ipauland.com wrote:

 beno - wrote:

 On Sun, Nov 22, 2009 at 1:58 PM, Paul Andrews p...@ipauland.com wrote:



 Tell me about mcHand. I am expecting you to tell me that mcHand is a
 MovieClip symbol in your library. If you edit that symbol you'll find
 there
 is a timeline just for mcHand. That is the timeline I have been referring
 to, not the main timeline.




 Well, now, that's what I didn't understand! I'm not at my computer with
 Flash installed. I'll try this later. Thank you!
 beno


 Would I be right in thinking that your problem is now solved?


 No. It would be right to think that the computer I borrowed while I
 desperately try to re-establish myself after losing all my material
 possessions in the Dominican Republic and moving back to the US Virgin
 Islands broke down, and I just now have been able to get on a computer on
 which I've installed a trial version of Flash, only to discover that there
 __is_no_timeline_to_edit__ for mcHand. Such a timeline only exists, I
 believe, if one drags an instance of it onto the stage. I am trying to do
 all of this programmatically. There *is* no instance of mcHand on the stage.
 Furthermore, when I drag one on to the stage and double-click it, I see all
 the tweens that I made of it, all in 20 frames. Nonetheless, it
 __continues_to_loop_infinitely! Ag. Here's the code again:

 This on the timeline, first frame, only layer:

 var main:Main = new Main();
 addChild(main);
 main.init();
 stop();

 This in Main.as:

 package
 {
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
   {
   public function Main():void
 {
   }
   public function init():void {
 hatAndFace();
 eyeball1();
 eyeball2();
 rightHand();
 leftHand();
   }
   public function hatAndFace():void
 {
 var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
 TweenPlugin.activate([AutoAlphaPlugin]);
 addChild(mcHatAndFaceInstance);
 mcHatAndFaceInstance.x = 350;
 mcHatAndFaceInstance.y = 100;
 mcHatAndFaceInstance.alpha = 0;
 TweenLite.to(mcHatAndFaceInstance, 2, {autoAlpha:1});
   }
   public function eyeball1():void
 {
 var mcEyeballInstance1:mcEyeball = new mcEyeball();
 TweenPlugin.activate([AutoAlphaPlugin]);
 addChild(mcEyeballInstance1);
 mcEyeballInstance1.x = 380;
 mcEyeballInstance1.y = 115;
 mcEyeballInstance1.alpha = 0;
 TweenLite.to(mcEyeballInstance1, 2, {autoAlpha:1});
   }
   public function eyeball2():void
 {
 var mcEyeballInstance2:mcEyeball = new mcEyeball();
 TweenPlugin.activate([AutoAlphaPlugin]);
 addChild(mcEyeballInstance2);
 mcEyeballInstance2.x = 315;
 mcEyeballInstance2.y = 115;
 mcEyeballInstance2.alpha = 0;
 TweenLite.to(mcEyeballInstance2, 2, {autoAlpha:1});
   }
   public function rightHand():void
 {
 var mcHandInstance1:mcHand = new mcHand();
 addChild(mcHandInstance1);
 mcHandInstance1.x = 400;
 mcHandInstance1.y = 200;
   }
   public function leftHand():void
 {
 var mcHandInstance2:mcHand = new mcHand();
 addChild(mcHandInstance2);
 mcHandInstance2.x = 800;
 mcHandInstance2.y = 200;
   }
  }
 }

 Please help. Sinking fast. No money for food. Happy Thanksgiving.
 beno
 ___
 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] Still Infinitely Looping

2009-11-24 Thread Greg Ligierko
Paul,
You are right. I thought we want to stop initially...

In case of simple frame based animations I would add one method to the
Main class, triggered on ENTER_FRAME events, that would be checking
all single animations progress (their currentFrame) and then could
stop() at desired frame.

In such case mcHandInstance should be a Main class property. Probably
all other animated clips too, so all could be controlled easily from
one AS file.

Example:

package
{
 import flash.events.*;

 //...

 public class Main extends MovieClip
 {

   private var mcHandInstance1:mcHand; // -- the hand instance as Main class 
property

   public function Main():void
   {
  addEventListener(Event.ENTER_FRAME, progress);
   }

   // the controlling method...
   private function progress(evt:Event):void
   {
   if(mcHandInstance1.currentFrame == 20) mcHandInstance1.stop();

   // other animations could be controlled as well here around
   }

   //
   
   public function rightHand():void
   {
mcHandInstance1 = new mcHand();  //- removed declaration and type
addChild(mcHandInstance1);
mcHandInstance1.x = 400;
mcHandInstance1.y = 200;
  }

  //
  }
}

I understand Beno is starting his way. This code is just an example
and there are many other solutions to control animations. Adding
stop() to timeline is one of them and it is completely fine for me,
unless there are too many animations to control...

g



Tuesday, November 24, 2009 (8:03:39 PM) Paul Andrews wrote:

 Greg Ligierko wrote:
 I am not much into this topic, but ...
 you do not have to drag Library instance to the stage to get into its
 timeline. If you mark the item (e.g. mcHand) in the library and press
 right mouse button, there is Edit (the same if you doubleclick the
 item). 

 As soon as you are in the edit mode of the library item, then the
 only timeline you can see is an internal timeline of this item (it
 is not the main timeline). You can select the first frame, press F9
 (or actions) and add this.stop().

 But... I don't think adding code to timeline is a good idea. I would
 rather try to stop the looping tween here:

public function rightHand():void
{
   var mcHandInstance1:mcHand = new mcHand();
   addChild(mcHandInstance1);
   mcHandInstance1.x = 400;
   mcHandInstance1.y = 200;

   mcHandInstance1.stop(); // --- here
}
   
 I understand where you are coming from, but, if my understanding of the
 problem is correct, this won't solve benos problem.

 He needs the stop() at frame 20 of the mcHand timeline - your suggested
 code does not achieve this.

 Generally I try and put code where it is appropriate. Where I have 
 MovieClips with animation on the timeline, stop() actions are required
 to get the timeline to behave as required - in this case not to loop.

 Paul.


 As I mentioned, I not into this topic, so I may be completely wrong.

 g



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


Re: [Flashcoders] Mailing List Idea: Teddy Bear

2009-11-23 Thread Greg Ligierko
Exactly. Asking a question requires first formulating the problem.

I fight code or related problem very often, like it was a strong bad
guy that deserves a punch. Asking myself or the list simply why, why,
why... or I can't... may explain my frustration and bad feelings,
but not the problem itself. And the solution, when we got all needed
knowledge is just the mirror reflection of the problem. Heh,
philosophy ;) 

g

Sunday, November 22, 2009 (7:26:21 PM) Kerry Thompson wrote:

 Nathan Mynarcik wrote:

 I think the reason why the teddy bear idea works is because you get up and
 walk
 away from the project and think. 

 That's part of it. I've used the teddy bear technique a lot, and it forces
 me to really think through the process I'm using. I find that if I can't
 explain my problem to the bear, I don't understand it myself. Forming a
 detailed explanation has given me an aha! moment more times than I can
 remember.

 It often goes something like I do this, then this, get a return value, send
 it to this object, and get a void return... hang on... That's it! I have the
 function returning a value, but I declared the function as void. D'oh!

 If you can explain the problem in detail, you can probably fix it.

 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


[Flashcoders] A variable nodemapid= makes embed gone (IE and FF)

2009-11-23 Thread Greg Ligierko
I have a strange issue with a http variable in embed tag and I would
appreciate much if you test two links with short HTML code.

I prepared two ultra-thin HTMLs.

http://www.l-d5.com/sn/embed8.htm
its source code is:
objectembed src=nodemapid=//object

http://www.l-d5.com/sn/embed9.htm
its source code is:
objectembed src=nodemapidq=//object  (note the q character)

Now... for embed8.htm, IE7 and FF(3.5.5) show source (view page source):
object!--  --/object   (removed embed)

While for embed9.htm, both browsers show the expected source:
objectembed src=nodemapidq=//object

Safari shows full code for both files.

Can you see this too ? Or perhaps this is some local issue of my PC ?

Thanks,

Greg


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


Re[2]: [Flashcoders] A variable nodemapid= makes embed gone (IE and FF)

2009-11-23 Thread Greg Ligierko
Thanks,
Yes I am aware of the swfObject.

We are working on an Flash application that can be embedded from
external hosts, by any user, and we do not like to force users to
store additional JS, like swfObject at their hosts. Instead we prefer
to relay on the official nested objectembed thing. I am aware of
weakness of this solution, but this is still not the point of my mail.

I just discovered that on my PC (both FF and IE) any page that uses
objectembed src=...nodemapid=.//object ends up with
stripped off embed tag.

Of course I can  change the variable nodemapid name to something else.
But I just would like to inspect if it is really possible, that a
variable nodemapid can cause different behavior (i.e. stripping out
embed under some browsers) than any other variable name.

The small HTMLs I linked in my first mail are not meant to embed
anything real, but just to test the nodemapid variable, which is
driving me crazy. And possibly this is only my local computer
behavior. I did not found anything related on google. In fact
nodemapid gives less than 300 results ;)

Greg



Monday, November 23, 2009 (8:44:57 PM) Nathan Mynarcik wrote:

 Hopefully I am understanding what you are trying to do. Have you
 thought of using swfobject for your flash files? I think this would
 be the best way to handle what you are trying to do. You can then
 add your nomapid to the parameters of your flash movie and should work with 
 all browsers.

 code.google.com/p/swfobject

 --Original Message--
 From: Greg Ligierko
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flashcoders
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] A variable nodemapid= makes embed gone (IE and FF)
 Sent: Nov 23, 2009 1:29 PM

 I have a strange issue with a http variable in embed tag and I would
 appreciate much if you test two links with short HTML code.

 I prepared two ultra-thin HTMLs.

 http://www.l-d5.com/sn/embed8.htm
 its source code is:
 objectembed src=nodemapid=//object

 http://www.l-d5.com/sn/embed9.htm
 its source code is:
 objectembed src=nodemapidq=//object  (note the q character)

 Now... for embed8.htm, IE7 and FF(3.5.5) show source (view page source):
 object!--  --/object   (removed embed)

 While for embed9.htm, both browsers show the expected source:
 objectembed src=nodemapidq=//object

 Safari shows full code for both files.

 Can you see this too ? Or perhaps this is some local issue of my PC ?

 Thanks,

 Greg


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


 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com




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


Re: [Flashcoders] A variable nodemapid= makes embed gone (IE and FF)

2009-11-23 Thread Greg Ligierko
Continuing... I tested my two links with Mac version of FF. Both work
fine - no stripping embed, so the issue is probably only PC IE/FF
related (assuming it is not my PC and only my PC).

g


Monday, November 23, 2009 (8:59:58 PM) Greg Ligierko wrote:

 Thanks,
 Yes I am aware of the swfObject.

 We are working on an Flash application that can be embedded from
 external hosts, by any user, and we do not like to force users to
 store additional JS, like swfObject at their hosts. Instead we prefer
 to relay on the official nested objectembed thing. I am aware of
 weakness of this solution, but this is still not the point of my mail.

 I just discovered that on my PC (both FF and IE) any page that uses
 objectembed src=...nodemapid=.//object ends up with
 stripped off embed tag.

 Of course I can  change the variable nodemapid name to something else.
 But I just would like to inspect if it is really possible, that a
 variable nodemapid can cause different behavior (i.e. stripping out
 embed under some browsers) than any other variable name.

 The small HTMLs I linked in my first mail are not meant to embed
 anything real, but just to test the nodemapid variable, which is
 driving me crazy. And possibly this is only my local computer
 behavior. I did not found anything related on google. In fact
 nodemapid gives less than 300 results ;)

 Greg



 Monday, November 23, 2009 (8:44:57 PM) Nathan Mynarcik wrote:

 Hopefully I am understanding what you are trying to do. Have you
 thought of using swfobject for your flash files? I think this would
 be the best way to handle what you are trying to do. You can then
 add your nomapid to the parameters of your flash movie and should work 
 with all browsers.

 code.google.com/p/swfobject

 --Original Message--
 From: Greg Ligierko
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flashcoders
 ReplyTo: Flash Coders List
 Subject: [Flashcoders] A variable nodemapid= makes embed gone (IE and FF)
 Sent: Nov 23, 2009 1:29 PM

 I have a strange issue with a http variable in embed tag and I would
 appreciate much if you test two links with short HTML code.

 I prepared two ultra-thin HTMLs.

 http://www.l-d5.com/sn/embed8.htm
 its source code is:
 objectembed src=nodemapid=//object

 http://www.l-d5.com/sn/embed9.htm
 its source code is:
 objectembed src=nodemapidq=//object  (note the q character)

 Now... for embed8.htm, IE7 and FF(3.5.5) show source (view page source):
 object!--  --/object   (removed embed)

 While for embed9.htm, both browsers show the expected source:
 objectembed src=nodemapidq=//object

 Safari shows full code for both files.

 Can you see this too ? Or perhaps this is some local issue of my PC ?

 Thanks,

 Greg


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


 Nathan Mynarcik
 Interactive Web Developer
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com




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


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


[Flashcoders] Intersecting (or ovelapping) b and i in html text fields

2009-11-17 Thread Greg Ligierko
I noticed a difference in how Flash CS3 and simple HTML page parses
b and i tags.

For example:
var test2 = A B C D B E F G I H I J K /B L M N O /I P Q R S T;
txt.htmlText = test2;

Flash produces: A B C D   - regular font
E F G - bold
H I J K   - bold+italic
L M N O   - bold+italic
P Q R S T - bold

(it completely ignores the closing /B tag).

While using the same string, pure HTML produces (as we could expect):
A B C D   - regular font
E F G - bold
H I J K   - bold+italic
L M N O   - italic
P Q R S T - regular font

(clearly considers closing bold /B).


Conclusion - Flash allows nesting bi.../i/b, but does not
allow intersecting two style formatting, like b...i.../b../i
(I'm not sure if intersection is an appropriate word in this case).

Am I right here ?

g




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


Re: [Flashcoders] Intersecting (or ovelapping) b and i in htmltext fields

2009-11-17 Thread Greg Ligierko
You are all right. Mixing styles this way breaks HTML/XML hierarchy
and it's not a good idea. I am writing a piece of code that converts
[b]..[/b] and [i]..[/i] to HTML bold and italic tags. I was trying to
figure out if I should allow intersecting styles. For some reason,
browsers support this but obviously I should not.

Thanks,
Greg


Tuesday, November 17, 2009 (2:42:17 PM) Nathan Mynarcik wrote:

 Yeah, intersecting if you will, is improper HTML coding. I can't
 even think of a reason why you would want to do that...

 --Original Message--
 From: Karl DeSaulniers
 Sender: flashcoders-boun...@chattyfig.figleaf.com
 To: Flash Coders List
 ReplyTo: Flash Coders List
 Subject: Re: [Flashcoders] Intersecting (or ovelapping) b and i in 
 htmltext fields
 Sent: Nov 17, 2009 6:37 AM

 Should be like this..

 var test2 = A B C D B E F G I H I J K /i/B iL M N O / 
 I P Q R S T;

 if you want these results.

A B C D   - regular font
E F G - bold
H I J K   - bold+italic
L M N O   - italic
P Q R S T - regular font

 Karl

 On Nov 17, 2009, at 6:30 AM, Andrei Thomaz wrote:

 intersection is not correct HTML, right?



 On Tue, Nov 17, 2009 at 10:03 AM, Greg Ligierko gre...@l-d5.com  
 wrote:

 I noticed a difference in how Flash CS3 and simple HTML page parses
 b and i tags.

 For example:
 var test2 = A B C D B E F G I H I J K /B L M N O /I P Q R  
 S T;
 txt.htmlText = test2;

 Flash produces: A B C D   - regular font
E F G - bold
H I J K   - bold+italic
L M N O   - bold+italic
P Q R S T - bold

 (it completely ignores the closing /B tag).

 While using the same string, pure HTML produces (as we could expect):
A B C D   - regular font
E F G - bold
H I J K   - bold+italic
L M N O   - italic
P Q R S T - regular font

 (clearly considers closing bold /B).


 Conclusion - Flash allows nesting bi.../i/b, but does not
 allow intersecting two style formatting, like b...i.../b../i
 (I'm not sure if intersection is an appropriate word in this case).

 Am I right here ?

 g


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


Re: [Flashcoders] as3 to iphone app

2009-10-09 Thread Greg Ligierko
I wonder if Flash local connection in iPhone's environment could be
faked similarly like in this example (using Win32 API):
http://osflash.org/localconnection

Allowing bidirectional messages between Flash and a native iPhone
application could be (a tricky and still limited) overcome to the
limited access of iPhone native controls from Flash (I'm guessing).

Best,
Greg


Friday, October 09, 2009 (2:20:37 PM):

 On Thu, Oct 8, 2009 at 3:09 PM, Merrill, Jason
 jason.merr...@bankofamerica.com wrote:
  The following native device APIs and
 functionality are supported:

 MultiTouch
 Screen Orientation
 Saving images to Photo Library
 Accelerometer
 Geo-location
 Cut / Copy / Paste

 More info here:
 http://labs.adobe.com/wiki/index.php/Applications_for_iPhone


 I wonder if video streaming to FMS/Red5 will be supported too?

 Or vice versa if anyone knows a native iPhone library supporting this?

 I'd like to port a Flash app to iPhone and I need this  functionality

 Regards
 Alex
 ___
 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] Using LocalConnection to talk from AS3 file to AS2 in different domain

2009-09-18 Thread Greg Ligierko
Hi,

Two days ago I wrote (email 16.Sep [Flashcoders] allowDomain with wildcard
in the middle swf) about using System.security.allowDomain(*) inside
a file loaded into a base swf. The loaded swf, the one with wildcard
would serve as a container for further external files, potentially
incoming from any domain name but at the same time would block access
to base swf objects.

The purpose of using LocalConnection described by Kurt is
communication between virtual machines. But it seems still a more
secure way to proxy external domain swfs than using a shim file with
a wildcard (*), constantly allowing all incoming files.

Would you use LocalConnection instead of System.security.allowDomain(*)
if the issue would not be connecting between AV1 and AV2 ?
LocalConnection requires a more complex API for accessing internal
object properties than a simple System allowance, but maybe
LocalConnection is more secure at the same time... What is your
opinion ? 

Thanks,

Greg



Wednesday, September 16, 2009 (8:54:30 PM):

 Hi All,

  

 Not a question here, but I wanted to share something that was fairly obscure
 in the help docs.

  

 If you are using LocalConnection to talk to an as2 swf from an as3 swf you
 have to do some things differently than you might expect.

  

 Knowing this can really help in trying to completely unload a loaded as2
 swf.  For instance, you could change the test function to help you the
 loaded as2 swf unload itself.  If you don't successfully do this, things get
 messy quick (memory leak, sound won't stop etc..).

  

 Basic sample code below (hopefully this can help someone in the future).

  

 Kurt

  

 __

  

 Sending swf code (AS3)

  

 var AVM_lc:LocalConnection = new LocalConnection();

  

 // loader loads AVM1 movie

 var loader:Loader = new Loader();

 loader.load(new URLRequest(http://www.yourdomain.com/ as2_receiving.swf));

 addChild(loader);

  

 loader.addEventListener(MouseEvent.CLICK, testfunction); //just to initiate
 test..

  

 function testfunction(event:MouseEvent):void 

 {

 AVM_lc.send(_AVM2toAVM1, receivingfunction);  //IT IS CRUCIAL to add
 the underscore!! (for more info read about superdomains).

 }

  

 AVM_lc.addEventListener(StatusEvent.STATUS,onConnStatus)

 function onConnStatus(event:StatusEvent):void

  {

  switch (event.level)

   {

case status:

 trace(LocalConnection.send() succeeded);

 break;

 case error:

 trace(LocalConnection.send() failed, event)

  break;

   }

  }

  

  

 

  

  

 Receiving swf (AS2):

  

 var AVM_lc:LocalConnection = new LocalConnection();

 AVM_lc.client = this;

 AVM_lc.allowDomain = function ( domain )

 { 

 trace(allow domain called!!)  //You can specify that only
 specific domains are allowed.  In this case I'm allowing ALL domains.

 //Note;  in AS3 code you could just say
 AVM_lc.allowDomain(*);

 return true;

 } 

  

 // stopAnimation event handler

 AVM_lc. receivingfunction = function()

 {

 trace(success);

 }

  

 AVM_lc.connect(_AVM2toAVM1); //Again - the underscore is crucial.

  

  

  

 ___
 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