List Info

Thread: Re: haXe Website




Re: haXe Website
country flaguser name
France
2008-05-09 08:33:18
Niels Wolf a écrit :
>> One project in the works
> 
> Whats your ide of choice for haxe then? Don't tell me
its emacs! ;)
> 
> n

Please don't start a flaming thread about IDEs comparative
advantages ;)
The list of supported IDEs is available on the haXe website
: 
http://haxe.org/com/ide .
I'm personally using FlashDevelop.

Nicolas


_______________________________________________
osflash mailing list
osflashosflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org

Class definitions
user name
2008-05-09 10:50:10
Hey.

I am looking into following scenario:

SWF A loads other SWF B.

A defines class C.
B defines class C.

If B calls on C it gets C from A!

example:

B.swf
package{
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    
    public class C extends Sprite{
        private var variable:String = "I am C from
B";
        
        public function C(){
            trace(variable);
            var txt:TextField = new TextField();
            txt.text = variable;
            addChild(txt);
        }
        
    }
}

A.swf
package{
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    
    public class C extends Sprite{
        private var variable:String = "I am C from
A";
        
        public function C(){
            trace(variable);
            var txt:TextField = new TextField();
            txt.text = variable;
            addChild(txt);
            
            var loader:Loader = new Loader();
            loader.load(new URLRequest("B.swf"));
        }
        
    }
}

RUN A.swf outputs:
I am C from A
I am C from A
I am C from A
I am C from A
...


Even as it sounds natural it implies mayor restrictions if
your project
requires nested swf loading.

Is there a way to seal class definitions from each other but
not objects (as
the nested swfs have to talk to each other.. Though
localconnection could be
an awkward answer).

Comments are welcome.

Thanks

n


_______________________________________________
osflash mailing list
osflashosflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org

Re: Class definitions
country flaguser name
Hungary
2008-05-09 11:08:23
See the second parameter of Loader's load() method, which is
a
LoaderContext object - its applicationDomain property
controls how
classes will be arranged between the loader and the loadee.

  Attila

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=
From:    Niels Wolf <niels.wolfmediacatalyst.com>
To:      Open Source Flash Mailing List <osflashosflash.org>
Date:    Friday, May 9, 2008, 5:50:10 PM
Subject: [osflash] Class definitions
--====----====----====----====----====----====----====----==
==----====----===--
Hey.

I am looking into following scenario:

SWF A loads other SWF B.

A defines class C.
B defines class C.

If B calls on C it gets C from A!

example:

B.swf
package{
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    
    public class C extends Sprite{
        private var variable:String = "I am C from
B";
        
        public function C(){
            trace(variable);
            var txt:TextField = new TextField();
            txt.text = variable;
            addChild(txt);
        }
        
    }
}

A.swf
package{
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    
    public class C extends Sprite{
        private var variable:String = "I am C from
A";
        
        public function C(){
            trace(variable);
            var txt:TextField = new TextField();
            txt.text = variable;
            addChild(txt);
            
            var loader:Loader = new Loader();
            loader.load(new URLRequest("B.swf"));
        }
        
    }
}

RUN A.swf outputs:
I am C from A
I am C from A
I am C from A
I am C from A
...


Even as it sounds natural it implies mayor restrictions if
your project
requires nested swf loading.

Is there a way to seal class definitions from each other but
not objects (as
the nested swfs have to talk to each other.. Though
localconnection could be
an awkward answer).

Comments are welcome.

Thanks

n


_______________________________________________
osflash mailing list
osflashosflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=


_______________________________________________
osflash mailing list
osflashosflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org

Re: Class definitions
user name
2008-05-09 11:10:22
you need to use a LoaderContext when loading the swfs and set the loaded swfs ApplicationDomain to swf A's applicationDomain...look into those.



On Fri, May 9, 2008 at 8:50 AM, Niels Wolf < niels.wolfmediacatalyst.com">niels.wolfmediacatalyst.com>; wrote:
Hey.

I am looking into following scenario:

SWF A loads other SWF B.

A defines class C.
B defines class C.

If B calls on C it gets C from A!

example:

B.swf
package{
   import flash.text.TextField;
   import flash.display.Sprite;
   import flash.display.Loader;
   import flash.net.URLRequest;

   public class C extends Sprite{
       private var variable:String = "I am C from B";

       public function C(){
           trace(variable);
           var txt:TextField = new TextField();
           txt.text = variable;
           addChild(txt);
       }

   }
}

A.swf
package{
   import flash.text.TextField;
   import flash.display.Sprite;
   import flash.display.Loader;
   import flash.net.URLRequest;

   public class C extends Sprite{
       private var variable:String = "I am C from A";

       public function C(){
           trace(variable);
           var txt:TextField = new TextField();
           txt.text = variable;
           addChild(txt);

           var loader:Loader = new Loader();
           loader.load(new URLRequest("B.swf"));
       }

   }
}

RUN A.swf outputs:
I am C from A
I am C from A
I am C from A
I am C from A
...


Even as it sounds natural it implies mayor restrictions if your project
requires nested swf loading.

Is there a way to seal class definitions from each other but not objects (as
the nested swfs have to talk to each other.. Though localconnection could be
an awkward answer).

Comments are welcome.

Thanks

n


_______________________________________________
osflash mailing list
osflashosflash.org">osflashosflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org

Re: Class definitions
user name
2008-05-09 11:10:53
The simplest answer - use packages.

e.g.
Classes for SWF A should be in package com.mediacatalyst.a
Classes for SWF B should be in package com.mediacatalyst.b

Without using packages - In AS3/AVM2, you can use different
applicationDomains to separate that sort of thing, but then
if you do
so it's difficult to talk between the movies at all.

HTH,
  Ian


On Fri, May 9, 2008 at 4:50 PM, Niels Wolf
<niels.wolfmediacatalyst.com> wrote:
> Hey.
>
>  I am looking into following scenario:
>
>  SWF A loads other SWF B.
>
>  A defines class C.
>  B defines class C.
>
>  If B calls on C it gets C from A!
>
>  example:
>
>  B.swf
>  package{
>     import flash.text.TextField;
>     import flash.display.Sprite;
>     import flash.display.Loader;
>     import flash.net.URLRequest;
>
>     public class C extends Sprite{
>         private var variable:String = "I am C from
B";
>
>         public function C(){
>             trace(variable);
>             var txt:TextField = new TextField();
>             txt.text = variable;
>             addChild(txt);
>         }
>
>     }
>  }
>
>  A.swf
>  package{
>     import flash.text.TextField;
>     import flash.display.Sprite;
>     import flash.display.Loader;
>     import flash.net.URLRequest;
>
>     public class C extends Sprite{
>         private var variable:String = "I am C from
A";
>
>         public function C(){
>             trace(variable);
>             var txt:TextField = new TextField();
>             txt.text = variable;
>             addChild(txt);
>
>             var loader:Loader = new Loader();
>             loader.load(new
URLRequest("B.swf"));
>         }
>
>     }
>  }
>
>  RUN A.swf outputs:
>  I am C from A
>  I am C from A
>  I am C from A
>  I am C from A
>  ...
>
>
>  Even as it sounds natural it implies mayor
restrictions if your project
>  requires nested swf loading.
>
>  Is there a way to seal class definitions from each
other but not objects (as
>  the nested swfs have to talk to each other.. Though
localconnection could be
>  an awkward answer).
>
>  Comments are welcome.
>
>  Thanks
>
>  n
>
>
>  _______________________________________________
>  osflash mailing list
>  osflashosflash.org
>  http://osflash.org/mailman/listinfo/osflash_osflash.org
>

_______________________________________________
osflash mailing list
osflashosflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )