A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11255 Flash Movies | 9 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Knife Butterfly
» Title: SkullCandle
» Description: Simple Skull with a candle burning on it.
» More by Knife Butterfly


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 6392 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Cesar Kobashikawa - online portfolio
» Comments: Cesar Kobashikawa's Portfolio


Random Links | Add your own Flash Related Links
Flash Tutorials 1201 Tutorials 7 New Tutorials Added!
What's New | Top100

» FLV Converter for Mac
» After Effects Quality Effect using AS3
» FLV to 3GP: Convert video files from FLV (Flash Video) to 3GP for Mac
» create Christmas business flash presentation with hyperlinks
» Let Photos Show Your Happy Family this Christmas and Upload YouTube
» PowerPoint show to DVD slide show--- PPS to DVD
» How to burn FLV to DVD for Mac
» How to Create Christmas Flash Greeting Ecard with photos and music
» Getting Started In Flash
» Unknown Tag: Title10
Random Tutorial | Add Site

bbm.netBBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.

Click here for details »

Web Page Production
Aquent
US-MD-Owings Mills

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » 3rd_Party/Swish

Categories Dynamic and Input Text 101 in SWiSHmax
Author: Frets

 
Page 1
1

The Example

go ahead and try it

If you've tried it twice once by using the enter key and once by using the Press button you'll notice you get two different results. That's because I've assigned two different expressions to the dynamic text box. But thats for later on Lets work on some basics first. <%BK%>

Input Text

  • Select the text button from the layout panel left of the stage.
  • Click and drag to create a text block.
  • Go To the Text Panel on the right.
  • Name your text see note for the sake of arguement lets call it Inny
  • Do Not select it as a target
  • The Defaut setting for text is Static Click on the word static and use the drop down to select Input.
  • Select Advanced from the Drop down menu that says Dimensions.
  • Select the Black Box icon and deselect Multi line for this example.

Input Text

Due to reserved words being used in actions/expressions it's wise not to use certain words such as "text, Sprite, parent child or using the same word for multiple objects (sprites with the same name text with the same name etc) as well never start a name with a number swish will try to correct it if you do but in general it's a bad practice)
Test your movie out hit scene play you should be able to back out any text and replace it with new text. What have you done. You have created a variable for storage. A variable is simply a box that holds data. Data can be stored locally on to a computer or onto a server. Because we are just starting out the data is only temporary. Later you may wish to learn more about storing data such as cookies, shared objects or to a database. But for now lets keep it simple. Variables aren't always text although it is the default setting for swishmax. Swishmax can interpert variables to a certain degree somevariables such as currency or boolean statements(true false) must be defined as such although swishmax does a pretty good job of figuring out what type of variable is being stored. We'll discuss a bit more about variables later on. For now lets take a break and create our Dynamic text. <%BK%>

The Dynamic Text block

Just as Before,,,
  • Create a text block on the stage by selecting the Text icon on the layout panel and dragging across the stage.
  • Give your new text box a new name Lets call it Outty.
  • For the sake of arguement (and to simply the process) Do Not select it as a target. From the type of text Select Dynamic (it should have been left at Input)
  • As you should still be in the Advanced tab deselect the black box.
  • From the Advanced button Select Formatting.
  • Select text wrap (the icon that looks like an enter/return button)
  • From the Formatting button go back to Dimensions
  • Deselect Auto Height Icon with the A Click where it says Hieght and select Lines insert the number of lines you think you will need.
  • Now clear out any text you have in Outty.
Output Text
Take a break breathe let it all soak in. Here comes the last part. <%BK%> Back already? Well okay I'm sure you want to get this stuff done with.

Our Button

Create Select the object you want to act as a button. (text shape anything but the input or dynamic text.you've just created.
  • Go to the script panel
  • Add Script>Event>Button>OnRelease
  • Add Script>Statements>name=expr
  • Leave target blank. Targets refer to Sprites
  • Name:the name of the dynamic text Outty remember our dynamic text box name was Outty
  • Property: =
  • Expression: Inny
  • What you should see is
    On Release()
    {Outty = Inny;)

button

Go back to the stage view and test your movie
So where did all that other stuff come from? And how can I do that? When you use a variable in an expression you simply include the name. When however you wish to use Text or what the rest of the programming world refers to as a String you encase the expression in quotation marks. When "1"+"1"="11" Concetation is when strings and or variables are joined.it is not intended as a mathematical formula simply a means of bringing two or several strings and or variables together Such as MyVar1 add" some stuff goes here." +MyVar2 add" more Stuff"; About the Enter Key,,,,, If you wish to use a keypress function you may.... Use the Event Button>On kepress<"enter"> Where to go from here. Once you get the hang of dynamic text expressions and input text it is much easier to digest things such as Loading and sending variables.creating mathematical equations and dancing with squirrels. Why the stuff about not making dynamic/input text a target? When you make any object a target you change the nature of the object it now becomes wrapped in a sprite. Which is why if you made your text objects target you recieved and error in the debug stating cannot find target. "targets" are great for simplifying draggable objects or when you simply want to load something such as a movie into a rectangle. However for the most part many of us are simply used to converting objects to sprites for the added benifits they bring. If you associate dynamic text (as in the case when you want it to be a target) with a variable meaning have a different name for the variable then the text object. Personally I see it as one more step that really is never absolutely required When you do associate dynamic text with a var name the two cannot have the same name. Still struggling? here's the SWI

1

» Level Basic

Added: : 2005-05-22
Rating: 7.50 Votes: 4
Hits: 215
» Author
Flashkit Supermoderator, Swishzone Supermoderator, Swish-Talk Supermoderator
» Download
Download the files used in this tutorial.
Download (32 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Symantec Whitepaper: Converging System and Data Protection for Complete Disaster Recovery
Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
  Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Symantec Whitepaper: Comprehensive Backup and Recovery of VMware Virtual Infrastructure
MORE WHITEPAPERS, EBOOKS, AND ARTICLES