KEYDOWN running slow for LoadVars movieclips. help please!

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

Post 3+ Months Ago

Please help me on this problem concerning keydown movements that are running slow!


I haven't used listeners for my keydown statements, just seemed pointless at the time. however, has anyone had any problems with key movememnt in an exported SWF, when viewed in safari on a mac. i'm using os x and there shouldn't be a problem.

the movieclips in question load information via loadVars of external text files... is it the loadVars process, that is slowing them down?.. sometimes, more often now, the movieclips that have loaded the info, move faster than those that haven't...

lets say, for example, i put 100 movieclips on the stage, all grabbing information from a txt file of it's name... (mc1--->movieclip1.txt).. and when i press a key to move them all at once, those which haven't loaded fully, move at around 0.1 speed! the rest are flying along!?

any ideas!? pointers etc!?
I know i could put a load bar on, but was hoping that there was an easier, quicker way to do this directly.
the information in the textfiles is only what frame to play.. shouldn't take that long..
EG. startframe=3. <---- a typical contents of the text file!

Please help.
Thanks,
danny
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

All in all running 100 load vars + initializing 100 clips + moving 100 clips sounds like good way to kill any flash player (esp if your using an older player on the mac)

I would try 2 things. Either put all the "frame to play" stuff in one file and loop through it. (You could use xml or a text file) or use a listener on the last load vars command, I assume movieclip100.txt, and wait until its loaded before you allow anything to move.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

better wait untill all the info is loaded, then start the movement
  • dann_the_van
  • Novice
  • Novice
  • dann_the_van
  • Posts: 23
  • Loc: South Wales, UK

Post 3+ Months Ago

yer, i'm thinking of using the same priniciple to create a 'green' light moveclip to indicate when it's fully loaded.. and then allow the movement to work.

Also, Can you attach a (.as) to another movieclip, from another!?

thanks guys,
Danny
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

to attach a class to another movieclip from another? not sure i understand what you mean
  • dann_the_van
  • Novice
  • Novice
  • dann_the_van
  • Posts: 23
  • Loc: South Wales, UK

Post 3+ Months Ago

Hi IceCold,

if i was to click on a movieclip that on the stage, that action would assign (#attach) a script to another targetted movieclip. On my first flash project, i was applying the script to the movieclip on the timeline... not inside the movieclip! But i had problems duplicating that movieclip as it didnt duplicate the script over... I decided to do it via embedding the code inside the instance movieclip and still works today! this is how most flash is done right!? Embedding inside?

However, a student of mine who is working on a flash rugby portfolio is having trouble attaching codes to duplicate copies.. is it only by embedding the script, that your able to duplicate it!? He wants to just attach the script from an external source. this being picked by the instances name. But not inside the clip.. on it!

Thnx,
Danny
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

Use external classes then. Right click your object in the library -> Linkage -> Import for runtime sharing -> AS 2 class -> enter the name of the class

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 3 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.