Re: [Flashcoders] loadMovie from subdirectory - change base path

2008-01-30 Thread Hans Wichman
Hi,

check this out:
http://objectpainters.com/blog/2007/01/03/where-am-i-relative-paths/

The getPath things works in most cases. If you want a more complex version
that takes more things into account, you can use this:
You will need to replace the RuntimeExceptions with your own error mechanism
(eg traces, regular errors).

 /**
 * Resolves pAssetPath against pBasePath.
 *
 * - if pAssetPath is not a relative path, pAssetPath is returned (eg the
full url)
 * - if pBasePath is an empty path, pAssetPath is returned
 * - if pBasePath is a relative path, an error is thrown
 * - in all other situation a path is returned which may still be or not
valid.
 *
 * @param pAssetPath, a full or relative url
 * @param pBasePath, a full or empty url, this url MAY contain a file as
well, it is stripped automatically
 *
 */
 public static function resolve (pAssetPath:String, pBasePath:String):String
{
  //no base path
  if (pBasePath == null || pBasePath.length == 0) return pAssetPath;
  if (pAssetPath == null) {
throw new RuntimeException (
 Assetpath cannot be null.,
 Path, arguments.callee, null, null);
  }

  //file asset path
  if (pAssetPath.indexOf (http) == 0 || pAssetPath.indexOf (ftp) == 0 ||
   pAssetPath.indexOf (rmtp) == 0 || pAssetPath.indexOf (file) == 0)
return pAssetPath;
  //asset is relative, test basepath for correctness
  if (pBasePath.indexOf (http) != 0  pBasePath.indexOf (ftp) != 0 
   pBasePath.indexOf (rmtp) != 0  pBasePath.indexOf (file) != 0) {
throw new RuntimeException (
 Basepath is not null and not a full url, but needs to be either empty
or a full url.,
 Path, arguments.callee, null, null);
   }

  //so now we know that pAssetPath is a relative url and pBasePath is a full
url.
  //first normalize both urls so that we are dealing with only one type of
separator
  var lAssetPath:String = pAssetPath.split(\\).join(/file://%22).join(%22/
);
  var lBasePath:String = pBasePath.split(\\).join(/file://%22).join(%22/
);
  //strip everything after ? to strip parameters from basepath
  if (lBasePath.indexOf(?)  -1) {
   lBasePath = lBasePath.substr (lBasePath.lastIndexOf(?));
  }
  //check if basepath ends with /, if not check if everything after /
contains a .
  //if it ends with / it is a directory, if it doesnt end with / and
everything after contains a . we assume
  //we are dealing with a file, otherwise a directory
  if (lBasePath.charAt (lBasePath.length-1) != /) {
   //and the last part contains a . cut it off
   var lLastDir:String = lBasePath.substr (lBasePath.lastIndexOf(/));
   if (lLastDir.indexOf (.) != -1) {
//dealing with file
lBasePath = lBasePath.substr (0, lBasePath.lastIndexOf(/)+1);
   } else {
//assume the last part was a dir and the trailing slash was forgotten,
so add it
lBasePath += /;
   }
  }

  //at this point we have a relative url and full directory path with a
trailing /
  //now create two stacks
  var lAssetStack:Array = lAssetPath.split (/);
  var lBaseStack:Array = lBasePath.split (/);

  //remove trailing / from baseStack to provide a correct starting point,
  //our invariant is that each directory 'starts' with a slash and not ends
  lBaseStack.pop();

  //remove any superflous items (pointers to current directory
  //. points to current dir and isnt relative
  // points to double slashes or a starting slash, we remove that too
  while (lAssetStack[0] == . || lAssetStack[0] == ) {
   lAssetStack.shift();
  }

  //remove .. from assetStack AND end of basestack
  while (lAssetStack[0] == ..) {
   lAssetStack.shift();
   lBaseStack.pop();
  }

  return lBaseStack.join(/)+/+lAssetStack.join(/);
 }

Usage eg:
xml.load (Path.resolve (assets/config.xml), _clip._url));

greetz
JC


On Wed, Jan 30, 2008 at 6:24 AM, Deepanjan Das [EMAIL PROTECTED]
wrote:

 Hi,
 You need to keep duplicate files if you want it to work as single and also
 when loaded from main movie.
 Easiest way is to create an xml directory at the place where the main
 movie
 resides and set the path as xml/1.xml

 also copy this directory in the screens directory

 so ths ame path will work for both :)
 Hope this helps

 Deepanjan Das

 On Jan 30, 2008 10:10 AM, confusticate and bebother these dwarves! 
  [EMAIL PROTECTED] wrote:

  Hello Flashcoders,
 
  I'm trying to make a main movie (controller.swf) that loads other
 movies
  (screen1.swf, screen2.swf, etc), which are stored in a subdirectory
  called screens.
 
  In controller.swf I'm using loadMovie(screens/screenx.swf) to load the
  movies from the screens subdirectory, and this works fine. But the
  problem
  is that the movies in the screens subdirectory often reference XML
 files
  (which also live in the screens subdirectory). All works well when you
  play the individual screenx.swf files, obviously, but when you play
  controller.swf, it is looking for the XML files in the same directory as
  itself (one directory up).
 
  How can I fix this problem so that playing controller.swf works fine, as
  well as 

Re: [Flashcoders] how to return in this function

2008-01-30 Thread Leonardo Scattola - New Vision srl

Claudio M. E. Bastos Iorio ha scritto:

Hi guys, hope you can help me on this one.

I have a class to load an XML file. I'm trying this:
  

As Eric said, remember that the Event class is your friend.

You will want to manage any asynchronous procedure (such as Remoting, 
XML parsing, NetConnection responders and millions of other features) 
by launching and listening to a couple of Events.

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


RE: [Flashcoders] mc code still runs after being removed...Huh?!?

2008-01-30 Thread Sunil Jolly
Hi Boyd,

I don't fully understand your example. Does this article help at all?
http://gskinner.com/blog/archives/2006/07/as3_resource_ma_1.html

Sunil

-Original Message-
From: BOYD SPEER [mailto:[EMAIL PROTECTED] 
Sent: 29 January 2008 18:06
To: Flash Coders List
Subject: [Flashcoders] mc code still runs after being removed...Huh?!?

Another problem:
code from a movieclip that has been removed from the DisplayList with
removeChild(sparkle) and then nulled by using sparkle= null or
sparkle = void .

how can I turn off the repetition of the try-catch code (which tells the
main class to kill sparkle) after the clip should be totally out of
the movie?

Thanks
-Boyd
 


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


[Flashcoders] Bundle swf's on server for transport to client

2008-01-30 Thread Gert-Jan van der Wel
Hi list,

I'm working on the Flash app of
Floorplannerhttp://www.floorplanner.com/tryit/ and
we are having some problems with the loading of all the swf's. The Flash app
(AS2) consists of 1 main app that loads several forms (the windows you see,
like the library). The library holds a lot of furniture elements, which are
separate swf's that are loaded one by one.


When someone creates a floor plan and adds furniture to it, it's not strange
that the design holds more than 50 furniture
elementshttp://www.floorplanner.com/vyy1fm/Verdieping/Lekkeeerrr.
Though all elements are small swf files, it takes a lot of time to handle
all resource requests on our server. So my question is: is there a technique
that makes it possible to (dynamically) bundle a set of swf's on the server
and transport it to the client?

Right now I'm testing with swfmill and it looks promising, but it seems a
little buggy...


I hope someone can help me out and point me in the right direction.

Cheers,
Gert-Jan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Animating sprite.graphics.lineTo

2008-01-30 Thread Kenneth Kawamoto

Any straight line can be described as this simple equation: y = ax + b

If you have the starting point (x1, y1) and the end point (x2, y2), it's 
easy to work out two constants a and b.


The beauty of TweenLite is you can tween any property of any object 
(thanks Jack!). In this case you will create an Object (let's call it 
v) with a property x, which you tween from x1 to x2.


Then onUpdate, you just do lineTo(v.x, a * v.x + b). Simple.

Sorry if this is already answered (I'm on digest).

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


Tried on another Flash  list without any luck, so I'll try here.

I'm trying to see if there is a way to combine TweenLite and the draw
functions (i.e. sprite.graphics.lineto) to slowly draw a line from point
A to point B. Maybe there isn't, but I thought I would ask.  


Is it possible or would it have to be accomplished instead by drawing
slowly from point A to a point approaching B, then clearing, drawing
further, then clearning, etc. until the endpoint is reached? I'd like
to avoid that because it's 1) kludgy, 2) processor intensive, 3) time
consuming to code, 4) does not use easing (easily anyway), and 5) would
not look smooth. Any thoughts?

Oh, and any method suggested has to be done dynamically with the draw
API, not a timeline solution, since this is in regards to rendering a
dynamic graphic.  Thanks.



Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 


Bank of America Flash Platform Developer Community

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


RE: [Flashcoders] Animating sprite.graphics.lineTo

2008-01-30 Thread Mendelsohn, Michael
Jason,

I recently put together a bar chart, rendered entirely by code in AS2,
where the points must be connected by a line.  I draw the entire line
(which might look like a profile of the Rocky Mountains) in one mc, and
set a mask over it in another mc.  I use the tween class on the _width
property of the mask mc, and tween it from a width of 0% to 100%.  It
worked out great.  With the tween class, I could control the duration of
the time it took to draw out the line.  The key is that the complete
line is plotted out only once.  Email me offlist if you want to see it.

Michael Mendelsohn at fmglobal period com

- Michael M.


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


[Flashcoders] How to call class method from a movieclip?

2008-01-30 Thread Irene Johansson
Hello!
I am having a big problem, hope someone can help me.

I have made a class which i import in my flash file. The first and only
frame of the file looks like this:

import myClassFolder.*;
var myClassInstance:myClass = new myClass(this.stage);
stop();

Inside the class i am attaching a movieClip from a library and declaring a
methof:

public class myClass extends Sprite{
var contentMCs:MovieClip = new contentMC();
...
}
public function myMethod(){
}

The contentMC contains 8 frames, each of the frame has a movieClip.

In the frame 2 of the contentMC MovieClip i want to call myMethod of the
myClass.
Anyone who know how to do this?
Thanks in advance
Irene
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to call class method from a movieclip?

2008-01-30 Thread Andy Herrman
If you want your contentMC class to be able to call methods on your
myClass then you should probably pass the myClass instance to the
contentMC.  Basically, add a parameter to contentMC's constructor of
type myClass, and pass a reference to 'this' when you create it.
Something like this:

public class myClass extends Sprite{

  public function myClass() {
var contentMCs:MovieClip; = new contentMC(this);
  }

  public function myMethod(){
  }
}

On an unrelated note: standard practice has class names start with a
capital letter, not lowercase like you have.  It helps to
differentiate between variable names and class names.

  -Andy

On Jan 30, 2008 8:42 AM, Irene Johansson [EMAIL PROTECTED] wrote:
 Hello!
 I am having a big problem, hope someone can help me.

 I have made a class which i import in my flash file. The first and only
 frame of the file looks like this:

 import myClassFolder.*;
 var myClassInstance:myClass = new myClass(this.stage);
 stop();

 Inside the class i am attaching a movieClip from a library and declaring a
 methof:

 public class myClass extends Sprite{
 var contentMCs:MovieClip = new contentMC();
 ...
 }
 public function myMethod(){
 }

 The contentMC contains 8 frames, each of the frame has a movieClip.

 In the frame 2 of the contentMC MovieClip i want to call myMethod of the
 myClass.
 Anyone who know how to do this?
 Thanks in advance
 Irene
 ___
 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] Animating sprite.graphics.lineTo

2008-01-30 Thread Merrill, Jason
Thanks Michael, Thanks Kenneth, good ideas.

Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community



 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Mendelsohn, Michael
Sent: Wednesday, January 30, 2008 8:49 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Animating sprite.graphics.lineTo

Jason,

I recently put together a bar chart, rendered entirely by 
code in AS2, where the points must be connected by a line.  I 
draw the entire line (which might look like a profile of the 
Rocky Mountains) in one mc, and set a mask over it in another 
mc.  I use the tween class on the _width property of the mask 
mc, and tween it from a width of 0% to 100%.  It worked out 
great.  With the tween class, I could control the duration of 
the time it took to draw out the line.  The key is that the 
complete line is plotted out only once.  Email me offlist if 
you want to see it.

Michael Mendelsohn at fmglobal period com

- Michael M.


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

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


Re: [Flashcoders] How to call class method from a movieclip?

2008-01-30 Thread Kenneth Kawamoto
Looks to me your Class MyClass should be the Document class. If you 
set it as Document class, you can attach your MovieClip like this, 
because the root timeline is MyClass itself:


var contentMCs:MovieClip = new ContentMC();
addChild(contentMCs);

Then from your MovieClip, you can call MyClass function myMethod like 
this:


MyClass(parent).myMethod();

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

Irene Johansson wrote:

Hello!
I am having a big problem, hope someone can help me.

I have made a class which i import in my flash file. The first and only
frame of the file looks like this:

import myClassFolder.*;
var myClassInstance:myClass = new myClass(this.stage);
stop();

Inside the class i am attaching a movieClip from a library and declaring a
methof:

public class myClass extends Sprite{
var contentMCs:MovieClip = new contentMC();
...
}
public function myMethod(){
}

The contentMC contains 8 frames, each of the frame has a movieClip.

In the frame 2 of the contentMC MovieClip i want to call myMethod of the
myClass.
Anyone who know how to do this?
Thanks in advance
Irene

  

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


Re: [Flashcoders] How to call class method from a movieclip?

2008-01-30 Thread Irene Johansson
Thank you for your reply.
by doing this:
public class myClass extends Sprite{

public function myClass() {
var contentMCs:MovieClip; = new contentMC(this);
}

public function myMethod(){
}
}

I get this error msg: 1137: Incorrect number of arguments. Expected no more
than 0.

since contentMC is a
MovieClip that is attached from library i dont know where to define
the parameters.

Thanks for helping me
Irene



On 1/30/08, Andy Herrman [EMAIL PROTECTED] wrote:

 If you want your contentMC class to be able to call methods on your
 myClass then you should probably pass the myClass instance to the
 contentMC.  Basically, add a parameter to contentMC's constructor of
 type myClass, and pass a reference to 'this' when you create it.
 Something like this:

 public class myClass extends Sprite{

   public function myClass() {
 var contentMCs:MovieClip; = new contentMC(this);
   }

   public function myMethod(){
   }
 }

 On an unrelated note: standard practice has class names start with a
 capital letter, not lowercase like you have.  It helps to
 differentiate between variable names and class names.

   -Andy

 On Jan 30, 2008 8:42 AM, Irene Johansson [EMAIL PROTECTED] wrote:
  Hello!
  I am having a big problem, hope someone can help me.
 
  I have made a class which i import in my flash file. The first and only
  frame of the file looks like this:
 
  import myClassFolder.*;
  var myClassInstance:myClass = new myClass(this.stage);
  stop();
 
  Inside the class i am attaching a movieClip from a library and declaring
 a
  methof:
 
  public class myClass extends Sprite{
  var contentMCs:MovieClip = new contentMC();
  ...
  }
  public function myMethod(){
  }
 
  The contentMC contains 8 frames, each of the frame has a movieClip.
 
  In the frame 2 of the contentMC MovieClip i want to call myMethod of the
  myClass.
  Anyone who know how to do this?
  Thanks in advance
  Irene
  ___
  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] How to call class method from a movieclip?

2008-01-30 Thread Merrill, Jason
what is contentMC() ?  Looks like it doesn't take any arguments.  Where
is that defined?

Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community



 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Irene Johansson
Sent: Wednesday, January 30, 2008 10:54 AM
To: Flash Coders List
Subject: Re: [Flashcoders] How to call class method from a movieclip?

Thank you for your reply.
by doing this:
public class myClass extends Sprite{

public function myClass() {
var contentMCs:MovieClip; = new contentMC(this); }

public function myMethod(){
}
}

I get this error msg: 1137: Incorrect number of arguments. 
Expected no more than 0.

since contentMC is a
MovieClip that is attached from library i dont know where to 
define the parameters.

Thanks for helping me
Irene



On 1/30/08, Andy Herrman [EMAIL PROTECTED] wrote:

 If you want your contentMC class to be able to call methods on your 
 myClass then you should probably pass the myClass instance to the 
 contentMC.  Basically, add a parameter to contentMC's 
constructor of 
 type myClass, and pass a reference to 'this' when you create it.
 Something like this:

 public class myClass extends Sprite{

   public function myClass() {
 var contentMCs:MovieClip; = new contentMC(this);
   }

   public function myMethod(){
   }
 }

 On an unrelated note: standard practice has class names 
start with a 
 capital letter, not lowercase like you have.  It helps to 
 differentiate between variable names and class names.

   -Andy

 On Jan 30, 2008 8:42 AM, Irene Johansson [EMAIL PROTECTED] wrote:
  Hello!
  I am having a big problem, hope someone can help me.
 
  I have made a class which i import in my flash file. The 
first and 
  only frame of the file looks like this:
 
  import myClassFolder.*;
  var myClassInstance:myClass = new myClass(this.stage); stop();
 
  Inside the class i am attaching a movieClip from a library and 
  declaring
 a
  methof:
 
  public class myClass extends Sprite{ var 
contentMCs:MovieClip = new 
  contentMC(); ...
  }
  public function myMethod(){
  }
 
  The contentMC contains 8 frames, each of the frame has a 
movieClip.
 
  In the frame 2 of the contentMC MovieClip i want to call 
myMethod of 
  the myClass.
  Anyone who know how to do this?
  Thanks in advance
  Irene
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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


[Flashcoders] POST from within a frameset

2008-01-30 Thread Kevin Heppell
Hello,

 

I've been struggling to get POST to work from a SWF inside a frameset. 

From Googling it looks like it is a (known?) bug - but I was hoping to
try and find a workaround / more information.

 

There may have been a previous post on this but I haven't been able to
find it.

 

Can anyone help?

Thanks
Kevin

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


RE: [Flashcoders] how to return in this function

2008-01-30 Thread Claudio M. E. Bastos Iorio
Thank you guys, now I have a clearer point of view. Your responses and this
thread http://www.actionscript.org/forums/showthread.php3?t=159167 helped me
a lot. Have a nice day!



Claudio M. E. Bastos Iorio
http://www.blumer.com.ar

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Juan Pablo
Califano
Sent: Tuesday, January 29, 2008 10:37 PM
To: Flash Coders List
Subject: Re: [Flashcoders] how to return in this function

  var mivariable:retornaXML = new retornaXML();
  trace(mivariable.elXML);
  but this trace returns null, since the xml file (I think) is not loaded
  yet.

Yes, that's the problem. In Flash, xml loading is always asynchronous so the

trace line is executed immediately after the previous one, in which you 
created an instance of retornaXML; so the XML object isn't at that point 
loaded and parsed. (It would perhaps be nice to have the option of loading 
synchronously, but I digress...).

So, you'll have to listen to the COMPLETE event dispatched by the URLLoader 
and then access the xml object.

You can wrap your xml and the loading logic in a custom class as you seem to

be doing so far, but if you're just going to load the xml and the read it / 
parse it somewhere else (outside that class), in my humble opinion, the 
wrapper is pointless.

You'll end up re-dispatching the Loader events (all the events you want to 
support; the error events, and the complete event, at least, just in case 
something went wrong, and perhaps the Progress event as well) so your 
external code can handle the different scenarios. By the time you are done 
coding that, you'll find that you have a class that does almost nothing of 
use by itself; it just copies all the functionality that you already had in 
the URLLoader and XML classes out of the box. I did it a couple of times 
when I started to use AS 3.0, but I changed my approach as it didn't make 
much sense to me to have such a class. Having all that logic encapsulated in

the class that actually does something with the xml, on the other hand, 
seems like a good idea to me.

Cheers
Juan Pablo Califano

- Original Message - 
From: Hans Wichman [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Tuesday, January 29, 2008 7:30 PM
Subject: Re: [Flashcoders] how to return in this function


 seems like an item for the newbie list tbh:)

 On Tue, Jan 29, 2008 at 8:27 PM, Claudio M. E. Bastos Iorio 
 [EMAIL PROTECTED] wrote:

 Thanks for your answer. But how? Where?. I think that
 ProgressEvent.bytesLoaded, and ProgressEvent.bytesTotal could help. But
 where should I check the status?

 
 Claudio M. E. Bastos Iorio
 http://www.blumer.com.ar

  -Original Message-
 From: [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] On Behalf Of eric e. dolecki
 Sent: Tuesday, January 29, 2008 4:07 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] how to return in this function

 you could use an event to listen to, to pass the XML out of the class.

 On Jan 29, 2008 1:42 PM, Claudio M. E. Bastos Iorio 
 [EMAIL PROTECTED]
 
 wrote:

  Hi guys, hope you can help me on this one.
 
  I have a class to load an XML file. I'm trying this:
 
 
 
 
  package {
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.*;
public class retornaXML{
   private var _xml:XML;
   public function retornaXML() {
  cargarXML();
   }
 
   private function cargarXML():void {
  var loader:URLLoader = new URLLoader();
  loader.addEventListener(Event.COMPLETE, xmlLoaded);
  loader.load(new URLRequest(LocalData.xml));
   }
   private function xmlLoaded(e:Event):void {
  _xml = new XML(e.target.data);
  trace(_xml);
  //THE TRACE HERE WORKS PERFECT AND RETURNS THE XML
 
   }
   public function get elXML():XML {
  return _xml;
  //THIS RETURNS null
   }
 
}
  }
 
 
 
  I want something like this:
 
 
 
  var mivariable:retornaXML = new retornaXML();
  trace(mivariable.elXML);
 
 
 
  but this trace returns null, since the xml file (I think) is not loaded
  yet.
  What should I do?
 
 
 
  Thanks in advance.
 
  
 
  Claudio M. E. Bastos Iorio
 
   http://www.blumer.com.ar/ http://www.blumer.com.ar
 
 
 
  ___
  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] input text formatting

2008-01-30 Thread Cory Petosky
Use the defaultTextFormat property instead of setTextFormat.

On 1/29/08, Andrew Sinning [EMAIL PROTECTED] wrote:
 Yes, that's exactly what I'm going ot have to do.  This has got to be a
 BUG.  If I trace out the format.align property after a single character
 change it goes from center to null!  Then after the user replaces all of
 the text it changes to left.

 Glen Pike wrote:
  In AS3 I have to keep applying the TextFormat object to the TextField
  when it's content changes:
 
  function createText():void {
 _nameText.setSelection(0, _nameText.text.length);
 //_nameText.caretIndex = 0;
 _nameText.setTextFormat(_nameFormat);
 addChild(_nameText);
 _nameText.addEventListener(Event.CHANGE, textChange);
  }
 
 
  private function textChange(evt:Event):void {
 _nameText.setTextFormat(_nameFormat);
  }
 
  Andrew Sinning wrote:
  I'm creating an input-type TextField at runtime and setting the align
  prop of its TextFormat to 'center'.  The default text displays
  centered.  If the user edits just one character at a time the text
  remains centered.  However, if they select all of the text and then
  type something in, the align suddenly changes to 'left'.  Any idea
  what's going on?
 
  Thanks!
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Gateway URL to AMFPHP generating error...

2008-01-30 Thread Dave Mennenoh
No clue here, this just started happening - it's been working. From Flash, 
when I try and call a AMFPHP service I get an error opening URL message - 
pointing to my gateway url.
If I go to the gateway URL in FireFox I get the message: amfphp and this 
gateway are installed correctly. You may now connect to this gateway from 
Flash.
The function I am trying to call is a simple test at the moment, that does 
nothing but return true. Anyone know why calling the service would generate 
the url error, but going to the url works? This is the first time I've 
really ever had any problems with amfphp, and like I said it was working 
just a couple hours ago. I'm perplexed.


Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ 


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


Re: [Flashcoders] Gateway URL to AMFPHP generating error...

2008-01-30 Thread Glen Pike
Have you turned on debugging in the gateway? - Look in gateway.php, I 
had something the other day that bollixed my flash because I had 
disabled stuff, here is my working config:


if(PRODUCTION_SERVER)
   {
   //Disable profiling, remote tracing, and service browser
   $gateway-disableDebug();
  
   /*

   Setting these stops the gateway working in Flash
   */
   //Disables the standalone player by filtering out its User-Agent 
string

   //$gateway-disableStandalonePlayer();
  
   //Disable service description from Macromedia's service browser

 //$gateway-disableServiceDescription();

   //Disables remote tracing
 //$gateway-disableTrace();
  
   }


Try to get hold of Charles the proxy debugger, it is really good for 
watching comms between Flash  the server and you can see all your 
NetDebug messages.


Have you tried using the AMFPHP service browser to call the commands to 
see what happens.


Are you calling a gateway on http://www.domain.com/gateway.php from 
http://domain.com/flash.swf


HTH

Glen

Dave Mennenoh wrote:
No clue here, this just started happening - it's been working. From 
Flash, when I try and call a AMFPHP service I get an error opening URL 
message - pointing to my gateway url.
If I go to the gateway URL in FireFox I get the message: amfphp and 
this gateway are installed correctly. You may now connect to this 
gateway from Flash.
The function I am trying to call is a simple test at the moment, that 
does nothing but return true. Anyone know why calling the service 
would generate the url error, but going to the url works? This is the 
first time I've really ever had any problems with amfphp, and like I 
said it was working just a couple hours ago. I'm perplexed.


Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--

Glen Pike
01736 759321
www.glenpike.co.uk http://www.glenpike.co.uk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Gateway URL to AMFPHP generating error...

2008-01-30 Thread Dave Mennenoh



Try to get hold of Charles the proxy debugger, it is really good for
watching comms between Flash  the server and you can see all your
NetDebug messages.

Have you tried using the AMFPHP service browser to call the commands to
see what happens.

Are you calling a gateway on http://www.domain.com/gateway.php from
http://domain.com/flash.swf



Thanks much Glen. I use ServiceCapture instead of Charles... is Charles 
better? The service browser was working. I am doing this from the IDE right 
now... And for whatever reason it has just started working again. I'm not 
sure... I rebooted. Still no go but still fine if I went right to the URL of 
the gateway though... so I started up ServiceCapture and it just started 
working. And continues to. I got nothing...




Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ 


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


Re: [Flashcoders] How to call class method from a movieclip?

2008-01-30 Thread Steven Sacks

Jesse Graupmann wrote:
 function callMom ()
 {
trace( YOU NEVER CALL );
 }

While we appreciate your code sample, Jesse, and we're all supportive of 
you, Flashcoders isn't a surrogate for your group therapy sessions.  ;)


Steven Sacks
Flash Maestro
Los Angeles, CA
--
blog: http://www.stevensacks.net
gaia: http://www.gaiaflashframework.com


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


Re: [Flashcoders] onMetaData

2008-01-30 Thread Randy Troppmann
I don't think you can rely on metaData being called just once, but it is
easy enough to add logic to handle the metadata once only.
The nature of the metadata depends on how (and with what tool) the flv was
encoded. So the answer to your question of predictability is Yes only if
you have strict control over how the video is encoded. Otherwise, the answer
is No.

- Randy

On Jan 29, 2008 1:39 AM, strk [EMAIL PROTECTED] wrote:

 Can one rely on the assumption that onMetaData
 will be called only once for a given video loaded
 by NetStream ?

 And is the call sequence of it and other statuses
 predictable at all ?

 TIA

 --strk;

  ()   ASCII Ribbon Campaign
  /\   Keep it simple!

 ___
 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