Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Creating external text scroller
Category : SWiSHMax | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

This is primarily directed at all newbies to SwishMax that want to make an external scroller. I have never written a tut before but after reading several (probably 50) i think i may be able to word one in such a way that everyone can follow, ready? let's begin.

1) Open wordpad

creating the text you want to use in your scroller

2) you must start your wordpad document with an ampersand "&" and after that you would put the name of your variable so your text file would look something like this &good
3) then you put in an"=" sign so your document now looks like this &good=
4) Now we can add the text we wish to scroll but make sure not to leave a gap after the "=" sign. So perhaps you would have something like this now. &good=welcome everybody to my version of an external scroller which i made after several weeks of looking and looking.
5) Save your file as b.txt or anything else you like but to keep it simple save it as b.txt and make sure you save it to somewhere you are easily going to remember , i created a new folder on my desktop and named it scroller for ease.

THE SWISHMAX BIT

1) Open swishmax and go to the export panel on the right and select export options for swf 5.
2) goto the script panel on your main stage.
3) Add Script>Frame>Onload()
4) Add Script>Movie Control>Load/Unload Level>LoadVariableNum(...)
5) Look to the bottom of the scripting panel and you will see a box named "URL" . type in b.txt in that box.
6) Look under that box and you will see another box named 'Level', in that box enter 0.
7) Look further down and you will see a box named 'variables' make sure that it is set to "don't send variables".
8) Look right to the bottom and you will see a box named @load variables only' , make sure that box is ticked.
9) Save your SWI to the same folder as your b.txt file you created earlier.
10) your script should look something like this

onLoad () {
loadVariablesNum("b.txt",0);
}


Now It's Time To Create your Text you Intend to scroll

1) select the layout panel and select the 'text' object.
2) click and drag on the stage to create your text box.
3) go to the panel on the far right now and give your text block a unique name and select it as a target (look to the right and tick the target box) i called mine 'eureka'
4) select 'dynamic text' from the drop down menu (static is default).
5) goto the 'advanced' tab right next to the 'dynamic text' tab and where it says 'variable' type in the word 'good' ( remember our text file we created earlier has a var named'good' (&good) for those who can't remember.
6) goto the 'formating' tab now and select 'text wrap' (this makes sure any words that spill off the edges wrap around and are displayed.
7) leave the 'leading' and 'kerning' tabs set to 0.
8) goto the 'dimensions' tab next and turn off the 'auto height' control and set your height to lines and width to pixels ( this will allow you to set the amount of lines you want to be displayed before you have to start scrolling. for example if you set the lines to 4 then only the 1st four lines of your text will be displayed and any after that will need to be scrolled to be seen.
9) with all this completed successfully you should be able to read the external text inside your SWF or SWI as long as you saved your SWF and text file to the same folder and your load options are set up correctly. If in any doubt goto 'edit' tab at top and select edit>preferences>player>specify folder and browse to the folder you saved both the SWF and text file in.
10) Right about now you should be able to see the txt from your
.txt displayed in your movie. and with wrap none of the
text should be running off.But what about the rest of the text and the scroller?
BUILDING THE SCROLLER

1) create a sprite by clicking the 'insert' tab and clicking 'sprite' it should already be selected as a target by default if not click target.
2) name your sprite ( i called mine 'controller'.
3) in the sprite panel on the far right select ' stop playing at end of sprite' .
4) enter the sprites timeline by clicking on the sprite icon on the left and then click on the 'script' panel in the centre of the stage.
5) leave it set to guided as it is much easier if your are new to scripting.
6) click Add Script>Events>Frame>OnFrame
7) Add Script>Movie Control>Stop

onFrame (1) {
stop();
}]


8) click on frame 6 of the sprites timeline.
9) Add Script>Events>Frame>OnFrame
10) Add Script>Statements>Name=Expr
11) look towards the bottom and you will see a box named 'target'
12) select _parent.eureka or whatever you named yours as.
13) now look where it says 'name' and type in scroll
14) now look to the 'operator' tab and select '+=(add or plus).
15) finally look right at the bottom to the blank box and enter 1
16) if you have done all of this correctly your script will look something like this


onFrame(1) {
stop();
}
onFrame(6) {
_parent.eureka.scroll += 1;
}

all good so far i hope , nearly finished now.

1) click on frame 10 of your controller sprite then click the 'script' tab in centre of the stage.
2) Add Script>Frame>setLabel and look to the bottom to where it says "label" and type in the word 'down'.
3) Add Script>Movie Control>gotoAndPlay>gotoAndPlayFrame
4) type '6' where it says"frame" at the bottom.
5) click on frame 20 of your controller sprite and repeat steps 1 to 4 except this time you type in the word 'up' instead of down and enter 16 instead of 6.

NOW FOR OUR BUTTONS (SIMPLEST WAY)

1) click the 'layout' tab in the centre of your stage and choose the rectangle tool, draw a rectangle, not too big, give it a colour.
2) click the modify tab at the top and convert>convert to button.
3) copy and paste it just once.
4) name one of them 'up' and the other'down
5) select the down button from the main timeline and then select script panel in centre of the stage.
6) Add Script>Events>Button>onPress
7) Add Script>Movie Control>gotoAndPlay>gotoAndPlayFrame
8) select 'controller' from the drop down box at the bottom of your screen next to where it says "target" and type 'down' where it says "label".
9) Add Script>Events>Button>onRelease
10) Add Script>Movie Control>gotoAndStop>gotoAndStopFrame
11) select 'controller' from the drop down box again and enter '1' where it says "frame".
12) now select the up button from the main timeline and repeat steps 5 to 11 but exchange the word down for up

There you go... it's finished. Make sure you test it in browser to see it work though as it won't work otherwise.
I hope i have helped at least 1 person by doing this and i can't take credit for it as it is an amalgamation of about 50 tut's i have read over the last 3 weeks or so but it gave me headaches for weeks and hairloss and i was at the point of of never touching swishmax again but it was worth it in the end.

Regards Paul


All rights reserved - swish-db.com