0 Replies Latest reply on Oct 4, 2010 8:56 PM by ogre11

    swf behaves very differently on mac and windows

    ogre11

      swf runs swimmingly on in Windows, screws up on mac.

       

      I've been passing an fla back and forth with a designer. When I run the swf on my Windows 7 machine at home it works perfectly, but when we run it on his OSX machine it screw up.

       

      The main issue revolves around a couple parts that rely on a event listener. It almost seems like when it runs in OSX the event doesnt always fire?

       

      Initially he had CS3, but upgraded to CS5 and the same problems stayed. Any known problems like this? Crossposting this in the Adobe forums as well.

       

      here's the code that sets the listener (sorry for the formatting, it was this or crazy wide from working on a wide screen monitor)

       

       

      trace("========================");
      var portLoader:Loader = Loader(parent.parent['portLoader']);

       

      var theSite:MovieClip;

       

      portLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
                                              function(e:Event)
      {
      theSite = MovieClip(Loader(parent.parent['portLoader']).content);

       

      trace('the site is ' + theSite.name);

       

      var theNav = theSite['customNav'];

       

      theNav.addEventListener('draw',onRedraw);
      }
      )
      trace("========================");

       

      var redrawingNav:Boolean = false;

       

      function onRedraw(e:Event)
      {
          trace('redraw');
          redrawingNav = false;
      }

       

       

      and here's the code that throws the event- just a function that draws a set of thumbnails by looping over some xml and creating a bunch of custom classes. There's nothing there that would cause the function to return before the event is dispatched.


      public function draw():void
              {
                  //var images:XMLList = album.children();
                  var images:XMLList = xml.album[currentAlbum].img;
                  var album:XML = xml.album[currentAlbum];//new XML(xml.album[0]);
                  var curPos:int = 0;
                 
                  if(numChildren > 0)
                  {
                      for(var xx:int = numChildren - 1; xx >= 0; xx--)
                      {
                          removeChildAt(xx);
                      }
                  }
                  for(var i:int = 0; i < images.length(); i++)
                  {
                      var image:XML = new XML(images[i]);
                     
                      //trace(album.attribute('tnPath') + image.attribute('src'));
                     
                     
                     
                      var tnPath:String = image.attribute('tn').length() == 0 ?
                                              album.attribute('tnPath') + image.attribute('src') : album.attribute('tnPath') + image.attribute('tn');
                                             
                      //trace(album);
                      var imageShell:SSPCustomNavThumb = new SSPCustomNavThumb(tnPath,getThumbProperties());
                     
                      if(navOrientation == 'vertical')
                      {
                          imageShell.y = curPos;
                          curPos += getThumbProperties().height + thumbMargin;
                      }
                      else
                      {
                          imageShell.x = curPos;
                          curPos += getThumbProperties().width + thumbMargin;
                      }
                     
                      //events and such
                      imageShell.useHandCursor = true;
                      imageShell.buttonMode = true;
                      imageShell.addEventListener('click',onImageClick);
                      addChild(imageShell);
                  }
                 
                  dispatchEvent(new Event(SSPCustomNav.DRAW));
              }