AS3 AIR TextField Glitch (flickering on TweenMax.to) - actionscript-3

Hey I'm wondering if anybody else is having this issue or could suggest a hack? Whenever I get too much going, like too many clips on the stage, then too many TweenMax tweens, my TextField objects will start flickering, sorta like they are rendering over and over again. It looks terrible and I'm wondering if there is some known workaround? It only seems to happen with the text, so I'm wondering if I could somehow render it as a bitmap after drawing it the first time?
This was happening earlier if I would fire off too many tweens at the same time. Now it's happening because I added filters to the containing object. Seems like if things get too intensive then the text fields start flickering. Tested this on both Mac Air and Mac Pro. Suggestions?

You could try setting cacheAsBitmap on your TextFields.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#cacheAsBitmap.
There are a few threads (like this one http://www.kirupa.com/forum/showthread.php?345755-TextField-with-CSS-and-cacheAsBitmap) suggesting that CSS formatting and embedded fonts get a little messed up, so you may have to experiment with the order in which you add things, set their formatting, and cache them.

Related

Is it possible to add animation to Microsoft Access

Is it possible to add animation to Microsoft Access? What I am envisioning is that someone clicks a button on a form and an animation appears and then goes away. Kind of like how when Mario jumps and hits a block, a coin appears and disappears. I know its a very general question, but I couldn't find much online regarding this.
You can move a timer event or similar to adjust the top/left position of a control/picture.
But you wouldn't, as Access (VBA) is single-threaded meaning that while such animation goes on, nothing else will happen, effectively freezing your application. That is really annoying for the user, and that is one of the reasons you meet very little code in this area.
Yes, this is possible. You would basically be drawing and redrawing sprites at specific screen coordinates. It's horrendous in Access, it looks clunky and will kill your app. The reason you can't find much about it online is because it's a very bad idea to try to incorporate it into a database.
Even if you took a shortcut and had multiple GIFs made up (think of an old-school flip book animation), you still have to draw and redraw a bunch of controls. I suppose if you really wanted it you could add it, but I still think it'll drag and look clunky.

Issue with transitions between scenes using effects

I've ran into a (hard to catch) issue using transitions between scenes in Cocos2d-x.
Basically I normally do a fade in-fade out like this:
Director::getInstance()->replaceScene(TransitionFade::create(0.5, scene, Color3B(0, 0, 0)));
It looks visually good and proper and all but I realized that it can be dangerous. If I have a button to go from Scene A to Scene B this way, the transition will run for 0.5 seconds as per the above implementation. When tapping ONCE and waiting, everything will be fine but if you tap very fast, it IS possible to have the event of the button called another time, even though the first transition call is already under way. This can, and I think in my case, lead to all sorts of strange and dangerous things. Especially for me who often use a protocol/delegate pattern for fetch data callbacks etc.
Want we want to do is to disable any UI (at least, possibly more?) on scene A as soon as the transition starts just to be sure that no other pushes are possible to the same or any other button, causing more transitions to be launched which could cause harmful things. Or there should be some kind of feature within cocos2d-x to always refuse transitions if one transition is already under way... To me that sounds like the most sane thing at first thought.
Is there anything I missed or are transitions in cocos2d-x really this dangerous? Anyone tackled this? Maybe a way to check if a transition is already under way would be one way for me to get around this problem without hacking around on cocos2d-x itself?
The virtual cocos2d::Node function onEnterTransitionDidFinish() could be used to unregister your callbacks for web requests etc.
Assuming you don't use the cocos2d-x event system for any app logic during a transition you might also consider disabling the EventDispatcher to block the propagation of touch events.
You could simply disable the button after it triggers.
Or you could be super lazy and create a Layer/TouchListener to intercept touch when a transition begins (onEnterTransitionDidStart()), and destroy it along with your scene :)

Image Limit in Flash/Flash Builder?

So here's a fun one for you guys. Is there a limit on the number of images that can be imported into Flash or Flash Builder?
The answer, I would initially think, is no, however my current project is telling me otherwise. It started in Flash Builder. I was embedding images and etc like normal, using the standard "" code, when I noticed that when I exported the release build, some of the images would be missing. I went through all the links, everything was fine. I looked at all the images, they were all there. Eventually, I began shifting positions to see about layering issues, and I found something odd. Images that were being loaded first were also being removed after a certain number of images had been loaded. This interesting dilemma was also not tied to any specific image. Changing visible properties for different images would always cause the same results: the newest visible image would be added in, but the background image would be removed. There are a total of 65 images that may or may not need to be onscreen at any point in time. There are also 29 buttons, but they don't seem to affect anything when they're marked as visible or not. 22 images seems to be the safe number. When at 23 and 24, it seems to occasionally throw graphical errors when hovering over a button, in that all the area around the button seems to disappear to black. Upon reaching 25, the entire background image goes missing and there are more graphical errors when hovering over or clicking buttons. And for clarity's sake, these screens are not from the actual project. There copyright issues or US trade secrets or something that I could probably get fired for for showing. Either way, these images were put through FB and are exactly how they showed when I ran it.
How it should be:
https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-6434400-644532/450-365/howitshouldlook.png
What it turned into:
https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-6434400-644531/450-369/howitreallylooks.png
Note that there are 31 images in this example, including the gray/grey background. So yeah. Either I'm doing something wrong with how these are put into this project, or Flash Builder and Flash don't like it when you've imported over 22 images into them. I'm including Flash in this because a co-worker suggested I build it in Flash instead and do some wonky coding as a work around. Once I dragged the 20-somethingth png file in, things started to disappear. Then, when doing a ctrl-enter test, nothing is visible but a few of the upper layers, and yes, I've checked to make sure things weren't turned off/on.
I cannot give you code better than I've already stated, because that is literally all that is in the file. The Flash Builder SDK being used is 4.1, Flash version is CS 5.5. I have also fixed my .ini file so that it gets max memory without the extra crashing.
Thanks in advance guys :D
The issue is not the number of images, but the number of transparent pixels to render. It is a compositing optimization that has been in Flash Player since at least Flash Player 4 (though it was 8 instead of 23 at the time). As a side effect, it used to be a hacky way of creating interactive masks back when masks could only be layers in Flash Pro.
It doesn't even have to be images. If you make a movie clip and set its alpha to below 100% (but above 0%) and stack 23, whatever you put under it won't render. The number of compositing layers before giving up is ties to the SWF version you are targeting as well (for backwards compatibility).
(this was one of the first things I asked the Flash Player architect about when I worked on that team)

AS3 loaded PNG gradient transparency appearing as black

I'm experiencing a strange PNG issue in my as3 flash project. I am loading a bunch of PNG's into flash which have gradient transparencies.
In early slides, these are displaying correctly, later on in the project, the gradient transparency is showing as a solid black background.
Is this a memory issue? I've been pretty hot about memory clean up. All the images are loaded in using exactly the same scripts, and I can swap the images around with the identical results. It just seems like after a while flash stops showing the transparency right.
Images of my problem can been seen below.
Working:
http://s331209305.websitehome.co.uk/board/working.jpg
and then after the first level has played:
broken:
broken.jpg (same url as above with broken.jpg at the end (apparently as I am a new user here I can't have more than one url in a post))
I've been search Google for literally hours but can't find anyone experiencing a similar issue.
Any advice very much appreciated.
T
Ok, I know this is an old post but I too searched for a long time on google and only found this reference to the problem I was having as well.
Anyways, long story short, I fixed my issue.
The problem was I had set the alpha way to high. I set it to 5 and it did something similar to yours. I had to make sure the alpha was always clamped between 0 and 1.
Hope that was your issue as well.
I'm curious if you are loading them on top of each other, and you start seeing buildup.
it's hard to tell what exactly is going on without seeing any code, but here are some ideas
make sure that the BitmapData has
alpha enabled (this is usually done
through the constructor)
if this is a
memory issue (though this doesn't
seem like it is) try using object
pools. the HYPE framework has one,
but there are others too.
Check how they are loaded. I use the casa lib for loading, which makes the handling of the images easier, I load pngs through it and haven't had any issues like this.
post a simplified version of the problem. I've solved a problem countless times where I tried to post the problem, but would simplify it to the bare essentials and end up seeing the cause.

Glitchy screen redraws in flex application?

I have a flex/actionscript based project. The project has various view stacks and tab navigators and a few popup windows. The whole thing is managed in pureMVC framework.
When transitioning between various view states, opening a popup, switching a tab, etc, I find the app to exhibit various redraw glitches. Parts of views will be partially drawn or flicker in odd ways. I am fairly confident that the code is working correctly, just seems to be an issue with the overall heaviness of the UI.
Is this a common issue? Are their tried and true techniques to optimize this problem?
In particular what event handlers are available to delay the drawing of view components until the last moment when everything is ready to quickly display to the screen?
Say for example I have a VBox inside a viewstack, and inside this VBox I have a fairly complex datagrid. Can I prepare the datagrid and/or delay the viewstack change until all subview components are in fact ready to be quickly drawn.
What are some possible symptoms to this kind of glitchiness?
just a guess, but this might be related to the flex framework ... i experienced this kind of behaviour too ... i guess it is related to the way flex framework works when carrying out ui tasks ... a lot of deferred instantiations/calls and so on ... when there is a lot going on, the framerate drops and since deferring is framebased, that is probably when the resulting delays become noticable ...
greetz
back2dos
Not sure if this applies to you, but in Firefox/OSX there is a known bug when you make too many javascript calls, and the result is similar as you say... the whole interface shows various glitches and flickers... The solution was to delay the JS calls a bit, so they don't get called too often... this was a serious issue with swfaddress for instance (I think it still is).
http://www.bigspaceship.com/blog/labs/mac-firefox-30-flash-javascript-random-artifacts/
I assume you need the datagrid already attached to its parent container and you are loading data while it's being shown so it constantly updates and renders its content.
Have you simply tried setting its visibility to false until everything is loaded while keeping includeInLayout true and giving it a fixed size?