#include Alternative

  • dann_the_van
  • Novice
  • Novice
  • dann_the_van
  • Posts: 23
  • Loc: South Wales, UK

Post 3+ Months Ago

Highly based upon TonyPA's tilemap games, i'm creating a mosaic of tiles to form an image.

however, tony usually uses a variable to plot the data, or has highlighted the use of an external file to be compiled via #include "something.txt".

now here's the problem.
I'm looking to get the published .swf file to refrer to that 'something.txt' file for the new data, everytime you visit the webpage.
Usually the #include compiler does it just the once at the moment it is published.
I've been trying to use the loadvars but after a few hours on it today, it's become a headache... :P
is there anyone that can think of a way around it.

I have tried loading data into a textfiled, and then use that text fileds'.text' to plot it, but still no luck.

----------------Here is my current code.---------------------------------

xPos = 100;
yPos = 100;
_root.MCWidth = 12;
_root.level = 1;
#include "mapNP.txt"
for (i="0"; i<map.length; i++) {
for (j="0"; j<map[i].length; j++) {
if (map[i][j] == 0) {
_root.attachMovie("square", "squareNP_"+i+"_"+j, _root.level++);
_root["squareNP_"+i+"_"+j]._x = xPos+MCWidth*j;
_root["squareNP_"+i+"_"+j]._y = yPos+MCWidth*i;

}
}
}
stop();

------------------------------

As you can see it uses the #include handler to refer the once to the file 'mapnp.txt'


here is the files should you need them.
http://www.addiconuk.com/Danny/help.zip
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • dann_the_van
  • Novice
  • Novice
  • dann_the_van
  • Posts: 23
  • Loc: South Wales, UK

Post 3+ Months Ago

hi guys,

i'm still trying this with loadVariable(). Is this possible?
I can easily get it to plot the MC "square" as many times as 0's apper in the #include compiled actionscript; but it's not working at all for the loadvars.

even if i create a loadvars function. It's like it doesnt recognise them as variables, each 0, and 1 in the text file. What am i doing wrong?

it is easy to put the external file's content into a dynmaic text filed. Can variables be created this way, via the '.text' of a dynamic text field?

any help/guidance would be most appreciated :)

Thnx
Danny

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 7 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.