ActionScript 3.0 :: Apply Displacement Mapping To Every Frame?
Oct 6, 2011
I'm using this tutorial to create buttons with displacement mapping for my simple game menu. These buttons need to be clickable; i.e. once you click on them you move to a different frame. Everything works fine on the first frame, but when I click to the next frame the displacement map disappears and will not apply to the buttons on that frame. Plus, when I click my "back" button to return to Frame 1, the displacement effect has disappeared entirely.
This is the code which is in the base "Game" class, which links to the main Flash file.
It calls the JitteryButton class, another external class, which I don't think is the problem, but I can post if if necessary. It's very similar to the one in the tutorial. Also, I need to add different buttons on other frames of the menu, but if I call them in this external class, it doesn't recognise them.
can anyone spot why this might stop working like it does? I was thinking about instead of using "Game" as an external Actionscript file, I could actually write it into Flash as Actionscript on a layer - would this work?
The way my test works, I draw a path on a displacement map using the mouse, and this displacement is applied to the same image every frame (i.e., the displaced image of the last frame is displaced again). Colors are flowing along the path as they should, with one problem: the displaced pixels always turn transparent after a few seconds.At first I thought this had something to do with the DisplacementMapFilterMode, so I tried setting it to "COLOR" using an opaque bright blue, while the stage behind my warped image is a highlighter green. Nope, the FilterMode color is only used for pixels sampled off the image, while my interior pixels were turning completely transparent of their own accord. I tried removing the alpha channel from my distorted image, and then the pixels would just turn black instead of transparent.
So, now I'm stumped. I've viewed my displacement map to make sure it looks right, I've tried setting the displacement scale to low and high numbers, and I've checked the channel assignments, all to no avail. Here's my code, and I've attached the .fla as well, so you can see what's happening. If you run the file, just make your mouse is located in the center of the frame before it starts, or you'll end up dragging the blue fill color in from off the screen.
Code: // "spider" is the name of a named movie clip instance containing // an image on the stage, having the same dimensions as the stage
I am using action script 3 and need to know how to apply more than 1 action to a frame label, ie; I have 5 pages of images and have actions coded as follows:
btn1.addEventListener(MouseEvent.CLICK,play1); function play1(event:MouseEvent):void{ gotoAndStop("1Lrg");
I have a show I'm trying to create, I need to put the navigation buttons on different places on each frame due to content.
Code: on (release) { prevFrame(); } or Code: on (release) { nextFrame(); } and Code: on (release){ gotoAndplay("Scene1")}
I can get the symbols that I'm using as buttons to work in the first and second frame, but they will not work after that. Each frame has a Code: stop (); Action applied to it.
I have tried: copy and pasting the same symbol into multiple frames, dragging new symbols into multiple frames, creating folders for each frame and dragging new symbols into those folders then onto a frame, and I'm still not having luck. This presentation is set up to run in Flash 9 with Bottom up loading order and ASP2
I've got various mc's sitting inside my overall site. The FPS of the overall site is 20 but I want to run another mc inside it at 10 and different one at 28.Is this an actionscript task or is there another way of doing it?
i have a function which when the space bar is pressed it goes to a different frame. However the function can still be performed on different frames, how can i make the code only apply to that frame?
ActionScript Code: function spacebarGoto(event:Event){ if(pressSpacebar){ gotoAndStop("start"); } }
I've tried in vein to understand displacement maps; I can find nothing on "The Internet" that teaches me what I need to learn. Now I'm looking to all you smart-types to solve my problem for me! All I want to is take an image (a rectangle) and make it look like it's going off into the distance (trapezoid-like), getting smaller from left to right. This doesn't even need to animate, I just need two states: straight-on and trapezoid-like -- think iTunes album art browser minus the bells & whistles. I know this can be accomplished with a displacement map, but I know not how to get 'er done.
I have an mc that is displaced. Within this movie clip is a text box that moves about but it is being displaced along with the rest of the mc. Is there anyway to find a position inside the displaced mc and translate that to root coordinates.
I am trying create a displacement effect using this code, but i am getting these error, not able to solve it!import flash.display.BitmapData;
var damper = new flash.display.BitmapData(128, 128, false, 128); var result = new flash.display.BitmapData(128, 128, false, 128); var result2 = new flash.display.BitmapData(256, 256, false, 128);
I'm trying to use the displacement filter with a jpeg image instead of a gradient map. My images are: 1) Background: men2.jpg 2) Map image: men2BN.jpg (same as above, but grayscale and blurred) 3) The image to be displaced: star5_mc
I'm using a DisplacementMapFilter to created a globe-like effect on a flat map. My problem is, I also want to sync some labels to this map. I have the x/y coordinates for their locations on the flat map, but I need to map them to the now-displaced image.
I would like to be able to do this using the BitmapData that contains the displacement map, so that changing the Bitmap changes both the displacement filter and the label locations. Also, the labels will not be static, and accuracy is fairly important.
i got this script from this tutorial. I tried to convert it from AS2 to AS3, but it seems like the displacement filter is only applied once for some reason. After that, the bitmap isn't updated.[code]
I am trying to make displacement map for perspective correction, but so far my math goes wrong. Here's what I've got; as you see, some lines are not preserved.
I had a quick question about displacement... I just have a circle that changes shape and size and I wondered if there was a way to apply some kind of displacement filter to it, so that ANYTHING under this circle movieclip is distorted by the displacement. (think of a magnifying glass).
i am trying to make my text appear wavy using displacement maps. i've attached the file. Please check it out and tell me how to do the following three things with it:
i need to ensure that the text doesnt get cut at the top when it goes out of bounds.i need to create a gradient with more variations. that is, right now its going from 0x000080 to 0x0000FF to 0x000080. so i need to make it go like: 0x000080 - 0x0000FF - 0x000080 - 0x0000FF - 0x000080.i need to be able to vary the size of the gradient box so that it perfectly fits the movieclip that i apply it tohow do i do it? could anyone please make those changes and attach the file back? or just tell me how to do it?
I'm trying to make a plasma fractal (as a self-challenge, I made the sierpinski triangle, Koch snowflake, Mandelbrot set, Julia set, and dragon fractal. If you want the code, PM/reply.) Here's the code of frame 1:
By typeing the text in the input box while staying on frame1, DOSEN'T show on the dymanic_text_box2 on frame 5?? How to make the dymanic_text_2 apply it's text when the text is been typed staying on frame 1?
I have a multilingual project (currently 13 languages), which uses many different font variations of "Helvetica Neue", mostly bold, condensed and regular cuts from the LinoType Pro font set ( which includes western european characters) and the same for cyrillic. We will probably add chinese and japanese variations in the future. I have set up the project to use different CSS stylesheets and separately load the fonts for each version, depending on which language the user selects, so I can have different line heights, kerning and/or font sizes to make everything keep the original look, even if the fonts look nothing alike.
All of this works well, except for one problem: For some reason, all cyrillic letters seem to be displaced. They appear 2-3 pixels below the correct base line, and actually protrude across the textfield's bottom border, even when the field is set to autosize. When I use textfield.getCharBoundaries(), all values seem to be correct, even though they obviously aren't rendered correctly.To make everything look neat, I could of course manually move all problematic textfields up or down according to language and font size, but I was wondering if there was some way to prevent or at least detect this kind of displacement in order to automatically handle the adjustments - the Flash Player should have some sort of information on how things are rendered, shouldn't i
I found a tutorial on how to make a cool water effect in as3 using bitmap data and a displacement filter. It works great but it is very heavy on the computer.
here is my code
Code: var bmd:BitmapData = new BitmapData(700, 398); var dmf:DisplacementMapFilter = new DisplacementMapFilter(bmd, new Point(0,0), 1, 2, 10, 30); var p1:Point = new Point(0, 0); var p2:Point = new Point(0, 0);
Etiam nisi ligula, sodales non, pharetra eget, tempus ac, purus. Vivamus sagittis mollis risus. Proin dictum libero a elit. Curabitur feugiat, metus sit amet convallis imperdiet, est tortor volutpat nulla, eget mollis diam nisi vel lacus. In diam ligula, euismod eu, dapibus non, fermentum quis, urna. In consequat pede eget erat. Quisque luctus felis. Mauris dignissim. Fusce pulvinar, dolor sit amet porttitor egestas, quam massa tristique pede, nec porttitor diam odio in magna. Mauris congue mauris eu lectus. Duis eu felis ut ligula consectetur blandit.
<?php error_reporting(E_ALL | E_STRICT); //error reporting, not needed require_once "Zend/Amf/Server.php"; //the zendAMF server require_once "process.php"; //our test class
I'm building image processing or mapping system kinda like google map except we have our own HD images so i'm not sure what is the best way to do this in .NET here is what im trying to do Mapping web application build in .NET i've High resolution images , the user first load the selected area a full scaled image should be loaded 100% (original image) then he Zoom to the area he want, then he can move around this area almost like google map
1.user select area - full scaled image loaded
2.user zoom to random area - (i will receive some values for X, Y, etc.. in query string then i will extract these values and zoom/return the image based on these values)
So i'm not sure what is the ideal solution for this is it just zoom/re-size image based on the vales received from the user, or its more complicated than that?
which is the best flash mapping api (with good support and reasonable price) to use in my flash project. I have used UMapper �s Umap before but it�s too expensive for a commercial license and the support was not that good.
I'm new to flash and working to embed the flash player in a .NET application. It's going "well" for the definition of "well" that adding the COM control and getting it to play a movie was easy and took about 3 minutes.What's not going well is that I cannot find documentation on the variable to string mapping used the SetParameter variable parameter. To coordinate between the apps, I want to be able to say: "flashPlayer.SetVariable("flash_variable", "value_to_set"). Obviously SetVariable does this. What's not obvious is how "flash_variable" is constructed.
For example, in the actionscript for a button called "OneBigButton" I have the following code:
I'd love a pointer to the documentation on how namespaces, class instances, etc affect the string construction used in SetVariable and GetVariable as I can't find it anywhere.
When I login a new session is generated. How can I later know for which login the session was generated? I am getting the session value, but how do I know which user the session is for and redirect him to that page?
I am building an application using Flex 4.5 and Zend_AMF as my AMF endpoint.I would like to map a class called CRequest in PHP to a class called Request in Flex.This is my php class:
Dear goodness, am I the only person on the web trying to send a VO object from Flash to AMF where the properties are read only/getters? If I add a setter that does nothing but throws an Error it works. If no setting is present in Flash, it fails. Is there a way to send objects to AMF that have getters and not setters?