Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-15-2008, 01:12 PM
Junior Member
 
Join Date: Dec 2008
Posts: 4
Default Image.load not working with Flex!

The following code gets me zilch in my flex app. Is there an issue with Flex/AS3 or is there another method.

var image = Image.load("c:\\test.jpg");
trace(image.width);
trace(image.height);
Reply With Quote
  #2 (permalink)  
Old 12-15-2008, 01:45 PM
Junior Member
 
Join Date: Dec 2008
Posts: 4
Default

I have downloaded and saved to disk a handful of images. I must now display those images on the screen and I'm having difficulties getting to this point.
Reply With Quote
  #3 (permalink)  
Old 12-16-2008, 08:56 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Please copy the swfkit wrapper classes into your flex project directory, and import them by using the following code

Code:
import SWFKit.*;
The wrapper classes are in "c:\program files\swfkit pro\classes 3".

If you still cannot make it work, please send your project to us (support@swfkit.com), we'll help you to solve the problem.
Reply With Quote
  #4 (permalink)  
Old 12-16-2008, 02:28 PM
Junior Member
 
Join Date: Dec 2008
Posts: 4
Default

Here is a demo app that does not work. My SWFKit folder is in the root. I should also mention that all of my other code using the SWFKit extensions DOES work! So far it's only the images that don't work.

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute" 
	creationComplete="creationComplete();"
>


	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;

			import SWFKit.*;

			private var testImage:SWFKit.Image = SWFKit.Image.load("c:\\test.jpg");

			private function creationComplete():void {
				debug.text += "\r" + "Image: " + testImage;
				debug.text += "\r" + "width: " + testImage.IsValid();
				debug.text += "\r" + "width: " + testImage.width;
				debug.text += "\r" + "height: " + testImage.height;
			}
		]]>
	</mx:Script>

	<mx:TextArea id="debug" top="10" left="10" bottom="10" width="350" text=" -------- Application Debug Log -------- " fontSize="14"/>

</mx:Application>

Last edited by Russell2566; 12-16-2008 at 03:07 PM.
Reply With Quote
  #5 (permalink)  
Old 12-19-2008, 12:04 PM
Junior Member
 
Join Date: Dec 2008
Posts: 4
Default

Looks like we find another solution and don't buy SWFKit.
Reply With Quote
  #6 (permalink)  
Old 12-19-2008, 08:41 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Your code works well, but you must set the swfkit wrapper classes properly, as shown in the attached images.
Attached Images
File Type: gif fleximg.gif (9.8 KB, 12 views)
File Type: jpg flexsrc.jpg (19.2 KB, 12 views)
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:30 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.