flash actionscript:
I put together a small news scroller and use Action Script to scroll the Dynamic text file. Everything seems to work find but the text does not show up. The lay out I have is this. I am a noobie Flash MX 7.2 pro Timeline 3 layers layer 1 Action Script scene1 script: frame 1 loadVariablesNum("welcome.txt", 0); welcome.autosize = "left"; var maxheight = welcome._height; var maxpos = 365-maxheight; gotoAndStop(2); ................................................................................. ........................................ script: frame 2 if (welcome._y<maxpos) { welcome._y = 370; } welcome._y -= 1; gotoAndPlay(2); ................................................................................. ................................................ layer2 Text The text I use is in the same folder as the rest and is 1k file and has the name welcome Layer3 background A jpa pic if (welcome._y<maxpos) { welcome._y = 370; } welcome._y -= 1; gotoAndPlay(2);
you have a textfield with no instance name and with associated variable = welcome and that textfield exists on frame 1 of your swf. both true or no? and your code in frame 2 is supposed to do what?
Thanks for the tip kglad. I can see now why it could not see the text. You got to let it know what to use. Forgot all about the associated variable fpr the text. What I am trying is a non stop scroller and in 2 It is to keep the message scrolling. I may have to work with the number to get it to work with in the the background frame. I have tryed it and now the scrolling stop but can see the text.
as soon as the playhead enters frame2 the code executes which directs the playhead to frame 2 (it's already there so that causes no change), stuff is revealed on stage in frame 2 and then the playhead continues to frame3. the result of your gotoAndPlay(2) on frame 2 is the same as not having that code. ie, it does nothing. if you want a frame loop so frame 2 plays repeatedly, place that gotoAndPlay(2) in a frame after frame 2. but if you place it in frame 3 then nothing on-stage in frame 3 will be displayed because the code executes first and then the stage is updated.
Don't see what you're looking for? Try a search.
|