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.
Related
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.
This post was orginally posted on flashkit.com, but their forum is kinda dead and no one answered this question after 15 months. So I'm giving it a try here. I'm not a hardcore programmer and searched for a good solution on the web, but I can't seem to find any.
There is a piece of code for erasing a mask with mouse in AS3 which works perfectly. However, I need to detect if the whole image above is completely erased (the mask) and if so, an action will take place such as "gotoAndplay(2)"
Any idea how I to achive this?
http://jonathannicol.com/blog/2009/05/24/erase-an-image-using-your-mouse-in-as3/
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)
When ‘wmode’ in instigated and a user is playing a Flash game requiring arrow keys, on Internet Explorer the browser window also moves. Seemingly, the only way round this is to remove the ‘wmode.’ But, if the ‘wmode’ is removed the Flash game rises to the top of the stacking order and all other elements such as expandable banners or dropdown menus go behind the Flash. No amount of iFrames or CSS resolves this issue.
I have found a solution that lets the ‘wmode’ remain, whilst also enabling the Flash game to have keyboard focus once clicked and therefore the Internet Explorer browser window does not move. This solution means other Dom elements can go above the Flash.
I have put the AS3 code below into a simple example and it seems to work. It basically puts a scrollPane in the content and then this is made invisible.
Being a PHP developer and not an AS3 developer, my questions is – can any AS3 developers see an issue or detrimental impact of placing the code below into a Flash based/AS3 built game. Equally could this work in AS2?
Much appreciated
_scrollPane = new ScrollPane();
_scrollPane.setSize(stage.stageWidth, stage.stageHeight);
_scrollPane.horizontalScrollPolicy = ScrollPolicy.OFF;
_scrollPane.verticalScrollPolicy = ScrollPolicy.OFF;
_scrollPane.alpha=0;
stage.addChild(_scrollPane);
After a bit more testing it appears this is not realistically a viable option. Although the swf file gains focus once clicked and sprites requiring arrow key control can be moved without affecting the browser window, clicking or dragging interaction with sprites is prevented due to the child index of the scrollPane.
I’ve been playing around with the pre-release of IE10 and it appears no matter what state the wMode is left in (or removed) the browser window is still affected by arrow key interaction with the swf.
If anyone else has come across this problem or found an answer it would be greatly appreciated.
I have a piece of Flash on an HTML page that when you hover over it, it expands out to reveal more information.
There are text links that it expands over, however in everything but IE, when it's not expanded those links are still covered by the Flash making them unclickable.
I have the Flash piece in a separate DIV wmode set to transparent.
I know this is possible to make work but for the life of me, I can only get it to work in IE.
Does anyone have any idea of what I'm missing?
Thanks.
I'm a little confused by what you're looking for, so I'll give you a couple of areas to look into. With luck, one of these will get you going, but otherwise, feel free to ask more questions. I'm a little slow on the uptake sometimes....
First off, by default, most browsers place flash files in the uppermost layer. So, the links that you cannot click are stuck in behind your flash presentation - basically, in the eyes of the browser, you are actually clicking on the flash presentation!
This article has some good information on this:
http://kb2.adobe.com/cps/155/tn_15523.html
But basically, you can use a parameter called WMODE in both the object and embed tags. For example, you could implement it like this:
and then add wmode="transparent" into your embed tag.
However, to make it smooth across all browsers (and to make the code a little easier to read/follow), you should also add some z-index values to your stylesheet.
I hope this helps a bit. If not, remember, I'm slow on the uptake....:-)