Dynamic Text Tutorial
I want to use the Dynamic Text function in Dreamweaver; the
idea being to use a Word doc to generate the ever-changing
announcements. Does anyone know of either a video or book tutorial
that will walk me through this step by step. I would prefer C#.net
but at this point anything goes.
Lawrence *Adobe Community Expert* wrote:
> Sorry, but in short... You can't get there from here.
You can't update
> a web site "dynamically" from a word doc.
>
> You "could" have a Word doc that you save out as an HTML
doc and upload
> it under the same name each time to apply the updates,
but... Ewww!
> Word HTML docs are just soooo wrong on so many levels.
To truly have a
> dynamically updated site you are going to go with a
dynamic server
> language such as CF or PHP. Again, C# isn't an realistic
option on the web.
He could create an XML file with the relevant fields and
dynamically
pull that into a CF, PHP or ASP/.NET page.
If its just one announcement he could even create a plain
text file and
use the file system object to pull the data in.
Dooza
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html
Similar Messages
-
Linking a class to a dynamic text field to load XML data.
Hi,
I'm quite new to ActionScript and would be grateful for any help here.
I want to load text into a dynamic text field (called 'about_tab') using a class depending on the language selected (by clicking on a flag icon) by the user.
I managed to get this to work when the ActionScript was written directly in the timeline, but am having problems with doing the same thing via a class.
This is my class file:
package
import flash.display.SimpleButton;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
public class ChangeLang extends SimpleButton
public function ChangeLang()
addEventListener(MouseEvent.CLICK, switchLang);
trace("ChangeLang class working");
public function switchLang(event:MouseEvent):void
var lang = event.target.name;
var req:URLRequest = new URLRequest("languages/"+lang+".xml");
var loader:URLLoader = new URLLoader();
var substance:XML;
function xmlLoaded(event:Event):void
trace("function xmlLoaded is running");
substance = new XML(loader.data);
about_tab.text = substance.about_lbl;
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(req);
Here's one of my XML files (the other is the same except "About" is written in German):
<substance>
<about_lbl>About</about_lbl>
</substance>
When I run it, it returns my trace statements that the class ChangeLang and the function xmlLoaded are running, but no text appears in the dynamic text field (I should/want to see the word 'About'). I get this error message:
1120: Access of undefined property about_tab
The problem, I'm guessing, is in the part in red in my code. I think I need to target the text field in the display list by creating a reference to it. If so, could someonw point out how I do this, or perhaps a tutorial that would help. I've tried adding the word stage (i.e.,stage.about_tab.text = substance.about_lbl; ) but it still doesn't connect. I guess there's something really simple I'm missing, so I apologize if this comes across as a stupid question
Thanks for any help.Hello flashrocket!
I'm also new to AS3 and I've just started using external classes and I think I know what you should do to put your code to work.
Instead of using the text field you created inside your flash file, why don't you use the "TextField" class to create an instance of this object? It's the exact same thing as when you create and instantiate a new text field inside Flash.
First, import flash.text.*; (includes classes like TextField, TextFieldAutoSize, TextFormat, TextFormatAlign, etc)
Than you just have to create a var like
public var about_tab : TextField;
or
public var about_tab : TextField = new TextField();
then, to adjust the properties of this tab you use dotsyntax as if it where on your stage like:
about_tab.x = 50; about_tab.alpha = .5; etc...
you can even create a function to "config your textField"
private function createAndConfigTextField() : void {
about_tab = new TextField(); //you only need this line if you
// only typed something like "public var about_tab:TextField;
// if instead you used "public var about_tab:TextField = new TextField(); outside
// this function, just skip this first line because you already have an instance of
// text field named "about_tab"...
about_tab.autoSize = TextFieldAutoSize.CENTER;
about_tab.background = true;
about_tab.border = true;
var aboutTextFormat : TextFormat = new TextFormat();
format.font = "Arial";
format.color = 0x000000;
format.size = 11;
format.bold = true;
format.align = TextFormatAlign.CENTER;
about_tab.defaultTextFormat = aboutTextFormat;
addChild(about_tab);
This is just an example of what you can do... I hope you get it... let me know if you have any doubt... -
How to change dynamic text on mouse click of an object
Here is my Project File.
I'm wanting to change dynamic text when an object is clicked.
I created 3 dynamic text boxes under "Selected Colors" and gave them instance names of selected_roof_color, selected_trim_color and selected_wall_color.
When the user clicks a color (ie Arctic White) and then clicks say the roof, I want the "Selected Color" to display "Arctic White" to the right of "Roof:".
The colorable areas on the building have been given instances of roof, walls and trim.
I used this tutorial to change in the textbox underneath the colors when you mouse over a color.
Thank you for your assistance.My first button color is Arctic White and it has an instance of arcticwhite.
The actionscript for the Arctic White Button is:
on (release) {
_root.fillColor = 0xf3f5f4;
_root.brush.gotoAndStop(1);
The roof button has an instance of selected_roof_color and my dynamic text field where I want "Arctic White" to appear is given an instance of selected_roof_text.
Using your suggestion, my main Actionscript now has the following
roof.addEventListener(MouseEvent.CLICK,roof);
function roof(e:MouseEvent):void{
selected_roof_text.text="roof";
Looks like I've still got something incorrect as the selected_roof_text isn't changing when I click a color onto the roof.
Can you explain what the F in "roofF" is? Is that a typo? -
Dynamic text wont show up in movie - as2
basically i have dynamic text fields that i have been trying to parse to an xml file. when i test the movie it does not work, all the fields are blank. but the info DOES show up in the output tab, so i know that it is making the connection.... it just doesnt show up in the movie. weird.
here is my actionscript:
var xml:XML=new XML();
xml.ignoreWhite=true;
xml.onLoad=parseXML;
xml.load("popup.xml");
function parseXML(){
trace(this);
if (success)
var diagramNode=this.firstChild;
var infoNode=diagramNode.childNodes[0];
var nameNode=infoNode.childNodes[1];
var ssnumberNode=infoNode.childNodes[2];
var descriptionNode=infoNode.childNodes[3];
var stockNode=infoNode.childNodes[4];
var priceNode=infoNode.childNodes[5];
var typeNode=infoNode.childNodes[6];
var qtyNode=infoNode.childNodes[7];
else {
content="oops, this stuff is confusing";
and here is my xml:
<?xml version="1.0" encoding="utf-8"?>
<diagram>
<config>
</config>
<info>
<name>
Pedal Set With Toe Cage and Straps
</name>
<ssnumber>
P01LEM14139
</ssnumber>
<description>
Pedal set comes complete with both left and right pedals, toe cages and straps. Pedals have 9/16” shaft diameter where pedal threads into the crank arm.
</description>
<stock>
Item is in stock
</stock>
<price>
$15.95
</price>
<type>
EA
</type>
<qty>
1
</qty>
</items>
</diagram>
thanks, -mitchellok, i must have been doing it wrong. i ended up following a different tutorial and i rewrote it this way and it works great now!
function processXMLData(success)
if (success)
var rootNode=this.firstChild;
var nameNode=findNode(rootNode, "name");
name=getValue(nameNode);
var ssnumberNode=findNode(rootNode, "ssnumber");
ssnumber=getValue(ssnumberNode);
var descriptionNode=findNode(rootNode, "description");
description=getValue(descriptionNode);
var stockNode=findNode(rootNode, "stock");
stock=getValue(stockNode);
var priceNode=findNode(rootNode, "price");
price=getValue(priceNode);
var typeNode=findNode(rootNode, "type");
type=getValue(typeNode);
var qtyNode=findNode(rootNode, "qty");
qty=getValue(qtyNode);
else
content="oops, this is hard";
function getValue(node)
if (node && node.firstChild)
return node.firstChild.nodeValue;
return "";
function findNode(node, nodeName)
if (node.nodeName==nodeName)
return node;
for (var i=0; node.childNodes && i<node.childNodes.length; i++)
var foundNode=findNode(node.childNodes[i], nodeName);
if (foundNode!=null)
return foundNode;
return null;
var xmlData=new XML();
xmlData.ignoreWhite=true;
xmlData.onLoad=processXMLData;
xmlData.load("popup.xml");
stop(); -
I'm using dynamic text and in works fine until I refresh the
page. After I refresh it displays all the html code and instead of
rendering it.thank you very much for the answer mylennium.
so i don't know how to use expressions at all, so i did a little reserch for .toFixed() on google and i found this tutorial Simple Counter Expression In After Effects on Vimeo
so i did this;
i don't know what it says but it works
exp text 3 - YouTube -
I have created a Dynamic text box and selected the "Render
text as HTML" option. Right now all I am trying to do is get the
bold tag to work, so in my test text box I have the following:
<b>Bold</b>
Not Bold
When I do a ctrl-enter I don't get an HTML representation I
just get the text as it is pasted here. This is a new empty
document and is using Flash CS3 Professional.I saw this tutorial, thouht it may help:
http://www.smartwebby.com/Flash/html_textbox.asp
Sean -
I am making a dynamic text editor.
Some of the fonts do not embed well? I have imported the
fonts, put a linkage name, assigned data to the label.
Some of the fonts change, but not on the server?
I am using the setTextFormat?
Does anyone have any ideas? It would be greatly appreciated,
EmmaHello I am wondering if you can help me. I am sorry I have no
answer for your problem.
I am looking to also create a custom text editor in flash but
I have no idea on how to do that. Would you happen to have a
tutorial or can direct me to one on the web that I can learn how to
create such a thing?
I am looking for tutorials on this subject for both AS2 AND
AS3 based text editor creation.
Thank you. -
Dynamic Text with external .txt files
I need help getting dynamic text to display. I've used the
following tutorials (among others).
http://www.kirupa.com/developer/mx/dynamic_scroller.htm
http://www.kirupa.com/developer/mx/multiple_dynamictext.htm
In Flash 8 on last frame of maintimeline of movie, I have a
layer with a background image, 2 buttons and a dynamic textbox
(made scrollable) with scrollbar component. Textbox is given a var
of "content", and an instance name of "textBox", which is
referenced in scrollbar parameters.
I have created 3 text .txt files, and saved them to same
folder with movie .swf file. Text in files is preceeded by
"content=" on line preceeding text to correspond with var of
dynamic textbox. The files were created in Rich text format on Mac
OSX4.11 and saved with .rtf extension, then file extension was
changed to .txt (wouldn't save as .txt)
I've added the following actionscript to this last frame:
loadText = new LoadVars();
loadText.load("TEXTintro.txt");
//creating the loadVarsText function
loadText.onLoad = function(success){
if (success){
textBox.text = this.content;
else{
trace("Error loading external content");
Buttons have an instance name assigned with the following
actionscript:
on (release) {
loadText = new LoadVars();
loadText.load("TEXT1.txt");
loadText.onLoad = function(success){
if (success){
textBox.text = this.content;
else{
trace("Error loading external content");
When I test movie, I can see buttons on last frame of movie,
but they don't load any text when pressed, and "undefined" text
appears in upper left corner of text box before I press either
button.
I am getting the following Output errors:
**Error** Scene=MoonOfWintertime, layer=TextBox,
frame=2500:Line 1: Statement block must be terminated by '}'
on (release) {
**Error** Scene=MoonOfWintertime, layer=TextBox,
frame=2500:Line 11: Syntax error.
**Error** Scene=MoonOfWintertime, layer=TextBox,
frame=2500:Line 1: Statement block must be terminated by '}'
on (release) {
**Error** Scene=MoonOfWintertime, layer=TextBox,
frame=2500:Line 11: Syntax error.
Total ActionScript Errors: 4 Reported Errors: 4No more output errors, buttons still not working, but I got
my intro .txt file to load in textbox that loads with frame using
the following code I tried from another tutorial:
loadText = new LoadVars();
loadText.onLoad = function() {
textBox.html=true;
textBox.htmlText = this.textContent;
loadText.load("TEXTintro.txt");
Tried the following code with buttons, but doesn't work.
Other code suggestions?
on (release) {
loadText = new LoadVars();
loadText.onLoad = function() {
loadText.load("TEXT2.txt");
on (release) {
loadText = new LoadVars();
loadText.onLoad = function() {
textBox.html=true;
textBox.htmlText = this.textContent;
loadText.load("TEXT1.txt");
} -
Adding Scrollbar and buttons to Dynamic Text
Hello,
I am trying to connect dynamic text to scrollbar and buttons. I did tutorial and Lynda.com and practically pasted the code in with my file names and for some reason it does not work. It says I have a "Access of Undefined Property mask_mc" Did I need to create a variable for this? I didn't in the tutorial.
Right now I have the dynamic text loading successfuly in 2 different places and I wantd to add the scrollbar. I put the variables on frame 1 code and then I put the actually load code on the frame where it is needed.
Any suggestions?
Thanks! Sandra
HERE IS CODE FOR FRAME 1:
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest;
var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = philText_mc.y;
var easing:Number = 5;
var scrollAmt:Number = 15;
var scrollDirection:Number = 0;
HERE IS CODE FOR FRAME WHERE TEXT LOADS:
textReq = new URLRequest("text_philosophy.txt");
function philosophyTextLoaded(event:Event):void {
philText_mc.philosophy_txt.text = textLoader.data;
minScroll = philText_mc.y;
maxScroll = minScroll - philText_mc.height + mask_mc.height;
function dragScroller(event:MouseEvent):void
var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;
scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
stage.removeEventListener(Event.ENTER_FRAME, scrollText);
function stopDragging(event:MouseEvent):void
scroller_mc.stopDrag();
function setScrollPercent(event:Event):void
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
scrollPercent = 0;
else if(scrollPercent > 1)
scrollPercent = 1;
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
philText_mc.y -= (philText_mc.y - targetScroll) / easing;
function scrollUp(event:MouseEvent):void
setDirection(scrollAmt);
function scrollDown(event:MouseEvent):void
setDirection(-scrollAmt);
function setDirection(dir:Number):void
scrollDirection = dir;
stage.addEventListener(Event.ENTER_FRAME, scrollText);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
function scrollText(event:Event):void
targetScroll += scrollDirection;
philText_mc.y -= (philText_mc.y - targetScroll) / easing;
if(philText_mc.y > minScroll)
philText_mc.y = minScroll;
targetScroll = minScroll;
else if(philText_mc.y < maxScroll)
philText_mc.y = maxScroll;
targetScroll = maxScroll;
scrollPercent = (philText_mc.y - minScroll) / (maxScroll - minScroll);
scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
function stopScrolling(event:MouseEvent):void
scrollDirection = 0;
textLoader.load(textReq);
scroller_mc.buttonMode = true;
philText_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener(Event.COMPLETE, philosophyTextLoaded);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown);Hello again,
Maybe I am asking this question wrong. Instead of making you try and figure out what's going on in my file what I really need to know is how you would take this code I am attaching and make it happen on another frame besides frame 1 and it doesn't appear on frame 1. I think this may help me understand a little better.
Also another way I was thinking to get around this would be to pull in an external swf into the spot where I want this text to go because I can make the scrollbars and external text work when it is the only thing going on in the movie. Would this be a bad way to set this up? and also SInce it is an external movie would I have maintimeline issues with mouse/scroller control?
thanks! sandra
Here is working code:
var textLoader:URLLoader = new URLLoader();
var textFile:URLRequest = new URLRequest("text/external.txt");
var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = text_mc.y;
var easing:Number = 5;
var scrollAmt:Number = 15;
var scrollDirection:Number = 0;
function textLoaded(event:Event):void
text_mc.external_txt.text = textLoader.data;
minScroll = text_mc.y;
maxScroll = minScroll - text_mc.height + mask_mc.height;
function dragScroller(event:MouseEvent):void
var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;
scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
stage.removeEventListener(Event.ENTER_FRAME, scrollText);
function stopDragging(event:MouseEvent):void
scroller_mc.stopDrag();
function setScrollPercent(event:Event):void
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
scrollPercent = 0;
else if(scrollPercent > 1)
scrollPercent = 1;
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
text_mc.y -= (text_mc.y - targetScroll) / easing;
function scrollUp(event:MouseEvent):void
setDirection(scrollAmt);
function scrollDown(event:MouseEvent):void
setDirection(-scrollAmt);
function setDirection(dir:Number):void
scrollDirection = dir;
stage.addEventListener(Event.ENTER_FRAME, scrollText);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
function scrollText(event:Event):void
targetScroll += scrollDirection;
text_mc.y -= (text_mc.y - targetScroll) / easing;
if(text_mc.y > minScroll)
text_mc.y = minScroll;
targetScroll = minScroll;
else if(text_mc.y < maxScroll)
text_mc.y = maxScroll;
targetScroll = maxScroll;
scrollPercent = (text_mc.y - minScroll) / (maxScroll - minScroll);
scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
function stopScrolling(event:MouseEvent):void
scrollDirection = 0;
textLoader.load(textFile);
scroller_mc.buttonMode = true;
text_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown); -
The simplest way to do dynamic text
HI!
What would be the best way doing dynamic text and objects to your FC builded web site?
I know that FC is not developer tool and I probably have to use Flash Builder.
I've had lot of request to make web pages with parts that customers can upgrade on their own.
Example they want to upgrade some news on the page etc.
I probably do not have to make whole page dynamic.
But what would be the best solution to make some easy dynamic object on my website?
It would be nice if i can solve this without using database or content management system.
I know this question might not be directly related to FC, but as a designer I think you guys can help me best.
(Or at least push to right direction. )Hi SupraJohde,
Flex can talk to whatever type of backend you decide to use, and it supports a variety of different data formats right out of the box. Here's a good getting started tutorial (note that since it's from Flex 3, there may be slight differences from Flex 4, difthe version that Catalyst creates). Here's a more advanced, database-oriented tutorial (this is Flex 4 beta 1, so again there may be slight changes).
I can't tell you whether it's best to use a CMS vs. a databcase vs. something else on the backend. That might be a better question for a different forum :-) If you're looking for the simplest possible solution, I'd suggest putting some XML files on the server and pulling content from those (see first tutorial linked above). Your clients can then update just the XML content files.
- Peter -
How to load dynamic text inside a movie clip?
hello all - i have a main stage where on the first frame my
"home" movie clip displays. i did this by dragging/dropping, and
then i put a stop action. all works fine.
inside this home movie clip on the main stage, there are
links to other movie clips. for example, to get to my faq's page -
you click that button, then it takes you to frame 4 on my main
stage, where my faq's movie clip (followed by stop action) has been
dragged/dropped and displays properly.
within the faq's movie clip this process is repeated, with
buttons taking to you various pages (different frames where
different movie clips play - all works fine).
so now i want to add a dynamic text field within my faq's
movie clip. i have read numerous tutorials where i have created the
text file but i have not been able to display it with success
within my faqs movie clip.
here is some code that my dvd tutorial instructs me to place
on main stage as i practice getting this to work:
var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object();
myMCL.addListener(myListener);
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading
the requested information. Please contact the webmaster.";
and here is some code that i place on the faqs button within
my main movie clip that takes me back to main stage and plays faq
movie clip all successfully:
on (release) {
//Movieclip GotoAndPlay Behavior
_root.gotoAndPlay("4");
//End Behavior
and finally, here is some code that i place within my faqs
movie clip in an attempt to display my dynamic text within the faqs
movie clip - so far unsuccessful:
_level0.myLV.load("vars/faqs.txt");
NOTE:
i have published this to view - not working.
i have my faqs text file starting as info=
i have eliminated white space within my text file
i am using flash 8 pro
can anyone offer some sugestions? thanks!hmmmmm lemme double check as i seem to be a bit lost now.
// this is my actions layer code on frame 4 of main timeline:
stop();
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading
the requested information. Please contact the webmaster.";
myLV.load("vars/faqs.txt");
1. fyi - at frame 4 on main timeline, one layer beneath the
actions layer where i dragged/dropped my faqs movie clip i gave my
faqs movie clip an instance name of "mainfaqs" - although nowhere
do i refer to this specific mc within my code.
2. where would i replace/insert the following code?
_level0.faq_mc.loadedInfo.text = myLV.info;
3. i didn't know about embedding font but i saw the option
and embedded it - still no results.
4. i'm not sure how to do the following:
_level5.loadedInfo.text ='test'; //although I would still
change the path as above
To see if your getting a return from the load call adn text
file, use a trace statment before the success condition and see
what it returns:
trace(myLV);
sorry to be such a pain - i really have looked around for
answers through previous postings and i googled it and i've been
taking instruction through lynda.com and dvds but i seem to be
stuck here.... as always - thanks for your time -
Hi
I have figured out how to load dynamic text from an external
text file.
I need to do the same with an ASP file that pulls its data
from a database.
How is this done with Flash CS4? I can't find any tutorials
anywhere and Adobe's documentation is non-existent.
Can you tell me how? Or show me where there is a (useful)
tutorial?
Thanks!>> The dynamic text instance name is "loadText"
Then you need to use the text property of the instance:
this.loadText.text = Math.round(getPercent*100)+"%";
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/ -
Problems sending text from JavaScript to dynamic text box
For reasons which I won't bore you with, I'm trying to send
text from a JavaScript to a dynamic text box in Flash. I've just
spent all day wondering why I can't get it to work, despite
following web guides to the letter. Finally I discovered that I'm
not actually doing anything wrong and everything works perfectly -
as long as it's online. It won't work at all locally or from the
network.
The problem is that this is for learning material which will
be deployed both online and on CD, so it won't always be running
from a webserver. Has anybody got any ideas a) why this is
happening, and b) what I can do about it?
Cheers
Marchttp://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPBeans.html
This is a good tutorial on using JSP pages with JavaBeans.
Your JSP page can have all the standard HTML tags and a bean can be set to retrieve any values from form fields upon a submit.
At that point your bean properties are set and your Java application can use that data for whatever processes you wish.
It's really quite simple once you get the hang of it! ^_^
Message was edited by:
maple_shaft -
New and need help - drag and drop with dynamic text
So I'm doing this project and as an animator I'm not familiar with the whole action script side of flash
Okay so far I've managed to create the whole Drag and Drop feature and it works well, the thing is I want to make it so when you drag in object in the correct spot and new text appears, and I need like six different object with the dynamic text. but I have no idea how to integrated it in my code or where I should start!
So i based myself on some tutorial so theres some code in there that had dynamic text, but not exactly what i wanted
Your help would be much appreciated!
This is my code:
var counter:Number = 0;
var startX:Number;
var startY:Number;
six_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
six_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
five_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
five_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
four_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
four_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
three_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
three_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
two_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
two_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
one_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
one_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {
event.target.startDrag(true);
reply_txt.text = "";
event.target.parent.addChild(event.target);
startX = event.target.x;
startY = event.target.y;
function dropIt(event:MouseEvent):void {
event.target.stopDrag();
var myTargetName:String = "target" + event.target.name;
var myTarget:DisplayObject = getChildByName(myTargetName);
if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
reply_txt.text = "Good Job!";
event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
event.target.buttonMode = false;
event.target.x = myTarget.x;
event.target.y = myTarget.y;
} else {
reply_txt.text = "Try Again!";
event.target.x = startX;
event.target.y = startY;
if(counter == 6){
reply_txt.text = "Congrats, you're finished!";
six_mc.buttonMode = true;
five_mc.buttonMode = true;
four_mc.buttonMode = true;
three_mc.buttonMode = true;
two_mc.buttonMode = true;
one_mc.buttonMode = true;where you have
xxx.text = ....
is where you're assigning text. -
Displaying the result of a calculation in a dynamic text box
Hi folks,
I'm having a very minor issue here (operator error, I'm sure ). With the help of some folks here, I've created a series of calculations, and I've got that part down. Now, I just need it to show up in the movie.
I've created the dynamic text box in Flash (CS3), but when I hit test, it won't show up.
After all the calculations, I should have a figure that I call totalmoney. My dynamic text box is called total. The user doesn't need to hit anything for it to appear. It just appears as part of the movie.
Here's my code:
stop();
var startDate:Date = new Date(2010,0,12); // use your startyear, startmonth, startdate in the new Date() parameters.
var currentDate:Date = new Date(); // assuming user's clock is correct and in your timezone. else use server date/time.
var numberOfSeconds:Number = (currentDate.getTime()-startDate.getTime())/1000;
var interest:Number = (numberOfSeconds*0.74356);
var totalmoney:Number = (interest+15,000,000);
function displaytotal(evt:TextEvent):void {
total.text = "totalmoney";
Any thoughts?
Thanks!
NapoYou didn't have to bury any of the calculations in the function--leaving it as you had it is better. They could remain where they a=werew, and you'll probably find you want them outside it if you have other plans for using them. If left inside, they only have scope inside. In the programming world, it's good to think of functions as things that do one thing and one thing only (though it isn't often practiced that way)--it's called modular design.
When you place an event as an argument for a function, it typically means that there is an event listener that initiates the call to the function. If you work with buttons you'll see what I mean. But if the plan is to create your own call to a function when you desire it as such, not have it driven by an event listener, then you don't need to pass any event to it, though you may pass some other type of variable to it if need be.
For instance, what you have now will call the function without an argument because the function has the value built into its code....
displaytotal();
But you could also make the function a little more generic and set it up to recieve the value instead as an argument...
function displaytotal(amt:Number):void {
total.text = String(amt); // an earlier error of mine
displaytotal(totalmoney);
That would make your function a little more useful. Now it could be used to display other Number variables as well.
// my earlier error was that a textfield displays text, so you need to convert the Number value to s String.
Hope I'm not confusing you.
Maybe you are looking for
-
Is there a way to make the iTouch compatible with Win2k?
Recently I purchased the iTouch and obviously I was really excited and happy, but, of course, it doesn't work with my computer. I have a Windows 2000 home computer, and I don't understand why the iTouch can't work with it. My question is that are the
-
I am working on my parents computer... they have iPhoto 6 and I renamed the iPhoto Library folder in Finder. Obviously this is not a good idea since now there is no content (pics) in iPhoto. This action made a new folder (with the new name) in Finde
-
In Kazakistan, there is the fiscal requirement to show VAT amounts in the VAT declaration based on document date and not on posting date. Moreover, also parked documents not yet posted have to be included in the declaration. Obviously on the next m
-
Using Tangosol Coherence in conjunction with Kodo JDO for distributing caching
JDO currently has a perception problem in terms of performance. Transparent persistence is perceived to have a significant performance overhead compared to hand-coded JDBC. That was certainly true a while ago, when the first JDO implementations were
-
Hyperion ERP Integrator training?
I was browsing through the Oracle training courses available in the realm of data integration, specifically FDM's ERPI and was unable to locate anything. Does any such training exist? Or because it is a module/adapter of FDM there is no such specific