Skip to main content
YesheadIntruder
Participant
August 29, 2016
Answered

Resourestrings in flash CS6 AS3

  • August 29, 2016
  • 2 replies
  • 243 views

I'm using flash professional and trying to learn to make games.

Wat I want is a multi-language game and therefore using resource strings.

After searching a long time I only find ResourceBundle for FLEX but I have flash cs6.

What I also find is that you can make subdirectories of the language such as "en_US" and in this direcortoy a file "resource.properties" as the placeholder for my strings (textfile).

What I thought to do is something like "var rb:ResourceBundle = new ResourceBundle("en_US", "resource.properties")"

and than with "rb.getString("resource.properties", "stringname of the key in de file", null, "en_US")" find the translation I want.

So far I can't find anything thats helps me out or get me in the right direction.

Is there somebody who can explain how to use the resource string file in flash professional cs6 in as3?

Or a link to something that explains how I must use it?

This topic has been closed for replies.
Correct answer kglad

don't use that.

it won't work in any new versions of flash/animate and it never was that helpful in cs6.

just create an xml file containing your language strings and load that file at the start of your app.  when a language is selected by the user, populate a language object with the appropriate part of your xml file.

assign text using your language object.  eg,

xml:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>

<languages>

<english>

<text1>hello</text1>

.

.

.

</english>

<danish>

<text1>hej</text1>

.

.

.

</danish>

.

.

.

</languages>

2 replies

YesheadIntruder
Participant
August 30, 2016

thanx kglad for your answer.

Your suggestion sounds great and I will look deeper into that.

Perhaps the reason you mention is the cause of the little info there is about using resource string files.

kglad
Community Expert
Community Expert
August 30, 2016

you're welcome.

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
August 29, 2016

don't use that.

it won't work in any new versions of flash/animate and it never was that helpful in cs6.

just create an xml file containing your language strings and load that file at the start of your app.  when a language is selected by the user, populate a language object with the appropriate part of your xml file.

assign text using your language object.  eg,

xml:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>

<languages>

<english>

<text1>hello</text1>

.

.

.

</english>

<danish>

<text1>hej</text1>

.

.

.

</danish>

.

.

.

</languages>