0 Replies Latest reply on Oct 3, 2009 8:56 AM by squadjot

    ScrollRect via crossdomain = NOGO!??

    squadjot

      Hi i'm having problems setting scrollRect from a function in MovieA.swf to a movieclip in MovieB.swf. the SWFs are located on different domains.

       

      Both files has the

      Code:
      System.security.allowDomain("*")

      in top of first frame.

       

      I've made a "sketch" of what i'm doing.
      In MovieB, i have function/class:

      Code:
      var theApp = function(args:Object){
           import flash.geom.Rectangle;
           var oo:Object = this
           oo.applyScrollRect = function(){
                args.container.scrollRect = new Rectangle(0, 0, 200, 40)
                }
           }

      This works within MovieB, i can do

      Code:
      var myAppInstance = new theApp({container:someMc})
      myAppInstance.applyScrollRect()

      Works fine..

       


      Now, if i load MovieB into MovieA.swf, and then create an instance after its loaded, then it doesent work.

       

       

      Code:
      $scope = this
      myApp = new loader_mc.theApp({container:$scope.box_mc2})
           myApp.applyScrollRect()
      //I can create the instance allright, but i cannot apply scrollRect


      I wan't to do it this way!!!.. but i guess it's not possible.

       

      NOTE: if MovieB is gets loaded from SAME domain, then everything works!, so clearly, this only breaks when SWF's are in different domains. So apparently, SOME things you simply CAN NOT DO crossdomain.. no matter what security settings you apply. Is that right?..i think its crap!

       

       

      EDIT: I attached a even more simplified example.. if you'd like to test, then upload theese two swfs on different domains, and make MovieA.swf load MovieB.swf..