Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-26-2009, 07:44 PM   #1
boomberacun
Registered User
 
Join Date: Aug 2009
Posts: 3
Default loading external image over flash lite 2.0

somebody help me to share actionscript to load external image (from mobile device directory) over flash lite 2.0...
thanks
boomberacun is offline   Reply With Quote
Old 08-27-2009, 07:43 AM   #2
Thommas
Senior Member
 
Join Date: Mar 2009
Posts: 117
Default

Here you are :

Create a movieClip named "mc".

Use this code :
Code:
var mcl : MovieClipLoader = new MovieClipLoader();
var mclListener : Object = new Object();

var file : String = path + filename;

function init() : Void
{
	mclListener.onLoadError = imageLoadError;
	mclListener.onLoadInit = setImageAnimation;
	mcl.addListener(mclListener);
}

function setImageAnimation(mc : MovieClip) : Void
{
    // you can set image according to mc._width and mc._height.
}

function imageLoadError(mc : MovieClip) : Void
{
	debug.text = "\nError ON LOAD !\n";
}

function loadImage() : Void
{
	mcl.loadClip("file://" + file, mc);
}
Thommas is offline   Reply With Quote
Old 08-30-2009, 04:14 PM   #3
boomberacun
Registered User
 
Join Date: Aug 2009
Posts: 3
Default

Thanks, master...
I'll try it and post the result
boomberacun is offline   Reply With Quote
Old 08-30-2009, 09:09 PM   #4
boomberacun
Registered User
 
Join Date: Aug 2009
Posts: 3
Default

Im sorry, master...
For example i want to load image from:
Phone/picture/wallpaper

Image name:
Flower.jpeg

How to set it to
Code:
var file : string = path + filename;
And
Code:
mcl.loadClip("file://" + file, mc)
Thanks
boomberacun is offline   Reply With Quote
Old 08-31-2009, 08:29 AM   #5
Thommas
Senior Member
 
Join Date: Mar 2009
Posts: 117
Default

On Windows Mobile phones :

var file : string = "file://" + "SD Card\My Documents\My Images\" + "Flower.jpeg";
mcl.loadClip(file, mc);

On Symbian phones :

var file : string = "C:\Images\" + "Flower.jpeg";
mcl.loadClip(file, mc);

You just have to check in your file browser to get the good absolute path.

Relative path works as well I think :

var file : string = "Flower.jpeg";
mcl.loadClip(file, mc);

With "Flower.jpeg" in the same folder as your .SWF
Thommas is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:06 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.