# Unable to solve these error!

**URL:** <https://forum.kirupa.com/t/unable-to-solve-these-error/294668>\
**Category:** flash\
**Created:** [August 18, 2009, 11:52am UTC](https://forum.kirupa.com/t/unable-to-solve-these-error/294668 "2009-08-18T11:52:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rashmi\_shri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@rashmi\_shri](https://forum.kirupa.com/u/rashmi_shri)\
**Post date:** [August 18, 2009, 11:52am UTC](https://forum.kirupa.com/t/unable-to-solve-these-error/294668/1 "2009-08-18T11:52:46Z")

</div>

I am trying create a displacement effect using this code, but i am getting these error, not able to solve it!:hr:

[COLOR=royalblue]import flash.display.BitmapData;[/COLOR]

[COLOR=royalblue]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);  
var source = new flash.display.BitmapData(128, 128, false, 128);  
var buffer = new flash.display.BitmapData(128, 128, false, 128);  
var output = new flash.display.BitmapData(256, 256, true, 128);  
var surface = flash.display.BitmapData.loadBitmap(“surface”);  
var bounds = new flash.geom.Rectangle(0, 0, 128, 128);  
var origin = new flash.geom.Point();  
var matrix = new flash.geom.Matrix();  
var matrix2 = new flash.geom.Matrix();  
matrix2.a = matrix2.d = 2;  
var wave = new flash.filters.ConvolutionFilter(3, 3, [1, 1, 1, 1, 1, 1, 1, 1, 1], 9, 0);  
var damp = new flash.geom.ColorTransform(0, 0, 9.960937E-001, 1, 0, 0, 2, 0);  
var water = new flash.filters.DisplacementMapFilter(result2, origin, 4, 4, 48, 48, “ignore”);  
attachBitmap(output, 0);  
var ms = getTimer();  
var frame = 0;  
var mouseDown = false;[/COLOR]

[COLOR=royalblue]onMouseDown = function ()  
{  
mouseDown = true;  
};[/COLOR]

[COLOR=royalblue]onMouseUp = function ()  
{  
onEnterFrame();  
mouseDown = false;  
};[/COLOR]

[COLOR=royalblue]onEnterFrame = function ()  
{  
if (mouseDown)  
{  
var loc2 = \_xmouse / 2;  
var loc1 = \_ymouse / 2;  
var loc3=loc2+1;  
var loc3a=loc2–1;  
var loc4=loc1+1;  
var loc4a=loc1-1;  
trace(loc3)  
source.setPixel(loc3, loc1, 16777215);  
source.setPixel(loc3a, loc1, 16777215);  
source.setPixel(loc2, loc4, 16777215);  
source.setPixel(loc2, loc4a, 16777215);  
source.setPixel(loc2, loc1, 16777215);  
}  
// end if  
result.applyFilter(source, bounds, origin, wave);  
result.draw(result, matrix, null, “add”);  
result.draw(buffer, matrix, null, “difference”);  
result.draw(result, matrix, damp);  
result2.draw(result, matrix2, null, null, null, true);  
output.applyFilter(surface, new flash.geom.Rectangle(0, 0, 256, 256), origin, water);  
buffer = source;  
source = result.clone();[/COLOR]  
[COLOR=royalblue]}[/COLOR]  
[COLOR=royalblue][/COLOR]

**[COLOR=red]Errors:[/COLOR]**  
**[COLOR=seagreen][COLOR=black]1.[/COLOR] Syntax error. var loc3a=loc2–1;[/COLOR]**  
**[COLOR=#2e8b57][/COLOR]**  
[COLOR=seagreen]**[COLOR=black]2.[/COLOR] Unexpected ‘}’ encountered }**[/COLOR]  
**[COLOR=#2e8b57][/COLOR]**  
**[COLOR=#2e8b57][/COLOR]**
