[Flashcoders] How to set children to null? Mysterious garbage collector question

2009-09-16 Thread ktt
Hello,

I'm removing children of movieclip with:

var count:int = myroot.numChildren;

for (var i:int=0; icount; i++) {
  
 myroot.removeChildAt(0);
}

How to set children to null?
All children have listeners, do I need to remove(set to null) them as well?

It seems memory managing process is not very well documented..

Regards,
K



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


RE: [Flashcoders] Loading local files with query strings

2009-09-16 Thread Jim Hayes
That's what you'd expect with *local* files, e.g. loading from a filesystem.
The filesystem will look for the file with the literal filename 
my_swf.swf?id=33.
A web server, on the other hand, knows that anything after ? is not part of 
the filename, and should be treated as a query string.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Álvaro Saraiva
Sent: 14 September 2009 19:17
To: Flash Coders List
Subject: [Flashcoders] Loading local files with query strings

Hi everyone,
I have a strange problem loading external assets from local files with 
Loader() Class in AS3.
If i use query string in the file name, the asset don't loads.

This code doesnt load the swf file inside a class
this.mySWFLoader = new Loader();
this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, 
displaySwfContainer );
this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33));

if i dont use the '?id=33' it works.

Any suggestions?
Thanxs in advance,
Álvaro




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

__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__

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


[Flashcoders] allowDomain with wildcard in the middle swf

2009-09-16 Thread Flashcoders
Hi,

Flash security issues differ depending on scenario. Adobe
documentation for allowDomain bases mostly on couples (two
interconnected swfs). I am thinking on using three separated files;
two of them stored at myDomain.net and one external at some
EXTERNAL.net. 

I would like to know your opinion on how secure could be using
allowDomain with a wildcard * in a loaded swf file, which allows
loading potentially any movie/swf from any external domains.

The intention is creating a proxy swf file that implements a set of
methods (a simple interface) that allows movies from external domains
getting pieces of information from the MAIN movie but does not allow
accessing MAIN objects/methods/properties directly. All of this kept
in Flash, with no external scripting and cross-domain policy files.


The situation looks like the following:


myDomain.net |   EXTERNAL.net
   -
 |
  A  B  C
MAIN. swf   loads  - PROXY .swf   loads  - Some.swf
into M1into M2


A:B:
has object O1 uses allowDomain(*)
O1.name=Smith
  has mc M2
has mc M1 M2 is container
M1 is container   for C (Some.swf)
for B (PROXY.swf)
  has method FUN1
  FUN1 returns O1.name

  has method FUN2
  FUN2 returns O2.name

  has object O2
  O2.name=Moore


/There is no cross-domain.xml/
  

I have tested that:
* From movie C, there is accessible only the method FUN1 (from B - our
proxy), which returns a string Smith, FUN2 (returning Moore) and
the object O2.
* Movie C cannot access A (MAIN.swf) objects and methods, like O1 or
M1 despite of the allowDomain(*) in movie B.
* I tried using array notation in the external C, like _root[O1].
This returns undefined.
* I tried a for..in loop on _root props from C - no results.
* If a method e.g. FUN3 in B would try to return an object from the
main A, e.g. O1, then the result of calling such method from C would
be undefined.
* If C tries to create a movieclip in A (_root.createEmpty...,
_level0.createEmpty...), no such movie is created.
* Ic C tries to create a movieclip in B, then it is possible, but
objects and methods from A are still not accessible from the scope of
the created movieclip.
* C cannot load any documents from myDomain, bacause there is no
cross-domain policy file.

It seems that despite of the wildcard, allowDomain(*) in B, the
external file C (Some.swf) has completely no access to A objects. At
the same time, C can access methods implemented in B, that return
basic types: string, number, boolean derived from A objects'
getters/public props/returned values; this way, we can allow external
movies C1, C2 ... Cn to get any information (at least in a serialized
fashion) about the status of the base move (MAIN.swf) objects but in a
controlled way, depending on the API implemented in B (our proxy).

Finally, the question is... is this method secure ? Are there still
ways to break from C (Some.swf) into our base movie A (Main.swf) ? It
seems that there are not, but I am no expert in Flash security and
this method can have holes. What is your opinion ?

Thanks,
Greg









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


RE: [Flashcoders] How to set children to null? Mysterious garbage collector question

2009-09-16 Thread Cor
myroot.childInstanceName.removeEventListener(Event.WhateverEvent,
whatEverFunction); 

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ktt
Sent: woensdag 16 september 2009 8:31
To: Flash Coders List
Subject: [Flashcoders] How to set children to null? Mysterious garbage
collector question

Hello,

I'm removing children of movieclip with:

var count:int = myroot.numChildren;

for (var i:int=0; icount; i++) {
  
 myroot.removeChildAt(0);
}

How to set children to null?
All children have listeners, do I need to remove(set to null) them as well?

It seems memory managing process is not very well documented..

Regards,
K



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

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


[Flashcoders] Runtime bitmap caching causing a MovieClip to not render

2009-09-16 Thread Andrew Murphy
Hello. :)
 
I've run into a strange, transient rendering error:
 
The Flash movie in question contains a MovieClip which has a gradient in it,
going from fully transparent to fully opaque black.  At run time it gets
moved and rotated over top of an image file which is also loaded at run
time, so that there is a black faded edge to the image where it goes under
the gradient.
 
This worked fine, except that every dozen or so times that the page loaded
the gradient MovieClip would fail to appear.  I've done tests to trace out
it's x, y, rotation and visible properties and there was no difference
between page loads when the gradient was visible and page loads where it
failed to appear.
 
I had thought it was a problem with a vector transparent gradient rendering
in a Flash movie which has wmode set to transparent, so I replaced the
vector gradient with a PNG file, but during additional testing it broke in
the same way.
 
I wasn't quite sure what to try next so, experimenting, I tried turning off
Use runtime bitmap caching on that MovieClip, and that appears to have
fixed it.
 
Has anyone else run into this problem?
 


Andrew Murphy
Interactive Media Specialist
 mailto:amur...@delvinia.com amur...@delvinia.com

Delvinia
214 King Street West, Suite 214 
Toronto Canada M5H 3S6

P 416.364.1455 ext. 232  F 416.364.9830  W www.delvinia.com

CONFIDENTIALITY NOTICE
This email message may contain privileged or confidential information. If
you are not the intended recipient or received this communication by error,
please notify the sender and delete the message without copying or
disclosing it.

AVIS DE CONFIDENTIALITÉ
Ce message peut contenir de l'information légalement privilégiée ou
confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par
erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en
détruire le contenu sans le communiquer a d'autres ou le reproduire.

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


Re: [Flashcoders] Runtime bitmap caching causing a MovieClip to not render

2009-09-16 Thread Karl DeSaulniers
Runtime bitmap caching is not reccomended for animation. It's trying  
to cache every step in your animation sequence. You probably  
experienced a frame or two not fully loading before it was trying to  
load the next frames in the sequence. Thus it dissapeared.


That's more of an educated guess though, so not 100% on it.

Karl

Sent from losPhone

On Sep 16, 2009, at 12:12 PM, Andrew Murphy amur...@delvinia.com  
wrote:



Hello. :)

I've run into a strange, transient rendering error:

The Flash movie in question contains a MovieClip which has a  
gradient in it,
going from fully transparent to fully opaque black.  At run time it  
gets
moved and rotated over top of an image file which is also loaded at  
run
time, so that there is a black faded edge to the image where it goes  
under

the gradient.

This worked fine, except that every dozen or so times that the page  
loaded
the gradient MovieClip would fail to appear.  I've done tests to  
trace out

it's x, y, rotation and visible properties and there was no difference
between page loads when the gradient was visible and page loads  
where it

failed to appear.

I had thought it was a problem with a vector transparent gradient  
rendering

in a Flash movie which has wmode set to transparent, so I replaced the
vector gradient with a PNG file, but during additional testing it  
broke in

the same way.

I wasn't quite sure what to try next so, experimenting, I tried  
turning off
Use runtime bitmap caching on that MovieClip, and that appears to  
have

fixed it.

Has anyone else run into this problem?



Andrew Murphy
Interactive Media Specialist
mailto:amur...@delvinia.com amur...@delvinia.com

Delvinia
214 King Street West, Suite 214
Toronto Canada M5H 3S6

P 416.364.1455 ext. 232  F 416.364.9830  W www.delvinia.com

CONFIDENTIALITY NOTICE
This email message may contain privileged or confidential  
information. If
you are not the intended recipient or received this communication by  
error,

please notify the sender and delete the message without copying or
disclosing it.

AVIS DE CONFIDENTIALITÉ
Ce message peut contenir de l'information légalement privilégiée ou
confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir r 
eçu par
erreur ce message, nous vous saurions gré d'en aviser l'émetteur et  
d'en

détruire le contenu sans le communiquer a d'autres ou le reproduire.


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


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


[Flashcoders] Using LocalConnection to talk from AS3 file to AS2 in different domain

2009-09-16 Thread Kurt Dommermuth
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


Re: [Flashcoders] Testing

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

i always use


this is a test

do not adjust your set

a






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


8,16,32

Karl DeSaulniers wrote:

Aaap ya missed 3

;)

Karl


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


1,2,4
--

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

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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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



--

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

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




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


[Flashcoders] listener (completeHandler) does n´t run after file is loaded.

2009-09-16 Thread Isaac Alves
hi list, i-m getting completely insane cause of an as3 problem.

i-ve never had this problem before.

in the code below , I try to load 2 XML files.
the first one gets loaded and the loaderCompleteHander function runs
normally after the event completion.

but the  loaderCompleteHander2 function doesn´t run at all.
the xml gets loaded, as I-ve checked with the progressListener function.
I-ve tried manythings. for example , removing all code concerning the
first xml to be loaded. or switching both xml files, tried different
codes. I-m getting insane, cause it-s something very basic.
code:

var topURLRequest:URLRequest = new URLRequest(topPath);
topLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loaderCompleteHandler);
topLoader.load(topURLRequest);

var textSlideshowReq:URLRequest = new URLRequest(textSlideshowPath);
textSlideshowLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loaderCompleteHandler2);
textSlideshowLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
progressListener);
textSlideshowLoader.load(textSlideshowReq);

private function loaderCompleteHandler2(e:Event):void
{
trace ( RU);
}

no RUN.
please help.
Isaac

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


[Flashcoders] RE: listener (completeHandler ) doesn´t run after file is loaded.

2009-09-16 Thread Isaac Alves
well, solved... though it remains a mystery that bugs me.

function progressListener (e:ProgressEvent):void
{
trace(Downloaded  + e.bytesLoaded +  out of  + 
e.bytesTotal +  bytes);
if ( e.bytesLoaded == e.bytesTotal)
{
loaderCompleteHandler2(null);
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] RE: listener (completeHandler) doe sn´t run after file is loaded.

2009-09-16 Thread Andrei Thomaz
have you tested locally only, or also online (or using localhost)?


On Wed, Sep 16, 2009 at 6:14 PM, Isaac Alves isaacal...@gmail.com wrote:

 well, solved... though it remains a mystery that bugs me.

function progressListener (e:ProgressEvent):void
{
trace(Downloaded  + e.bytesLoaded +  out of  +
 e.bytesTotal +  bytes);
if ( e.bytesLoaded == e.bytesTotal)
{
loaderCompleteHandler2(null);
 }
}
 ___
 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