AsterLUXman
Participant
AsterLUXman
Participant
Activity
‎Sep 15, 2021
03:07 AM
Say I have a RGB/8bit photoshop file, with one or more spot channels in it:
I make sure the visibility of those spot channel(s) is currently OFF ( by togling off each spot channels' eye icon ), and that only the RGB channels are currently selected and visible.
I then create a new layer, and add a layer mask to it.
I then select the new layer's RGB channel ( result: the RGB channel and its R, G, and B component channels are all selected and visible )
If I now select the new layer's 'layer mask', again, all the spot channels are made visible, AUTOMATICALLY.
Why is this happening? The visibility of the spot channels was previously off; why does selecting a layer mask ( any layer mask of any layer, as a matter of fact ) makes all the spot channels visible? This is really distracting and I can't think of a reason for this behavior. I assume this is a bug.
Note: changing the solidity percentage of the spot channels to 0% doesn't prevent the spot channels' color from being overlaid, however faintly, which is why their visibility being toggled on automatically is a visual + workflow problem.
... View more
‎Oct 19, 2014
11:31 PM
Tamak1234, Did you try the ANE on a different iOS device? Possibly, the inaudible local notification sound may be due NOT to the ANE, but to an OS bug on the device, as previously mentioned. There are lot's of threads on the internet about this software issue ( including on youtube ). In my case, I had this problem ( inaudible local notif sound ) on my iPad 1 / OS 5.1.1, but not on my iPod Touch ( same code / same ANE ) !
... View more
‎Oct 19, 2014
02:51 AM
Tamak1234, Just an idea: Have you tried running Adobe Scout while your app is launching? The Trace Log window may give you some useful hint ?
... View more
‎Sep 27, 2014
11:18 PM
Hi, iOS default music player's audio gets paused automatically whenever I switch to an AIR app. Is there a way to keep it playing?
... View more
‎Sep 21, 2014
12:58 AM
1 Upvote
Ok. I figured it out. Ever since the new sd card requirements for Android KitKat, an 3rd-party app must request the WRITE_EXTERNAL_STORAGE permission in the app manifest, in order to access public folders on the sd card, such as: the sd card's root ( /sdcard ) where music files get copied by default, for example. Interesting write-up on the issue: External Blues: Google Has Brought Big Changes To SD Cards In KitKat, And Even Samsung Is Implementing Them
... View more
‎Sep 20, 2014
10:35 PM
Hi, As of Android 4.4.2 ( aka. API 19 - Kit Kat ), it appears that File.userDirectory.getDirectoryListing() is no longer returning anything. Also, a call to File.userDirectory.browseForOpen() causes my app to crash instantly. Both functions work fine in Android 4.3 ( aka. API 18 - Jelly Bean ), however. Did something change, or are new permissions required for using the File API, in 4.4.2? My setup: I am testing in AVD ( Android Virtual Device ). My app is compiled with AIR SDK 14.0.0.178 ( note: the app crashes on load if compiled with AIR 15.0.0.249, but that's due to a different problem ).
... View more
‎Apr 03, 2014
05:47 PM
Hi Jeroen, 1) to initiliaze the SM class, you would do: public function MyAppConstrutor():void { addChild( new SM( init ) ); } init(), being your main intialization function, which will be called by SM once the screen sizes become known on your mobile device. 2) CONFIG::AIR_APPLICATION is a config constant ( same as a preprocessor directive, in other languages ), and is set in "Publish Settings > Advanced Actionscript 3.0 Settings > Config constants" window, in Flash Professional CSx. If you use a different development environment, I am not sure where you would set it. By setting it to true, you are basically indicating that you are compiling an AIR app, as opposed to a flash ( browser ) app. This config constant is not part of AS3, but something I use for my code, to dinstiguish when I can use routines that are available only in Adobe AIR ( as opposed to regular Flash ). I also have another config constant CONFIG::AIR_APPLICATION_NO for code branches that are intended specifically for Flash in the browser.
... View more
‎Mar 18, 2014
03:08 PM
Hi Ohla, The sounds work for me on both platforms ( iOS and Android ). 2 Things to look into: 1) It may not be finding the sound file in the *.ipa. Make sure the sound file is in the root of the ipa ( should be the 2nd folder from the top: YourAppName.app folder ). To make sure, just rename the *.ipa to *.zip, and open the file. The file "fx05.caf" should be in the *.app folder, where the main swf is. If you package your file with adt.bat, just add it to the adt line, like this adt -package -target ipa-test .... fx05.caf - extDir .caf -extdir C:\projects\extentions\distriqt\release-v1.36\notifications\lib 2) The other thing that can be happening, as strange as it seems, is that the local notification sound engine may have crashed on your iOS device. There are lot's of threads on the internet about this software issue ( including on youtube ). So, your lack of sound may not be due to the ANE, but to an OS bug on the device. I suggest you try the ANE on a different iOS device. I have this problem on my iPad 1 / OS 5.1.1, but not on my iPod Touch!
... View more
‎Mar 11, 2014
09:37 PM
Hi Pea, Thank you for pointing out this bug. I haven't looked into this issue for a long while, so I am a little lost even re-reading the thread. I remember modifying my code sample above, a while back, but didn't follow through and update the code in this thread at the time, unfortunately. In case this might be useful to you, here is what I use these days -- I haven't had any problems with it so far. I basically made a 'Stage Monitor' class, which I add to the stage right away in my app's constructor. I also pass the main init function as a callback, which gets called as soon as the stage dimensions are known. The stage width and height get stored in static variables, so all my other classes can point to SM.stageWidth, for example, without the instance having been added to the stage ( if it's a display object ) or referencing the stage in some other way. package com.blah.common { import flash.system.System; import flash.system.Capabilities; import flash.display.Sprite; import flash.display.Stage; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; CONFIG::AIR_APPLICATION { import flash.display.Screen; import flash.events.StageOrientationEvent; } import flash.geom.Rectangle; import flash.geom.Point; public final class SM extends Sprite // SM stands for 'Stage Monitor' ( we use a short word so all we will have to type, for ex, is: SM.stageWidth ) { public static const SCREEN_PPI:Number = Capabilities.screenDPI; CONFIG::AIR_APPLICATION { public static const SCREEN_BOUNDS:Rectangle = Screen.mainScreen.visibleBounds; } private static var _stage:Stage; private static var _stageScaleMode:String; private static var _startupAspect:String; // only used in AIR apps private static var _stageResizedOnceAlready:Boolean; private static var _forceStageWidth:Number; private static var _forceStageHeight:Number; private static var _minStageWidth:Number; private static var _minStageHeight:Number; private static var _forceWidthToHeightRatio:Number; // height stays 100% private static var _forceHeightToWidthRatio:Number; // width stays 100% -- use one or the other private static var _visibleScreenLengthShortest:Number; private static var _visibleScreenLengthLongest:Number; private static var _stageWidth:Number; // orientation dependent private static var _stageHeight:Number; // orientation dependent private static var _stageWidth_d2:Number; private static var _stageHeight_d2:Number; private static var _stageCenter:Point; private static var _stageRect:Rectangle; private static var _stageWtoH:Number; private static var _stageHtoW:Number; private static var _ui_scale_800:Number; private static var _ui_scale_480:Number; private static var _ui_scale_480_width:Number; private var _stageInitedCallback:Function; // NOT static. May vary from instance to instance of this. private var _orientationChangeCallback:Function; // NOT static. May vary from instance to instance of this. public function SM( stageInitedCallback:Function = null , orientationChangeCallback:Function = null , stageScaleMode:String = StageScaleMode.NO_SCALE , startupAspect:String = "portrait" , forceWidthToHeightRatio:Number = NaN // height stays 100% , forceHeightToWidthRatio:Number = NaN // width stays 100% -- use one or the other , minStageWidth:Number = NaN , minStageHeight:Number = NaN , forceStageWidth:Number = NaN , forceStageHeight:Number = NaN ):void { // USAGE: instance with stageInitedCallback set to the 'added to stage' main init function of the container, // and add this to the stage in the constructor. // // Note: this will remove itself from the display list automatically. mouseEnabled = false; mouseChildren = false; visible = false; _stageInitedCallback = stageInitedCallback; _orientationChangeCallback = orientationChangeCallback; _stageScaleMode = stageScaleMode; _startupAspect = startupAspect; // only used in AIR apps _forceWidthToHeightRatio = forceWidthToHeightRatio; _forceHeightToWidthRatio = forceHeightToWidthRatio; _minStageWidth = minStageWidth; _minStageHeight = minStageHeight; _forceStageWidth = forceStageWidth; _forceStageHeight = forceStageHeight; addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true); } private function onAddedToStage( evt:Event ):void { removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false); // remove this (run once only) // Below: if there is no _stage, this means onAddedToStage() hasn't run ONCE yet // ( in other words: this is the first instance of this, so far). if (!_stage) { _stage = stage; // cache stage since we will remove this from the display list in finish() // Below: we don't want to add (and build) our graphic assets to (based on) // a stretched stage. Rather, we want to build them at the right size, which means we will need // to know the device screen size in a moment... if (_stageScaleMode == StageScaleMode.NO_SCALE ) _stage.align = StageAlign.TOP_LEFT; // Above: if there is a top status bar, top_left is nevertheless right below it, so we're good... _stage.scaleMode = _stageScaleMode; // StageScaleMode.NO_SCALE; // Above: needs to be set to no_scale, otherwise the resive event, below, won't fire when // the app window changes its width or height. That's a how the RESIZE event is supposed to work ('Essential ActionScript 3.0', p.207) // The default, otherwise, is "SHOW_ALL", which stretches the stage to fit within the window, but does not theorically // fire the resize event, though it does on iOS ( but not on Android, which is how it's supposed to work ) * // * I wished Adobe would fix these inconsistencies... CONFIG::AIR_APPLICATION { _stage.addEventListener( Event.RESIZE, onStageResized, false, 0, true ); // Let's keep track of orientation changes also, if autoOrients is true if ( (Stage.supportsOrientationChange) && (_stage.autoOrients) ) _stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onStageOrientationChangeStatic, false, 1, true); // Above: onStageOrientationChangeStatic() is the static version of the function which runs only once per event // ( even if there are several instances this, bc listener points to the same--static--function ) } } else { CONFIG::AIR_APPLICATION { if (_stageResizedOnceAlready) // let's call _stageInitedCallback right away finish(); else // wait for it _stage.addEventListener( Event.RESIZE, onStageResized, false, 0, true ); } } CONFIG::AIR_APPLICATION_NO { // No resize triggered right-away on desktop ( unless we change the size of the browser ) so we need to go right into it initStageDims(); } } private function onStageResized( evt:Event ):void { _stage.removeEventListener(Event.RESIZE, onStageResized, false); // remove this (runs once) initStageDims(); } private function initStageDims():void { if (!_stageResizedOnceAlready) { initVisibleScreenDimensions(); var isPortrait:Boolean = Boolean( _startupAspect == "portrait" ); updateStageDimensions( isPortrait ); _stageResizedOnceAlready = true; } finish(); } private function finish():void { if (_stageInitedCallback != null) _stageInitedCallback(); CONFIG::AIR_APPLICATION { // Let's keep track of orientation changes also, if autoOrients is true AND _orientationChangeCallback is defined if ( (Stage.supportsOrientationChange) && (_stage.autoOrients) && (_orientationChangeCallback != null) ) _stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onStageOrientationChange, false, 0, false); // Above: // onStageOrientationChange() is the non-static version so it runs once per event, PER instance of this // (since listener points to a 'different' function belonging to each instance of this) // weakReference is false, bc we want to keep this handler going, even if this is marked for sweep by the garbage collector // For ex: if this is removed from the display list and the parent container has no reference to it, as in: addChild( new SM( initFunc ) ) } // remove this from the display list (not needed anymore, since we know what the stage is) if (parent) // logically, there should be at this point, but doesn't hurt... parent.removeChild( this ); } CONFIG::AIR_APPLICATION { private static function onStageOrientationChangeStatic( evt:StageOrientationEvent ):void // static version runs only once per event ( even if there are several instances this, bc listener points to the same--static--function ) { var isPortrait:Boolean = Boolean( _stage.stageWidth < _stage.stageHeight ); updateStageDimensions( isPortrait ); } private function onStageOrientationChange( evt:StageOrientationEvent ):void // not a static function bc _orientationChangeCallback is not static. This runs once per event, PER instance of this. { if (_orientationChangeCallback != null) _orientationChangeCallback(); } } private static function initVisibleScreenDimensions():void { // Determine screen size so that we can properly construct our UI... // // The problem with fullScreenWidth/Height is that it gives the entire // screen dimension, including the area occupied by optional status bars // (in cases where user set fullScreen = false, in the app manifest) // as well as the non-optional (so I read on an Adobe forum thread from sigman.pl) // virtual Android buttons bar, on some devices (ex: Xoom w/ Android 3.0). // // These status and buttons bars have the potential of causing important UI widgets // to be partially hidden, so we need to size our app so that it fits nicely within // the visible area of the screen: hence the use of Screen.mainScreen.visibleBounds. // // However, when debugging the app on a computer (CTRL+Enter in Flash CS5), // Screen.visibleBounds returns the area of the desktop, not the area within the flash window, // so that's annoying (also: Screen.screens doesn't work at this point). Also, there is no // guarantee that in the future,mobile OSes might not be able to start apps in a 'minimized' // mode (like a computer), so we will use Math.min to address both issues. // // Note: // * IF stage.scaleMode != NO_SCALE, stage.stageWidth/Height returns the stage dimensions // as was set in CS5 // * IF stage.scaleMode == NO_SCALE, accroding to the AS3 reference, stage.stageWidth/Height // returns stage ( not original, from the fla ) dimensions...BUT: // According to Sigman.pl, on iPhone, it appears that stageWidth/stageHeight, even after // the first RESIZE event, still gives the original ( from the fla ) stage dimensions. // Note: maybe other resize events get generated that later set it to the right size? // CONFIG::AIR_APPLICATION { // Apparently, according to Sierakowski's blog (http://sierakowski.eu/list-of-tips/82-starting-with-air-for-android-and-ios-building-one-app-for-both-platforms.html), // stage.fullScreenWidth isn't consistent in always giving the same side (shortest screen length in portrait), // when the device is started in landscape mode between iOS and Android. // // So, let's use min/max to identify which one is shortest/longest in all cases: _visibleScreenLengthShortest = Math.min( _stage.fullScreenWidth, _stage.fullScreenHeight ); //, SCREEN_BOUNDS.width, SCREEN_BOUNDS.height ); _visibleScreenLengthLongest = Math.max( _stage.fullScreenWidth, _stage.fullScreenHeight ); //, SCREEN_BOUNDS.width, SCREEN_BOUNDS.height ); } CONFIG::AIR_APPLICATION_NO { _visibleScreenLengthShortest = Math.min( _stage.stageWidth, _stage.stageHeight ); _visibleScreenLengthLongest = Math.max( _stage.stageWidth, _stage.stageHeight ); } } public static function updateStageDimensions( isPortrait:Boolean = true ):void { // isPortrait only is used for AIR applications CONFIG::AIR_APPLICATION { _stageWidth = isPortrait ? _visibleScreenLengthShortest : _visibleScreenLengthLongest; _stageHeight = isPortrait ? _visibleScreenLengthLongest : _visibleScreenLengthShortest; } CONFIG::AIR_APPLICATION_NO { _stageWidth = _stage.stageWidth; _stageHeight = _stage.stageHeight; } if ( !isNaN( _minStageWidth ) ) _stageWidth = Math.max( _minStageWidth, _stageWidth ); if ( !isNaN( _minStageHeight ) ) _stageHeight = Math.max( _minStageHeight, _stageHeight ); if ( !isNaN( _forceWidthToHeightRatio ) ) _stageWidth = _stageHeight * _forceWidthToHeightRatio; else if ( !isNaN( _forceHeightToWidthRatio ) ) _stageHeight = _stageWidth * _forceHeightToWidthRatio; // About: _forceStageWidth / Height // // This class ( SM )' main purpose is to basically detect the stage dimensions on the first resize, and then fire the // supplied "stageInitedCallback", so that the app graphic assets can be built to fit the screen. // The SM class secondary purpose is also to provide a way for numerous other classes ( that are not necessarily // Display Objects themsleves, and hence don't have a stage attribute ) to access the stage and its width/height. // // One problem, on the desktop, is that the stage width/height represent the entire area of the desktop, not // just the inside of the browser window. On a mutiple-monitor desktop, that area can be very large, esp. if one of the // monitors is in portrait orientation. So, for this particular case, we may wish to specify a specific stage // width/height for the purpose of initialization of graphic assets. This is our standard stage width/height, we build // our assets based on, regardless of what the stage says. if ( !isNaN( _forceStageWidth ) ) _stageWidth = _forceStageWidth; if ( !isNaN( _forceStageHeight ) ) _stageHeight = _forceStageHeight; _stageWidth_d2 = _stageWidth * 0.5; _stageHeight_d2 = _stageHeight * 0.5; _stageRect = new Rectangle(0, 0, _stageWidth, _stageHeight); _stageCenter = new Point(_stageWidth_d2, _stageHeight_d2); _stageWtoH = _stageWidth / _stageHeight; _stageHtoW = _stageHeight / _stageWidth; _ui_scale_800 = _stageHeight / 800; // 800 comes from the fact that the original fla's stage was 800 pixels tall, so this is used to reposition and rescale assets which were designed to fit this size originally (note: the stage dimensions vary on Android devices) _ui_scale_480 = _stageHeight / 480; _ui_scale_480_width = _stageWidth / 480; } public static function get stageWidth():Number { return _stageWidth; } public static function get stageHeight():Number { return _stageHeight; } public static function get stageWidth_d2():Number { return _stageWidth_d2; } public static function get stageHeight_d2():Number { return _stageHeight_d2; } public static function get stageRect():Rectangle { return _stageRect.clone(); } public static function get stageCenter():Point { return _stageCenter.clone(); } public static function getStage():Stage { return _stage; } public static function get UI_SCALE_800():Number { return _ui_scale_800; } public static function get UI_SCALE_480():Number { return _ui_scale_480; } public static function get UI_SCALE_480_WIDTH():Number { return _ui_scale_480_width; } public static function get stageWtoH():Number { return _stageWtoH; } public static function get stageHtoW():Number { return _stageHtoW; } } // End of: class } // End of: package
... View more
‎Mar 08, 2014
05:49 PM
Right. Thank's, Colin. It makes sense to put the external swf in a subfolder within the main swf's folder, but in my case, the external swf is shared with several other projects so that would not be its proper place.
... View more
‎Mar 08, 2014
04:11 PM
Hi, I am running into a small, convenience issue. In my iOS AIR app, I am loading an external swf which has been included into the root of the ipa, via adt. The code is : var loader:Loader = new Loader(); var url:URLRequest = new URLRequest( "SoundLib.swf" ); var loaderContext:LoaderContext = new LoaderContext( false, ApplicationDomain.currentDomain, null loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onSoundLibLoadComplete, false, 0, true ); loader.load( url, loaderContext ); The swf loads just fine on the device, and I am able to instantiate the sound assets within it. So far so good. My issue is that when compiling the main swf in Flash Pro, I am forced to use the absolute path to where the external swf is located on my desktop drive ( C:/projectName/fla/common/SoundLib.swf ). If I just use "SoundLib.swf" ( even if I include the swf via the publish settings window), or if I use a relative path ( "../common/SoundLib.swf" ) to where the main swf gets compiled to, it just doesn't find it. I would like to avoid having to update the path to the external swf ( SoundLib.swf ), manually, whenever I compile the swf candidate for the device, as opposed to when I am merely testing the swf in Flash Pro on the desktop. Is there a way to do that? Can the main swf recognize if it is run on the desktop , as opposed to on the mobile device?
... View more
‎Mar 07, 2014
01:55 AM
I believe Scout will work with any version, and I am pretty sure it shows runtime errors + you can see the output of trace statements, and inspect how long some functions are taking. It's not a debugger per se, though, as you cannot set breakpoints, etc. It's quite a wonderful program ( and free ) -- I just started using it, and it has already helped me troubleshoot an app that was also crashing on my splashpage.
... View more
‎Mar 05, 2014
09:21 PM
Have you tried running Adobe Scout?
... View more
‎Mar 05, 2014
09:17 PM
If this app runs on the desktop, one workaround might be to have two air applications and putting the windows side by side!
... View more
‎Mar 02, 2014
01:14 PM
Generally, the soft keyboard behavior seems to be inconsistent, esp. across platforms. I have found that the best thing to do is to just set it to none in the manifest, and handle your own panning, manually. This way, it will work every time + just the way you'd like it. http://forums.adobe.com/message/6118935#6118935
... View more
‎Mar 01, 2014
02:07 PM
1 Upvote
CAB would be detrimental to performance on the top container for sure. CAB just creates bitmaps of your sprites and therefore uses up a lot of memory -- that's why I was enquiring if you were using it. I you are using CAB, I would disable it and see what happens. My guess is that your GPU memory gets filled-up / corrupted during the compositing step of the second frame. Rendering the first, full frame is fine. Compositing the portions that have changed in the following frames, isn't. Things to try: Using stage.invalidate() to force a redraw of the entire stage, not just the portions that have changed since the last time the frame was drawn. If you have a mouse move handler, you might also want to try evt.updateAfterEvent() and see what happens. Try CPU and Direct render modes. PaperSprite isn't a standard AS3 class, and a cursory look at http://blog.soulwire.co.uk/code/open-source/two-sided-planes-in-flash-player-10 seems to point to it doing some funky things with stage.invalidate() -- surprise, surprise ! -- and the Event.RENDER, etc. It may all be fine, but it could also be that your problem comes from the PaperSprite class. What I would try is to use a regular, single-sided Sprite, instead, as a test, and see if the same problem occurs when you try to flip it. If the problem doesn't happen, then I would dive into the source code for PaperSprite, or come up with a different approach, like flipping quads in Stage3D. In case you are new to molehill, the best source to get started with Stage3D, imo, besides the AS3 documentation code examples, is this book: http://www.amazon.com/Adobe-Stage3D-Molehill-Programming-Beginners-ebook/dp/B006EEJSHM/ref=sr_1_1?ie=UTF8&qid=1393740087&sr=8-1&keywords=molehill+stage3d
... View more
‎Mar 01, 2014
03:31 AM
Hard to say where to look from the info you are giving us. A couple questions: Which render mode are you using ( CPU, GPU, or Direct ) ? Are you using cacheAsBitmap on the container that has the 30 sprites within? ( If so, that would be bad ). Are you using CAB on the sprites themselves?
... View more
‎Feb 27, 2014
06:37 PM
Boat5, I am not entirely sure about this, but doesn't CABM tell the GPU to store the bitmap in GPU memory, so that it can be scaled, rotated, etc, rapidly on the GPU ? I believe that not setting CABM, even for a bitmap, means that the bitmap will be kept in regular memory ( not GPU memory ), and used by the GPU only for rendering the final frame ( e.g. 'compositing step' ). IOW, just because it is a bitmap, doesn't mean that it is going to reside in GPU memory, simply because the render mode is GPU. One needs to use CABM for that, no?
... View more
‎Feb 27, 2014
06:13 PM
AFIK, CABM allows for bitmaps stored onto the GPU to be smaller in resolution than the source bitmaps. This makes displaying the texture by the GPU faster ( albeit at a lower res ), because in many cases, the texture cache ( current pixel and surrounding pixels ) can be reused several times, rather than re-caching a new area on the texture. The lower res can still be visually acceptable depending on the original bitmap resolution, thank's in large part to the bilinear filtering aforded by GPU mode. This can allieviate some of the performance issues, particularly on devices with low-fill rates. Bad fill-rate is one of the reasons some older Android devices won't be able to reach 60fps, even with optimum code.
... View more
‎Feb 27, 2014
04:04 PM
Some tips here: http://forums.adobe.com/message/6104854#6104854 The magnitude of your multiplier may be the issue. Based on your code sample, I suggest trying this: var cacheMul:Number = multiplier * 0.5; bitmap.cacheAsBitmap = true; bitmap.cacheAsBitmapMatrix = new Matrix(cacheMul, 0, 0, cacheMul); bitmap.scaleX = multiplier;bitmap.scaleY = multiplier;
... View more
‎Feb 23, 2014
03:37 AM
Some performance tips here: http://forums.adobe.com/thread/1399727?tstart=60
... View more
‎Feb 23, 2014
03:33 AM
1 Upvote
Last time I attempted to deal with this, I ended up programming the content paning, manually: http://forums.adobe.com/thread/1392919?tstart=30
... View more
‎Feb 18, 2014
02:16 AM
1 Upvote
Hi Lucian, Unfortunately, I am unaware of any tutorials on the net I could recommend, though I am sure there are a few -- not on the subject of setting up render targets, specifically -- most likely-- but on setting up Stage3D + shaders. One source I would recommend, though, if this is your first time setting up a Stage3D render pipeline, besides the code examples in the Stage3D Adobe reference, is this great book: http://www.amazon.com/Adobe-Stage3D-Molehill-Programming-Beginners/dp/1849691681/ref=sr_1_sc_1?ie=UTF8&qid=1392715725 It's a quick read. Nicely presented and explained. I think in 3-5 days you could be up and running. I would also browse this site. You might get some ideas: http://www.flashandmath.com Regarding using render targets to identify areas that have changed and need further processing: This is a fairly common practice when interactivity is key, and works well in some use-cases. For example, in Photoshop, there is a filter called "Liquify", with which you can stretch and compress an image in real-time. There are 2 ways to do this effect, live: one is to map the source -- undistorted-- image onto a grid of polygons, and start pushing and pulling the vertices. The other method -- same principle, but finer -- is to paint the compression field into a render target ( a texture ), temporarily, while you work in real time by 'painting' the effect ( note: the displacement vectors are based off of the gradient of the compression field ). Conceivably, you could also paint the vectors directly, as if painting a normal map. Once the user is happy with the look, then the user clicks 'apply', and the render target is used one last time to bake the displacements into the source image. Other example: I once worked on a game where the player could use a laser beam to scar all the buildings of a 3D city. The way this was done was that each building had its own render target ( usually a 256x256 ), into which the user could 'draw' ( even though the player never saw this render target, which was just a grayscale mask ). The render target was then fed into the building's exterior shader, which would use it to identify which areas to show the destruction effect into. Overall, the idea is to use a render target ( usually smaller that the source texture it will end up modifying ) to paint either a mask, or vectors ( like a normal map ), which is then used along with the source texture in the final shader to create the look you want. Although I haven't had to use render targets for this particular situation, lately, I use render targets frequently, otherwise, to draw my assets into and apply shaders, and then draw the render target into the backbuffer, at the very end. The reasons for this is explained here ( along with other tips 😞 http://forums.adobe.com/thread/1399727?tstart=30
... View more
‎Feb 17, 2014
05:42 PM
Not sure if this will make difference, but you might want to try zipaligning your apk, as well: http://developer.android.com/tools/help/zipalign.html Also, if you absolutely need to guarantee a particular level of performance, you can always set a filter in the app manifest to exclude devices that are underpowered: http://developer.android.com/google/play/filters.html
... View more
‎Feb 17, 2014
04:18 PM
Hi Lucian, The small block idea is probably your best bet. Here is another idea, though I am not sure if it applies to your use-case or not. Roughly: Instead of altering your final ( large ) bitmapData by drawing directly into it, you could maybe draw only the areas that have changed or that need additional processing into a render target ( whose resolution could be lower than the final bitmapData ). And then combine the render target and the original bitmapData via a shader. Occasionally, you could also 'bake' the results into your source BitmapData. Also, there might be a way to use the AGAL kil command, or the Context3D.setColorMask() to process only the pixels that need to be taken into account, for the drawing into render target or for the blending with the source bitmapdata. Sorry, I can't be more specific. In any case, that would require setting up a stage3D render pipeline ( incl. shaders ).
... View more
‎Feb 15, 2014
12:09 AM
VascoF, On re-reading your original post, this behavior looks symptomatic of an app whose GPU memory usage is very close to maximal. You need headroom in GPU memory, or it's very easy to go overboard, especially as the device overlays the standby ( lock ) screen, or something like that ( like the manufacturer's own Android skin -- ex: Samsung's Touchwiz UI ! ). Best solution in this situation is simply to reduce the sizes of the textures you are storing in GPU memory, by: If you are the direct render mode + Stage3D, by putting a cap on the maximum texture res possible, for example, and/or knocking down the largest ones. if you are using the GPU render mode, by setting cacheAsBitmapMatrix to half-res ( new Matrix( 0.5, 0, 0, 0.5 ) ) or less. OR: by simply authoring all your source bitmapDatas at a lower res. Notes: When resuming an app that uses the GPU, it is possible ( frequent ) to get a momentary black screen ( up to several seconds ), if you lost the 3D context and/or if the textures got flushed from GPU memory. But a full automatic restart, like you are describing, is most likely due to being borderline on texture memory in the first place, and going over the top -- for a particular device! One detail: careful with Texture.dispose() if you rely on it, as it seems to require a couple render calls to truly kick in. If you flood the texture memory with a new set of textures before the dispose on the old ones has taken effect, you could run out of texture memory, as mentioned here: http://forums.adobe.com/message/5991506#5991506
... View more
‎Feb 14, 2014
09:10 PM
VascoF, don't despair, dealing with the Samsung app store can be maddening -- more so than any other ( incl. the fruity one )! Re. black screen issue: In case your are using the direct render mode + stage3D, minimizing the app can ( will ) definitely lead to a loss of context, eventually. Getting a new context can take a few seconds on some devices ( up to 15 seconds on the Nook Color with the BASELINE profile !), and then you still have to go through with the rest of the initialization, including re-generating and re-uploading all the textures. That last part tends to be very fast, though, in comparison to the requesting part -- in my last app anyway. One thing that can speed up the delay in obtainning a new context from the time the Stage3D.requestContext3D() is called, is to use the BASELINE_CONSTRAINED profile, if your shaders are not too complicated ( compiling the swf will let you know if you can ). In my Nook Color app, requesting delay went down to 7 secs ( from 15 ) with the constrained profile! If you are using the GPU render mode, I suppose something similar must be happening. If the delay, in that case, is due solely to the re-uploading of textures to the GPU, then maybe uploading a smaller-res, temporary, set might help. If you are using CAB and CABM, maybe trying cacheAsBitmapMatrix = new Matrix( 0.25, 0, 0, 0.25 ), at first, and then switching matrices back gradually to the intended final resolution might help minimize black screen time, maybe. Just an idea. As a last resort: some devices are pretty old and underpowered ( Nook Color, for example, is one of the worst ), which makes these kinds of issues even worse. Since the Samsung reviews indicate wich device / class of device it is failing on, you could also just re-submit and exclude that class of devices, via their intake website. End of story.
... View more
‎Feb 14, 2014
07:17 PM
Thank you, Chris, for your work and dedication, in helping make AIR/Flash/AS3 into such a truly great cross-platform development environment, as well as for your sustained involvement with the community & forums over the years! I personally really enjoy the language and API, and depend on it for my business -- as do a lot of people. Furthermore, the reality of app development being what it is, I earnestly couldn't afford to stay in business if I had to commit to a single platform, especially in the current mobile landscape. As we know, the AIR/Flash environment has been unfairly maligned by faddists and vested-interests in recent years -- we know who they are --, but for developers who use it day to day, and are savvy enough to know the difference, these negative views clearly do not fit the reality of what AIR is and provides, today. Happily, though, it's good to see that many people are finally catching on! You guys deserve it. Cheers.
... View more
‎Feb 14, 2014
12:22 PM
Hi, Could this be just a memory leak? Have you tried to run your code through a memory profiler, like the one that's included in Flash Builder? I think Adobe Scout could give you some insights too. You could also simply track the available memory over time, via a Timer: _currMemory = System.totalMemory / 1048576; // in megabytes. 1 mb = 1024 kilobytes. 1 kb = 1024 bytes. ( 1024^2 = 1048576 )
... View more
‎Feb 14, 2014
11:27 AM
FYI, some of the points above recoup parts of the discussion in an earlier thread: http://forums.adobe.com/message/5846948#5846948 Re. Samsung QA: They are both good in some respects and awful in others. The bad: They will nit-pick trivial stuff, which other stores won't. They will occasionally fail an app based on arbitrary 'defects' which anywhere else would be considered features or 'as designed'. Their intake website is terrible, and so are the financial reports. You have to wait a long time for each iteration. Financial returns are very low compared to other app stores. The good: Because they are very thorough ( even if arbitrarily, so ), they can occasionally find true defects, on devices you most likely never had access to. The videos showing the defects are great. They definitely put a lot of effort in their feedback.
... View more