03-28-2011 03:18 PM - edited 03-28-2011 03:20 PM
i'm having a major WTF moment.
on the brink of completing my application, i've loaded it in the new 0.9.4 simulator only to realize that portions of the application's graphics are being rendered incorrectly. child coordinates are way off and certainly don't exhibit the same behavior while testing in ADL.
the only additional library i'm using besides pure AS3 classes is Tweener. i'm not even using QNX.
the object below is a Sprite that has a square shape graphic, texture bitmap with a "multiply" blend mode and a mask for the bitmap texture that is aligned with the square graphic. even though the texture is scaled down to be the same size as the square shape, there was often a sliver of excess bitmap - hence the mask, which works just fine.
anyway, the object also has a drop shadow that also tweens while the object's z position changes - when the object is selected it raises from the background canvas creating a 3D space.
in ADL, the object is added to the canvas by dropping straight down along the z-axis (dropping away from the viewer), becoming smaller and landing on the canvas. however, in the simulator, the object drops down from the bottom right corner of the screen. ??!!
what could be causing this? why is the difference between ADL and the Simulator so great? could something so buggy be just the simulator or should i expect the same thing on the actual device?
Solved! Go to Solution.
03-28-2011 05:50 PM
hey darkin,
thats a really strange happening esp since u arent using QNX stuff (i've ran into measurement problems in the past with those). What is the meta data for your project? is the following:
[SWF(width="1024",height="600",frameRate="30",backgroundColor="#CCCCCC")]
maybe there is problem with the sizing of the stage. lemme know good luck!
03-28-2011 06:04 PM
yes, my metadata tag is set:
[SWF(width="1024", height="600", frameRate="60", backgroundColor="#000000")]
although i plan on removing it and relying on the following for portability:
stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT;
both were set during simulator debugging.
if i recall correctly, i didn't have this problem with 0.9.3 simulator. when adding a new object to the stage, i'm setting the object's scaleX and scaleY properties to 1.5, and then tweening those properties back down to 1.0 while also tweening the drop shadow.
i don't belive i'm doing anything particularly groundbreaking or experimental here. fingers crossed that it's an issue with the simulator, but if that's the case i assume my application will join others' on here in gathering a nice coat of dust before it's accepted and posted to App World.
03-29-2011 12:50 PM
another possible clue / problem is my splash screen. it's simply an all black .jpg sized at 1024 x 600 pixels @ 72 PPI. when the app is launching the splash screen doesn't cover the screen as evident in the image below:
03-29-2011 02:00 PM
03-29-2011 03:00 PM - edited 03-29-2011 03:02 PM
it was the first thing i tried after learning from your solution about the interlaced .jpg causing my splash screen to stretch. i converted and resaved all of my .jpg texture assets as .png, recompiled, but unfortunately the problem remains in the simulator.
i wonder if something so buggy in the simulator will also be present into the actual device?
03-29-2011 04:04 PM - edited 03-29-2011 04:13 PM
problem solved, generally.
this was causing the error:
try {newSwatch.cacheAsBitmapMatrix = new Matrix();}
catch(error:Error) {}
finally {newSwatch.cacheAsBitmap = true;}
cacheAsBitmapMatrix is only supported on mobile devices and my application code base also targets desktop – hence the try/catch block. it seems as if the simulator has an identity crisis and can't determine if it supports this functionality. i assume the simulator thinks it can, but in the end it just can not.
oh, PlayBook Simulator – The Little Simulator That Could (n't). "i think i can! i think i can!"
now the question: should i include this as part of my submission or comment out the lines of code? when submitting is there a place to write special instructions for testers?
i'm asking because i'm quite confidant that that cacheAsBitmapMatrix will work on the device itself, and since it makes my program faster i'd rather include it rather than resubmitting at a later date.
03-29-2011 04:53 PM
Perhaps you can write instructions in the Release Notes during the upload process.
03-29-2011 05:40 PM