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)
Related
I'm using haxe and openfl to create an html5 application. I tested the app in multiple browsers and devices, all work fine except in Chrome on iOS 7 only. The images used are not appearing seemingly randomly. Every time I re load different images appear and others disappear with exception to a couple that are always there. Here is what I tried:
I tried setting the z-index on the canvas that is used for one of the missing images, as well as a bigger width and height.
I know that the images are being loaded, I used Charles to take a look. There are no errors in the console log and changing the time and place where the images are being added to the display list in haxe changes nothing.
I swapped out one of the images that are always there for an image that is never there and it still didn't load.
The file names had a couple dashes and spaces in them so I changed that as well with no effect.
It's a very strange problem that I can't seem to diagnose. nor can I really find anyone with a similar problem.
The main issue is the fact that I can't see what haxe is building that might be causing this issue.
This is hard to answer without code samples. My advise is to look at what's different about the pictures that stay versus the ones that don't, both in how you're coding and the pictures themselves. I've had problems with images displaying correctly on ios only to find the problem was embedded somewhere in the metadata of an image. Hope this helps.
I apologise for a slightly fuzzy question but there are no other developers in my office and I need some help from somewhere. If you can even suggest a vague topic for me to look into it would be great as I have been banging my head against this all day with zero progress.
So, I have built a little image display widget (Flash CS6, FlashPlayer 10.3, AS3).
It is simply a container clip into which I load a a stack of images (wrapped in a custom class), one on top of the other but offset a little so that the side of each is visible to be clicked.
Each of the images listens for MouseEvent.ROLL_OVER and becomes the active image when this happens, I also have a listener attached to the stage of their container clip that listens for Event.MOUSE_LEAVE and updates the display when the user is not actively engaging with the Flash area.
Everything works fine when I run within Flash and also when I test in Chrome but in FF and Safari when I mouse out of the Flash area, as well as the expected MOUSE_LEAVE, a ROLL_OVER is also registered by the very bottom image in the stack. This means that whenever you mouse out in the affected browsers the bottom image always becomes active rather than the last one you actually rolled over.
Any thoughts, even vague possibilities, would be great because I am stumped. This is either some really tiny detail of Flash event propagation that I'm not getting or some stupid mistake that I've over thought into a mountain :)
Right now I will take what-ifs, maybes, legends, riddles, anything!
Sorry again for the rather rambling explanation.
Thank you in advance for any advice.
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.
I'm working with a project where we are running a projector from/on a CD, and this can't be changed, to run an e-learning program of sorts. Everything is included on the CD and it doesn't need anything else to run, ie all imgs and xml and whatnot is on the CD.
The problem is that on some computers, assumedly less powerful ones, the entire process clogs up and instead of showing the images just white blank areas appear. The imgs used have been downgraded to a lower resolution, from 1333x1000 to 800x600, and this has solved the problem from what we've found so far.
My question is, does anyone know of any other way to solve this without cutting down the img quality?
As it is right now all the pics (about 180 i think) are being loaded right when the process starts and one idea i have is that you load the pics gradually as needed, 2-3 in advance back and forward or maybe an entire chapter even (7 chapters with imgs are used), to always ensure smooth tweens without having to wait for loading.
But as I've read that there seems to be some memory issue when using a flash projector on a CD/DVD, I'd also like to get more details on what the actual problem is and if possible to find more solutions to it.
I found some links that were supposed to target Adobes own views on the problem, but these links were obsolete. (links found here http://www.flashjester.com/?section=faq&cPath=14_23#394).
Any ideas, help, links, tutorials and what not are welcome.
Yeah, you need to load your assets on-demand and be careful about references so unused things are really garbage collected when they aren't needed anymore.
If you are really running from a projector, then load times aren't totally a concern. Assets form the local filesystem are always available the next frame; they aren't streamed from the disk like from the network. However, bigs file or ones with lots of exports may end up with a longer frame time, or a noticeable delay.
You also need profile things to see if your changes are actually doing anything. Poke through the flash.system.System class to see how you can get info, or take a look at SWFProfiler.
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.