ActionScript 3.0 :: Redraw Swf, Goes Blank Where It Has Been Overlapped?
Aug 16, 2009
i am doing a project to learn as3 as it's fun to do and useful for creating mockups in (interaction designer).
The project consists of a banner swf containing generated stuff and another swf which is the main project. In the banner i have mouseover textfields with an explaining text that is shown when moving the mouse over movieClips. The problem is that when a textfield overlaps the main swf (they are stacked with css, z-index), the main swf doesn't redraw the previously covered area resulting in a white patch where the textfield was shown.
One way of doing it i guess would be to on each MOUSE_OUT function, where the textfield is removed from stage by removeChild(textThing), also connect to the main swf by localConnect() and somehow force it to redraw.
View 1 Replies
Similar Posts:
Apr 22, 2010
I use a jquery calendar and a flash in the same page.. What happens is my jquery calendar is overlapped by my flash... Any suggestion to make it display above flash...Look at the image and see my calendar Fr,sat are invisible because of flash...
EDIT:This is what i used,
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="702" height="443">
<param name="movie" value="images/homebanner.swf" />
[code]....
View 3 Replies
May 1, 2011
what i have is a white picture frame, and within the frame lays my picture,
how can i make them work together in a way that both are one MovieClip!?
ActionScript Code:
addChild(WhiteFrame)
WhiteFrame.Container.addChild(MyPic)
[Code].....
View 2 Replies
Jan 31, 2010
I make flash games with a standardized UI. There are dozens of different *.fla files of different games, created at different times, and all them should share the same interface. My solution was to put this interface into a Library.swf and make every game load that file first and initialize the required classes. It worked perfectly.Now, the UI and the game had to exchange events. If the "Next" button in the UI is clicked, the game has to know it. The solution was create an InterfaceEvent class. The game calls
Code:
ui.addEventListener(InterfaceEvent.BTN_NEXT_CLICKED, desiredFunction)
and the UI dispatches
[code].....
View 2 Replies
May 21, 2010
Is this even possible? I thought if I overlapped the entire underlying Flash with a button on the upper layer, it wouldn't register mouse events underneath. Well, it does. I need to disable the rollovers and click actions for the button on the underneath Flash until the top one is gone, which happens via javascript hiding its div when finished. Only thing I can think of is to have the bottom Flash not set up the button actions until the upper Flash is removed, have that one trigger a javascript that then triggers the bottom Flash to run its init function to set up button actions by way of an External Interface call.
View 1 Replies
Feb 7, 2011
I have two sprites in my movieclip, one under the other, and i want both to listen to mouse clicks event. I found that only the top level sprite receives the event when i click on it. I need to dispatch the events on both, so I can't use mouseenabled=false.
View 2 Replies
May 21, 2010
Is this even possible? I thought if I overlapped the entire underlying Flash with a button on the upper layer, it wouldn't register mouse events underneath. Well, it does. I need to disable the rollovers and click actions for the button on the underneath Flash until the top one is gone, which happens via javascript hiding its div when finished.
Only thing I can think of is to have the bottom Flash not set up the button actions until the upper Flash is removed, have that one trigger a javascript that then triggers the bottom Flash to run its init function to set up button actions by way of an External Interface call. But I'd prefer not to, if there's a simpler way.
View 2 Replies
Nov 8, 2007
When I dynamically / randomly attach movies to the stage I dont want my movies to overlap eachother... How to do this? I tried using hitTest but that didnt work for me, so I wrote some kind of hittest function myself... but that doesn't work right either.
View 4 Replies
Sep 3, 2011
I want to handle the mouseevents for all the sprites on the stage including the one those are hidden behind (or overlapped or occluded) and the main condition is that I want to handle the occluded sprite (that hidden behind other sprite). example, say I have sprite1 and sprite2 on stage and I want to start drag whenever i click on the sprite and stop drag after another click.
This can be done easily, but the problem and my main requirement is that if I drag the sprite1 and drop it exactly on top of the sprite2 then sprite2 will be hidden behind the sprite1 I wont be able to drag the sprite2 without moving the sprite1 first. if you have played zynga's empires and allais game on facebook, it is handled seperatly, it is how it works in that game, the mouse event is triggered on the sprite behind the overlapping sprite, if you have two sprites overlapping one sprite than the mouse event is triggered on the sprite which is last and not the one in front irrespective of whether there is only one sprite overlapping or two or three and this happens to irregular shaped sprites (not just rectangles)
View 1 Replies
Dec 5, 2011
I have a flash object which dimension and position are as same as the HTML button. The button is under the flash object. I want when the flash is clicked and hovered, the button has the styles as if it is clicked and hovered at the same time. I am trying to call: ExternalInterface.call("mouseEventHandle", elementId, eventName); in flash to pass event to JS. And in JS(coffeescript): window.mouseEventHandle = (elementId, eventName) -> id = '#' + elementId switch event when "down" then console.log("down") when "up" then console.log("up") when "enter" then console.log("enter") else console.log("leave") # leave the function is responsible for styling the HTML button. The question is how to style the button under in JS? Or is there other way to achieve the goal?
View 1 Replies
Nov 9, 2009
I am building a scene which consists of 1 main mc containing all the elements in the scene. Inside this mc some of the layers are pushed back in Z space to create a parallax effect and on the main timeline the scene mc scrolls in relation to
the mouse position (much like this ) the scene mc is 5953px by 1716px and all the mcs contained inside consist of line drawn vector illustrations imported from illustrator. My problem is that when the scene is scrolling, every so often there is a delay were the scrolling slows down. It eventually catches up with itself causing it to jerk back to its original speed. When I test the movie and turn on redraw regions I notice that flash is having trouble redrawing some of the mcs.
I have tried optimising my mcs, turning cache as bitmap on the static ones and even replacing some of the static ones with bitmap versions but none of these seem to solve the problem. I was wondering if there is a solution to this or any other steps I can take to ease up on the redraw Also I am having a problem with the mcs breaking up as the scene scrolls, is there a way I can easily apply an anti alias to them?
View 1 Replies
Jan 16, 2012
Im pretty sure Im not going about this the right way... but anyways If you move to the left or right, the front triangle is supposed to have its points redrawn to locked positions inside the player, but for some reason it is leaving artifacts and Im sure its some redundancy in my script that I don't see...here is the script executing the redraw...
Actionscript Code:
function reDrawFront() { var temp=frontLockright.localToGlobal(new Point(0,0)); var temp2=frontLockleft.localToGlobal(new Point(0,0));
[code]....
View 2 Replies
Apr 7, 2010
I want my sprite to redraw when the information in my comboBox is changed but I cant figure out how to do it. I've tried a variety of things with no luck so I've deleted my attempts and below is my code how I want it to work with the exception that how it is now just draws the sprite on top of the other one instead of replacing it (or resizing it??).
import fl.data.DataProvider; import fl.events.ComponentEvent;
var items:Array = [ {label:"Select your Waterway"},
{label:"Klamath at Orleans", data:klamath_orleans},
{label:"Scott at Fort Jones", data:scott_fort_jones},
{label:"Redwood Creek", data:"redwood_creek_hwy299"},
[Code] .....
View 1 Replies
Dec 7, 2011
Is there a way to instantaneously force a redraw? I am using a Timer and I want it to update the screen between frames.
View 3 Replies
Jan 10, 2011
I have an app w/ a login screen. When the user hits "enter", the state changes to "login" & a child component is triggered to load (though the child stays invisible at the moment). The child contains many functions that the user needs upon logging in (ie their screenname & settings are retrieved from a database). The following is included in 'Parent':
<local:comp id="localComp" includeIn="login" includeInLayout="false" visible="false"/>
<mx:Button label="login" click="currentState='login'"/>
<mx:Button label="logout" click="currentState='Default'"/>
My problem is when a user logs out (state changes to 'Default') & then logs back in (state changes back to 'login') the child doesn't get "triggered" again & the functions w/in the child don't reload. Is there a way to force my child to refresh?
Note: While it would be easier to just move the child's functions to the parent it is complex...I moved these functions to the child to make it easier to follow
UPDATE: I even tried adding an "exitState" to my state:
<s:State name="login" exitState="removeElement(localComp)" />
This doesn't work either, as I get an error: "RangeError: Index 0 is out of range."
UPDATE: Even though you are allowed to call a child's function from a parent, my problem is that the child needs to be "created" in order to not show errors. It makes no sense to me why the flex team would make something like removing & adding children so complicated.
View 3 Replies
Jan 8, 2012
My question is: how do I redraw a shape using only code? Short comment on the task itself. I've an eventListener, which grabs clicks on stage and stage resizes. Both execute the same function - redrawEvents(evt:Event). The stage contains a number of blocks, which represent certain events. On each redraw these blocks are repositioned, and also lines (which represent connections between events) are drawn.
Any way to reposition all the blocks, but I got stuck on redrawing lines. I'm using a single shape to hold all the lines, because lines, unlike blocks, are not interactive. Since the whole point of the application is creating sets of interconnected events, I have to modify this shape every time a new block is created, which also calls redraw function. Here's the code I use to modify the shape
stage.addEventListener(MouseEvent.CLICK,redrawEvents);
function redrawEvents (evt:Event) {
var lines:Shape = new Shape();
lines.graphics.lineStyle(2, 0xFFFFFF, .75);
lines.graphics.clear();
for (var k:int = 0; k < connections.length; k++){
lines.graphics.moveTo(eventList[connections[k][0]].x + 50, eventList[connections[k][0]].y + 50);
lines.graphics.lineTo(eventList[connections[k][1]].x + 50, eventList[connections[k][1]].y + 50);
} addChild(lines); }
However, whenever the shape is modified, it still leaves the 'older versions' of itself on screen, and i don't want that. I tried to create and delete instances, various type conversions.
View 2 Replies
Dec 27, 2009
I've been trying to get the hang of working with bitmaps. I can redraw them using draw(), and after some trouble managed to redraw an externally loaded file using copyPixel(). What I can't do is redraw several images loading from XML.[code]...
View 3 Replies
May 11, 2010
I have two columns: the left one is a Canvas containing an mx:Tree and the right one is a Canvas containing a Canvas (to allow for scrolling) of some custom Sprites that go along with the tree nodes on the left. I made the right Canvas scrollable (horizontal and vertical) and I want the vertical scroll to also scroll the left Canvas so that the tree nodes line up with their representations on the right. The scrolling portion works fine and when I embed with wmode="window" there are no problems. Unfortunately, the customer requires dynamic HTML to overlap the Flash at times and when using wmode="opaque" or "transparent", there are issues. The scrolling still works, per se, but Flash does not seem to redraw either Canvas appropriately. The Canvases become out of sync and artifacts often remain on the right side.I catch a scroll event on the right column and update the scroll position on the left column like so:
public function onTimelineScroll(scrollEvent:ScrollEvent):void {
leftColumn.verticalScrollPosition = rightColumn.verticalScrollPosition;
}
[code].....
View 1 Replies
May 11, 2010
I have a problem with redrawing in flex 4. I have a spark titleWindow, and if i drag it faster, it looks like it's mask is one frame late after the component. it's easily visible with 1pixel thin border, because it becomes invisible even with slower movement.
You can try it here (what is not my page, but it's easier to show you here than uploading example):[URL]..
If you move in direction up, you see disappearing top border. in another directions it's not that sensitive as it has wide shadow, and it's not very visible on shadow. On my computer i see it on every spark TitleWindow i have found on google, although it's much less visible with less contrast skins, without borders or with shadows.
View 2 Replies
Mar 23, 2011
Suppose I have a component and want to change it's focus color at runtime. Here's an example for you (I've excluded any buttons and such to prevent component from losing it's focus, cause in that case it changes it's color perfectly):
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script><![CDATA[
private function init():void {
[Code].....
What do I want: How to make this focus to be redrawn without magic (I've tried all the methods, starting with "validate", I've tried calling updateDisplayList() on entire application, I've tried to call styleChanged .
View 1 Replies
Apr 20, 2011
I'm removing an UIComponent but parts of it last being visible. It redraws only when I move mouse around or something. I tried to do validateNow() on its parent, tried to do setTimeout(validateNow, 100) but it doesn't help. When I call it by setTimeout it seems these artifacts shown more rarely but it doesn't solve a problem in all cases. Please guide me someone to read about validateNow(), how it works and how to make these things correctly.
The code is below:
protected var bubble: SpeechBubble;
// creation
bubble = new SpeechBubble();
[Code]....
View 3 Replies
May 17, 2011
I am just starting to learn flash/actionscript 3 and decided to code up a simple particle simulator.The very initial design simply involves filling the screen with a buncha particles which scatter away from the cursor if you were to click.This works, but is a bit unresponsive. I am using graphics.drawCircle() to draw the particles, and each particle is inherited from Sprite.
Listener for mouseclick event:
private function mouseClick(e:MouseEvent):void
{
trace("click");
var now:Date = new Date();
trace("Before: "+now.getTime());
[code]....
How should I make this more efficient? I plan on doing collision detection and other physics interactions later, and this is already a bit slow even without the hefty number crunching code I intend to add later.
View 2 Replies
Dec 19, 2011
I have an flash swf on a page loaded with object/embed tags.
<object width="565" height="300" >
<param name="movie" value="/swf/Sample-Elf.swf">
<param name="wmode" value="transparent">
<embed src="/swf/Sample-Elf.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" width="565" height="300"></embed>
</object>
I need to be able to start/stop or reload this swf with purely javascript as I don't have access to the source swf file to add any actionscript.I figured the easiest way to pull this off is by removing the element and replacing it forcing a redraw with would hince reload the swf movie. Though ie seams to cache the flash element and pretty much look over any updates I make to the embed/object tags and keeps right on going.So how do I force IE to redraw/update a flash element on a page?
View 1 Replies
Dec 27, 2011
When the list item label is changed, the list doesn't redraw until I hover the mouse over changed item. I've tried invalidate & redraw but they didn't work:
//myList is an instance of mx.controls.List component
myList.getItemAt(0).label = 'New Label';
myList.invalidate();
myList.redraw(false);
How to force the list to redraw in this case?
View 1 Replies
Jan 12, 2011
I am working on a character terminal emulator. Glyphs are 8x8, 1bit raw bitmaps There are 256 glyphs in the palette. A character buffer is a grid of single bytes, referencing the various glyphs in the palette 256 glyph palette.Essentially a character buffer is a big blocky bitmap, only instead of pixels it has glyphs.Rendering the character buffer is a rather quick, self-contained job in theory. The memory required is very low and the execution time is similar to a hardware blit.
It is redundant to have a 'back buffer', i.e. a BitmapData to store a rendering of the character buffer. it's too costly in memory and way overkill for the complexity of what is being rendered.I want to know if it is possible to feed data to the video memory similar to the way it is done with SampleDataEvents. I do not want to store a redundant BitmapData object since some of these character buffers are huge and rarely need to be rendered all at once. They only need to be 'invalidated', i.e. they only need to update small portions at a time as they are 'exposed'.
I have searched high and low and read the manual a million times. The closest thing I could find were the stage.invalidate() and RENDER events, but they don't seem to give me a rectangular area to feed data to. I also tried extending Bitmap, but could not figure out how to override it's default behaviour of reading pixels from a BitmapData.An example of what I'm doing can be found when using GTK's DrawingArea widget and it's 'expose' events, used for very fast rendering.
View 2 Replies
Mar 24, 2011
I'm having a problem that involves scrollRect and getBounds. In short, getBounds is reporting an old value not accounting for scrollRect changes during that frame. Example:
ActionScript Code:
var shape:Shape = new Shape();
shape.graphics.beginFill(0);
[code].....
View 3 Replies
Oct 6, 2011
So I have chess like game, where I place my piece (c[i]) on the board, the piece automatically gets pushed into a square, and the AI starts (computerplay function)
The problem is that the AI (computerplay function) is running before the piece get pushed into the nearest square, leaving it hanging oddly over the board for 3 seconds while the computer thinks.
Is there some way to force a redraw before the calling the computerplay function?
xxx=Math.round((c[i].x-80)/38.5);
yyy=Math.round((c[i].y-92)/35.5);
c[i].x = xxx * 38.5 + 80;
[Code].....
View 5 Replies
Mar 17, 2010
I have a component I have built in AS3 that takes a parameter which is likely to change with each instance of the component on stage. ie. the parameter will be different on frame2 to what it was on frame1.
The problem I am having is that flash will not recognise the change of parameter and redraw the component unless I do something like giving it a different instance name or putting it on a new layer. I find this very puzzling as I have the exact same component in AS2 and am not required to perform these actions to get it working.
View 2 Replies
Jul 13, 2010
I've got a small action-script chart, that's meant to be live updating, and also be able to support more than 10000 points of data. The way it's currently set up it doesn't need to redraw the whole chart if the new line we wish to add doesn't extend that chart's boundaries. Yet it does, the redraw regions show the whole chart as being redrawn as opposed to the single line i need to add. When the chart gets a new piece of data from the javascript it does the following.(some stuff has been stripped for clarity.[code] Is there any better way to do that, that won't redraw the whole screen? Is my coding pattern wrong for this type of update?
View 1 Replies
Dec 20, 2010
I'm trying to capture the redraw event for some MovieClip / Sprite objects that are in a Scroll area.Ideally, should be able to capture the event when Flash Player itself redraws the objects as can be seen with "Show Redraw Regions" in FP Debug.I've tried to use the Event.RENDER to capture this, but it even fires when the object is not visible / redrawn.
View 1 Replies