Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-09-2008, 04:45 PM   #1
xWouterx
Registered User
 
Join Date: Dec 2007
Posts: 25
Default mx:Image problem

Hello

I have a silly problem and I'm looking for an easy answer

I have an image component in my application and I wanted to set the source which I did like this:
Code:
<mx:Image id="movieImage" source="../../assets/movieImages/300.png"/>
That didn't work so I changed it so that it would work like this:
Code:
<mx:Image id="movieImage" source="@Embed(source='../../assets/movieImages/300.png')"/>
Ok so I've got that... Now I want to set the source via actionscript 3 code so I tried the following 2 things:
Code:
movieImage.source = "../../assets/movieImages/300.png"
and
Code:
movieImage.source = "@Embed(source='../../assets/movieImages/300.png')"
They both did not work... Does anyone know how to set the source of an image via code?

Thanks
xWouterx is offline   Reply With Quote
Old 06-09-2008, 06:06 PM   #2
wGrand
Member
 
Join Date: Feb 2007
Location: Boston
Posts: 43
Default

movieImage.source = "" should work. I think the problem is related to the same reason that <mx:Image /> didn't work. <mx:Image /> should have worked for you
wGrand is offline   Reply With Quote
Old 06-09-2008, 06:14 PM   #3
xWouterx
Registered User
 
Join Date: Dec 2007
Posts: 25
Default

Quote:
Originally Posted by wGrand View Post
movieImage.source = "" should work. I think the problem is related to the same reason that <mx:Image /> didn't work. <mx:Image /> should have worked for you
Sorry... I seem to have missed your solution. Could you please rephrase it a bit?
xWouterx is offline   Reply With Quote
Old 06-09-2008, 06:24 PM   #4
wGrand
Member
 
Join Date: Feb 2007
Location: Boston
Posts: 43
Default

There shouldn't be anything wrong with movieImage.source = ""; I think the reason that it's not working for you is related to the same reason that <mx:Image /> isn't working for you.

And, <mx:Image /> SHOULD work, but you said it doesn't. So, I imagine the problem it is related to something else in your code, or that the image doesn't exist in that path, or something.

Last edited by wGrand; 06-09-2008 at 06:26 PM.
wGrand is offline   Reply With Quote
Old 06-09-2008, 06:32 PM   #5
xWouterx
Registered User
 
Join Date: Dec 2007
Posts: 25
Default

Hmmm yeah.. well maybe I just have to wait till I start my clean project... Just programming till everything works and then start over to clean up the code... Might get better then
xWouterx is offline   Reply With Quote
Old 06-10-2008, 08:40 PM   #6
xWouterx
Registered User
 
Join Date: Dec 2007
Posts: 25
Default

problem solved... Had to do with the fact that it was an AIR application
xWouterx 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with mx:Tile and mx:Image - Possible Bug webninja Flex 2, 3 & 4 9 04-05-2006 09:47 AM
maybe a caching problem? kath421 ActionScript 2.0 4 03-21-2006 05:41 AM
Problem with loading unloading clips and dynamic text sah302 ActionScript 1.0 (and below) 1 01-06-2006 05:19 PM
HEEELP!!! cant work out the answer to a problem case ActionScript 1.0 (and below) 1 07-29-2003 11:37 PM
global TextField Problem! Guru wonted mediaholic ActionScript 1.0 (and below) 3 07-20-2003 10:07 AM


All times are GMT. The time now is 11:21 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.