Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-12-2008, 11:50 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Ini file problem

Heres what i use (copied from forums)

Quote:
import SWFKit.*
var ini = new Ini("d:\\fil.ini");
var scroll_speed = ini.getString("MAIN SETTINGS", "scroll_speed");
trace(scroll_speed);
and
Quote:
[MAIN SETTINGS]
scroll_speed=10
wii_mouse=true
When i test my application, i get null in trace (and [object Object] when trace(ini) ) :S ive been testing in many ways and examples but it seems, i cant read ini files, nor write

what to do ? :S
Reply With Quote
  #2 (permalink)  
Old 01-12-2008, 06:10 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Ini file problem

The code can only work with swfkit. That is to say, you will have to add the swf movie into swfkit. Therefore, the trace method does not work, you will have to use Global.trace instead. Then the code will work well.
Reply With Quote
  #3 (permalink)  
Old 01-12-2008, 06:47 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: Ini file problem

yes i got stuck at flash output and thought it didnt work, jsut stupid that i had forgotten i need to run the swfkit project

and yes, it works perfectly

But how about Diskinfo ??? i saw in the manual
di.diskinfo() something.... what exactly is di ?
Reply With Quote
  #4 (permalink)  
Old 01-12-2008, 11:31 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: Ini file problem

Code:
var fil = "C:\\Documents and Settings\\dk.PCHOME\\Mina dokument\\Flash project\\sets.ini";
var iniFil = new Ini(fil);
var fil_exists = File.exists(fil);
function laddaInstallningar() {
	if (fil_exists == true) {
		_global.fil_namn = iniFil.getString("KLNT_GLOBAL", "FILEN");
	}
}
tfelt.text = _global.fil_namn;
Global.trace(_global.fil_namn);
Both trace an textfield give me Undefined... why ?


Code:
[CLNT_GLOBAL]
NETADR=http://localhost/
NAME=dex.php
evenif i want to publish this key in a textfield in flash i get undefined
Reply With Quote
  #5 (permalink)  
Old 01-19-2008, 09:57 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Ini file problem

You are trying to fetch something nonexistent in the ini file (KLNT_GLOBAL, FILEN)
Reply With Quote
  #6 (permalink)  
Old 01-20-2008, 12:49 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: Ini file problem

Im sorry for the trouble i caused, i finally managed to solve the problem!

Thank you for your reply!
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 04:48 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.