# \[Flash8\] Can I use LoadVars.sendAndLoad to get an image?

**URL:** <https://forum.kirupa.com/t/flash8-can-i-use-loadvars-sendandload-to-get-an-image/226087>\
**Category:** flash\
**Created:** [May 18, 2007, 1:16am UTC](https://forum.kirupa.com/t/flash8-can-i-use-loadvars-sendandload-to-get-an-image/226087 "2007-05-18T01:16:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![canaryhijinks](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@canaryhijinks](https://forum.kirupa.com/u/canaryhijinks)\
**Post date:** [May 18, 2007, 1:16am UTC](https://forum.kirupa.com/t/flash8-can-i-use-loadvars-sendandload-to-get-an-image/226087/1 "2007-05-18T01:16:31Z")

</div>

From what I understand, LoadVars.sendAndLoad( ) is generally used to request variable data form a server. I am trying to download an image (which can be returned to me as a bitmap, jpeg, or png depending on my a variable i pass to the server in the sendAndLoad command.

Is this possible? If so, what object do I specify as the target object in the sndAndLoad( ) command?

I am using the following code currently:

var lvRequest:LoadVars = new LoadVars( );  
lvRequest.onLoad = assetOnLoad;

var lvReply:LoadVars = new LoadVars( );  
this.createEmptyMovieClip( “mcImage”, this.getNextHighestDepth( ) );

// asset request  
var sAsset:String = new String( “[http://fakeserver.com/fakefolder/asset.do?format=1&src=/2007/121/11/24/1178043887117\_1872550915\_Natosha&optimalWidth=160&optimalHeight=120](http://fakeserver.com/fakefolder/asset.do?format=1&src=/2007/121/11/24/1178043887117_1872550915_Natosha&optimalWidth=160&optimalHeight=120)” );

lvRequest.onLoad = assetOnLoad;  
lvRequest.sendAndLoad( sAsset, lvReply, “POST”);

function assetOnLoad( success:Boolean )  
{  
if( success )  
assert( “asset:” + this );  
else  
assert( “asset: failure” );  
}

im not even getting the callback right now, any help would be appreciated. I’ve tried using a BitmapLoader, an empty movie clip, and a LoadVars variable.

any ideas?
