MovieClip Dynamic Text
I'm using the Box2D Flash port, but that's got nothing to do with the problem I'm having. As a result, I've trimmed down the code below to only show relevant information.
I've created a function: createPhysicsItem which takes a string and a location. It then creates a Box2d polygonal object. The Block() object is a MovieClip which contains a Dynamic text label. The problem I'm seeing is that the boxes containing the text render with strange dimensions (the text contained within each having been resized). You can see this behaviour here:
Code: var feedContent:String = "This is just a test to see if we can split this!"; var contentArray:Array = feedContent.split(" "); for( var i:int = 0; i < contentArray.length; i++ ) { this.createPhysicsItem(contentArray[i], Math.random()*stage.stageWidth, -Math.random()*100); }
Code: public function createPhysicsItem(itemData:String, x:int, y:int):void {
bodyDef.userData = new Block(); bodyDef.userData.label.selectable = false; bodyDef.userData.label.text = itemData; bodyDef.userData.width = bodyDef.userData.label.textWidth; bodyDef.userData.height = bodyDef.userData.label.textHeight; addChild(bodyDef.userData);
} How can I get an accurate size (width and height) from the dynamic text label object in order to stop Flash from resizing the text when it renders?
FlashKit > Flash Help > Actionscript 3.0
Posted on: 08-04-2008, 07:09 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Controlling Dynamic Text In A Movieclip Within A Movieclip
Hi,
I have a script that loads text into a dynamic text box but the problem is the script is on one movieclip and the text box is in the movieclip within that one. How would I go about doing this. I know a simple scrolltext=scrolltext.txt (variable = scrolltext) does not work because I'm loading a text box in a seperate movie clip.
I also tried songInfo_mc.scrolltext_txt=scrolltext (songInfo_mc = movie clip where Dynamic text box resides). If someone could help me out it would be most appreciated.
GD
Accessing Dynamic Text Within Dynamic Added Movieclip.
Hi there.
I'm trying to access and change a dynamic text field within a dynamically added movieclip.
This is how I'm trying to accomplish that;
ActionScript Code:
uButton = attachMovie("_button",arr_videos[i][1], ++uDepth);
uButton._x = uButtonStartX;
uButton._y = uButtonStartY + uButtonDistance * uDepth uButton.btn_name.text = "button name";
btn_name is the name of the dyn. textfield.
But this does nothing.. What am I doing wrong?
Thanks for your help
Samuel
How To Load An External Text.txt Into A Movieclip Containing A Dynamic Text Box?
Hi Guys,
I can load text into a dynamic text box when it is on the main timeline.
But when I place the dynamic text box inside a movieclip, I can't get the text too load into the dynamic text box which is inside a movieclip.
Can anyone explain how to get "loadVariablesNum ("text.txt", 0);"
to load the text into a dynamic text box which is inside a movieclip.
Loading Dynamic Text Into A Text Field In A Movieclip
Hi:
I have multiple dynamic text fields in a movieclip called "dragwindow"
On the main scene, first frame... i have the code
loadVariablesNum("todaysrates.txt", 0);
it doesnt load the text when I test the movie but when I put the dynamic text fields on the main scene it does load the text. i dont know what to do.. help please
Setting Text In Dynamic Text Movieclip?
Is it possible to set the text in a movieclip that used to be a dynamic text field?
Create a dynamic text field with the Text Tool from the toolbar.
Convert to Symbol.
How to set its text? Looking at the available Movieclip methods and properties, I don't think it's possible.
But.. if I don't convert my text field to a movieclip, I can't target it for printing.
Dynamic Text And Movieclip
Hi,
i have an array including strings as following :
Code:
msg['eng']['Home'] = 'Home';
msg['eng']['About_Us'] = 'Our Company';
i would like to display those strings on stage but with some effects (effect can be on each letter, so i must be able to split each character and apply effect like blur and fade in/out for example).
How can i do that under Flash CS3 ?
thanks a lot,
A.
Dynamic Text And Movieclip
Hi,
i have an array including strings as following :
Code:
msg['eng']['Home'] = 'Home';
msg['eng']['About_Us'] = 'Our Company';
i would like to display those strings on stage but with some effects (effect can be on each letter, so i must be able to split each character and apply effect like blur and fade in/out for example).
How can i do that under Flash CS3 ?
thanks a lot,
A.
Dynamic Text Outside Of MovieClip?
Hello everyone, this is my problem. I am trying to display a dynamic text outside of its movieclip once the movie clip gets clicked.
Here is the code:
Code:
var insideText:TextField = new TextField();
var mContainer:MovieClip = new container();
mContainer.x = 100;
mContainer.y = 100;
addChild(mContainer);
function clicked(evtM:MouseEvent):void
{
//initialize textfield
insideText.text = "Outside?";
insideText.textColor = 0x000000;
mContainer.addChild(insideText);
}
mContainer.addEventListener(MouseEvent.CLICK,clicked);
As you can see, this only displays the text inside the movie clip but I want it to appear on the stage at about x=10 and y = 10.
Any ideas?
Text Within A Dynamic Movieclip
i dont know maybe im being dim but im trying to add text to a movieclip dynamically added to the stage
ActionScript Code:
var header:block = new block();
header.x = 3;
header.y = 3;
addChild(header);
header.block_txt.text = "TEST TEXT";
header.block_txt.selectable = false;
header.buttonMode = true;
now it adds as it should but the text field seems to be as when i mouse over it instead of getting the hand cursor for the movieclip (its already a func) it becomes an arrow which im guessing is because its now over the text field although the text is a child of the header?
Simply put I want the text to be in the mc and not cause problems for the button, any clues to what im doing wrong?
Cheers
Dynamic Text In Movieclip
hey... im positive this can be done, and am unsure why its not working, ive been having a good hunt through here and the help files but no luck...
i have a movie clip that plays when user releases the mouse button on a button... the movie clip is a graphic of a scanned piece of paper that moves from out of the stage (and out of view of the user) into the stage...
i would like dynamic text to appear over the graphic. Im sure i am doing in kind of right because when i try the same codeing etc on the main stage (not in the movieclip) it works fine (i cant do it this way to get around the problem though because the text appears on the stage before the graphic has a chance to enter the stage and the ilusion of the text being written/typed on this piece of paper is lost...)
do i have to do something different to embed dynamic text into a movie clip???...
ALSO!! i would like the text to follow the graphic down the stage as it enters... if i try to tween it though, it becomes a graphic and hence not dynamic...
if anyone can help id appreciate it alot!!!
Dynamic Text And Movieclip
Hi,
i have an array including strings as following :
Code:
msg['eng']['Home'] = 'Home';
msg['eng']['About_Us'] = 'Our Company';
i would like to display those strings on stage but with some effects (effect can be on each letter, so i must be able to split each character and apply effect like blur and fade in/out for example).
How can i do that under Flash CS3 ?
thanks a lot,
A.
Loading Dynamic Text In Movieclip
Hi, i've got a problem with loading text into a movieclip. Ive downloaded a fla file and are using it's code as a referance, I found the file on this forum I believe.
My dynamic text field loads the text perfectly when I put it on the main timeline, but not when its in the movieclip.
The text box is called "newsBox"
The movieclip where the textbox is put is; _root.enterb.menuload.menu.mainmenu
The code in the frame:
loadText = new loadVars();
loadText.load("text1.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
The code in the text file:
myNews=This is Text one
- Bad Fish Ent.
Dynamic Text In Movieclip Not Showing
I'm trying to create something that looks like a spreadsheet but I'm failing at the first hurdle. The text is not showing up in the following code, please point out where I'm going wrong.
myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.size = 8;
myTextFormat.color = 0x000000;
p = 0;
q = 0;
for (i=1; i<65; i++) {
_root.createEmptyMovieClip("button"+i, 100+i);
_root["button"+i].lineStyle(2, 0x000000, 100);
_root["button"+i].beginFill(0xFFFFFF, 100);
_root["button"+i].moveTo(0, 0);
_root["button"+i].lineTo(50, 0);
_root["button"+i].lineTo(50, 16);
_root["button"+i].lineTo(0, 16);
_root["button"+i].endFill(0, 0);
_root["button"+i]._x = p*50;
_root["button"+i]._y = q*16;
p++;
if (p%8 == 0) {
p = 0;
q++;
}
_root["button"+i].createTextField("theTextBox", 100, 0, 0, 50, 16);
theTextBox.background = true;
theTextBox.border = true;
theTextBox.backgroundColor = 0xFFFFFF;
theTextBox.borderColor = 0x000000;
theTextBox.multiline = true;
theTextBox.wordWrap = true;
theTextBox.variable = "myText";
theTextBox.setNewTextFormat(myTextFormat);
myText = "hello";
}
A Movieclip Connected To Dynamic Text
All right, I have a movieclip with the instance name "bar", it is simply a red horizontal bar. I have a dynamic text box with the number "100" defined in it to start. I want the length of the "bar" to shrink as the number "100" is brought down, can anyone please help me with this? Thanks dudes!
MovieClip Slideshow+XML W Dynamic Text
http://i61.photobucket.com/albums/h7...deShowinMC.jpg
Anyhelp anyone? This is the closest thread I came to achiving this..
http://www.gotoandlearn.com/forum/vi...asc&highlight=
but no fla to see visuals while creating in the process..
any help?
Dynamic Text, MovieClip, Linkage
Hi,
I'm working on a button movieclip.
I attached it to a class and I know the linkage is correct.
I have a dynamic text field in the movieclip called d_txt.
But I can't figure out how to dynamically change the text.
This is the class code:
Code:
class DomainButton extends MovieClip {
var d_txt:TextField;
var bg_mc:MovieClip;
function DomainButton(s:String){
this.d_txt.text = s;
}
}
I'm stumped from here out.
Dynamic Text Box Inside Movieclip
I have a dynamic text box called "desc_txt1" which is inside a movieclip called "thumbScroller"
i cant get it to display the text from the xml file, but if i put the dynamic text box on the main time line then it works..
heres what i have:
on maintime line
thumbScroller.desc_txt1.text = description[p];
and have tried
_root.thumbScroller.desc_txt1.text = description[p];
neither work, does anyone know whats going on?
Regards
Gary
Movieclip To Fit Dynamic Text Box Length
Hi again,
I was wondering whether any one could help or advise me on the best way to go about this problem.
I have a movie clip shaped like a cell in a data base, which contains a text box which is filled with data (String).
However, the data I need to add is sometimes larger than the movie clip length.
Whilst the text box can be expanded easily to accommodate this data enlarging the movie clip to the correct size is proving problematic.
Below is my initial attempt at the code (you won’t be able to get it to work as you need my movie clip) but the movie clip does not always wrap snugly around the text if the text changes.
Are there any methods that address this problem?
Can this be done easily (newbie I’m afraid)?
Any help would be most gratefully received.
Thanks in advance
ActionScript Code:
this.attachMovie ("dataCell_mc", "dataCell", this.getNextHighestDepth ());
var name:String = "(4R,5S)-1,5-dimethyl-4-phenylimidazolidin-2-one";
//Here I used '/12' as the mc fitted snugly with a String such as 'fooooooooooooooooooooooooooooooooooooooo'
//but when I changed to a chemical name I don't get the same results. Probably due to the existance of
// '(', ')' and '-'.
this.dataCell._width *= name.length/12;
//this.dataCell.autoSize = true;
//this.dataCell.dataCell_txt._width = name.length*7;
this.dataCell.dataCell_txt.text = name;
this.dataCell.dataCell_txt.autoSize = true;
Dynamic Text On A MovieClip/button
Ok,
I created a symbol in my library and drew a simple little image, with a dynamic text box underneath it. I gave the text box an instance name of myTxt. The MC/Buttons name is myButton.
How do I then, or even can I, access and change the text of that text box
I've tried something like this:
Code:
var imgWithText:myButton = new myButton();
imgWithText.x = 30;
imgWithText.y = 30;
//etc etc
//now to try and set the text
imgWithText.myTxt = "This doesn't work";
What I want to archive basically is many little icons with variable text underneath them, which are clickable.
Edit:
I just realised where I was going wrong typing out this post.
imgWithText.myTxt.text = "This does work";
How Do You Scale Dynamic Text Within MovieClip
Hi,
I've created a class that places a movieclip on the stage. Within this movieclip is some dynamic text. I would like to be able to rotate, scale, and change alpha of this movieclip and the text within it. When I try to change the .x it works fine, but if I scaleX it mearly scales the movieclip, not the text within it, cutting off the edges of the same-sized text. Is there a way to make this text act like a movieclip?
What am I missing?
Thanks for your help
Ted
How Can One Change Dynamic Text Within A MovieClip?
The situation is as follows:
1. Using addChild i made a movieclip appear on the stage.
2. In that movieclip there is a dynamic text instance called endScore
3. Using AS3 i tried to change the value of endScore.
4. I tried accessing endScore like this: stage.myMovieClip.endScore.text = endScoreValue;
5. But the attempt to access it like that failed and i have no idea why. I thought i had the correct dot-notation to access it, but something must be wrong, because it doesn't work and i get an error.
6. This is the error which appears in the output window during execution:
TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-315()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()
Does anyone know what i'm doing wrong here?
How To Write To A Dynamic Text In A MovieClip
Hello everyone,
I am trying to load some TEXT from a database into Flash. I have created the php file and have no problem populating a Dynamic Text with the text from the database. I am using the following code for doing so.
loadVariables ("php/attorney.php", "");
The problem is when I move the dynamic text area into a MovieClip. Once I do that I no longer have the Dynamic Text area populated by the text from the database.
Can someone be kind enough to tell me how I can do this?
Thank you very much and have a great day.
Khoramdin
Accessing Dynamic Text In A Movieclip
I have a movieclip of instance name "menuBtn". And within the movieclip itself, I have a dynamic text on it named "btnName".
How do I access the dynamic text in the main timeline?
I tried menuBtn.btnName.Text = "something" and it doesn't work.
btnName.Text = "something" doesn't work either.
So, can someone tell me the correct way to access it?
Dynamic Text Inside A Movieclip
Hey fellas I need to get this dynamic text field changing at the same time the input text field gets changed i know how to do it if its not inside a movieclip but once i insert it in the movieclip i dont know how to get it working.
Thanks
Movieclip In Front Of Dynamic Text
I have created few dynamic texts dynamically.
How can I make sure that the movieclip(dragged and not generated dynamically) comes over it. Right now its coming behind dynamic textboxes
Dynamic Text Box Inside Movieclip
I have a dynamic text box called "desc_txt1" which is inside a movieclip called "thumbScroller"
i cant get it to display the text from the xml file, but if i put the dynamic text box on the main time line then it works..
heres what i have:
on maintime line
thumbScroller.desc_txt1.text = description[p];
and have tried
_root.thumbScroller.desc_txt1.text = description[p];
neither work, does anyone know whats going on?
Regards
Sean
Dynamic Text Inside A Movieclip
I am using MX Professional 2004. I have created a movie using actionscript to place movieclips on the stage. It places dots randomly around the screen. I want to put numbers on the dot. I have a for loop that goes through the array (reorder) that holds all of the dots that are movieclips. The number I want to put on the dot is the element of the array number plus 1. I created a movieclip which is a dynamic text field. It has an instance name of theNumber. The movieclip identifier is nc. If I put “a” inside the parenthesis [t.theNumber.text = string(“a”);] an a will show up inside all of the dots. As the variable 'a' nothing shows up in the dots. Any thoughts on what might be the problem with my script.
Thanks in advance for the help ... Michael
function assignNum(){
for (i=0;i<reorder.length;i++){
var t = attachMovie("nc","nc"+getNextHighestDepth(),getNex tHighestDepth());
a = String(i+1);
t.theNumber.text = string(a);
t._x = this[reorder[i]]._x;
t._y = this[reorder[i]]._y;
}
}
Accessing Dynamic Text In A Movieclip
I have a movieclip of instance name "menuBtn". And within the movieclip itself, I have a dynamic text on it named "btnName".
How do I access the dynamic text in the main timeline?
I tried menuBtn.btnName.Text = "something" and it doesn't work.
btnName.Text = "something" doesn't work either.
So, can someone tell me the correct way to access it?
Dynamic Text Inside A Movieclip
Hey fellas I need to get this dynamic text field changing at the same time the input text field gets changed i know how to do it if its not inside a movieclip but once i insert it in the movieclip i dont know how to get it working.
Thanks
Change Movieclip Color & Text Through Dynamic Txt
Ok, I am developing an interface for a client (to display in their office, not web based). I need to include a way to let the client (not Flash or programming savvy) to update part of the interface saying whether or not property has been available, pending or sold. This will change a circle's color and a word (for example, "Sold!" and the circle would now be red). I can make this work through a dynamic txt file, but I have to use 2 txt files (one for the color and one for the text). My questions are these: How can I make this as simple as possible for the client? I would like to change the txt file so they just input "red" rather than "0xCC0000", and not have two txt files. (when I try to integrate them, the circle turns black rather than the color I specify). Lastly, how would I integrate a database if necessary?
My code on the frame:
Code:
// *************************** //
// MovieClip.setRGB() method //
MovieClip.prototype.setRGB = function(newColor) {
(new Color(this)).setRGB(newColor);
};
// end MovieClip.setRGB()
// *************************** //
var a = new LoadVars();
a.load("properties.txt");
a.onLoad = function(success) {
if (success == true) {
trace("Text file load successful");
// variable representing hex number
circle = new Color("lot1");
nColor =_root.a.lot1;
circle.setRGB(nColor);
} else {
trace("Error: text file did not load properly!");
}
} // end onLoad()
loadVariablesNum("propertiestext.txt", 0);
And my color txt file (properties.txt):
&lot1=0xCC0000
And the word txt file (propertiestext.txt):
&lot1status=Sold!
&textloaded=OK
All help is appreciated! Thanks!!!
Rollover Movieclip Trigger Dynamic Text
i am trying to load dynamic text on a movie clip rollover. my instance name in this case is DynTextBox. this code works for a button but not when i apply it to a movieclip. any suggestions?
on(rollOver) {
this.DynTextBox.text="text goes here";
}
any ideas?
Dynamic Text Inside A Movieclip Not Working
I have a dynamic text field inside a movieclip. But when i run the flash, it doesnt showup anything.
im using:
loadVariablesNum("text1.txt",0); on frame 1 within the movieclip.
Help!
i attached the fla, if it helps.
Text In Dynamic TextField In MovieClip Not Appearing
I'm trying to add an instance of a movieclip, and then add a TextField into it and display some text in that TextField. Everything works fine (movieclip is added, and the TextField is there because the text cursor appears when i mouse over the area where the TextField should be) except the text just doesn't want to appear at all.
Here's my code:
ActionScript Code:
import flash.filters.DropShadowFilter;
import flash.text.TextField;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("data.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
//load XML data
function processXML(e:Event):void {
myXML = new XML(e.target.data);
var textFormatter:TextFormat = new TextFormat("Times",12)
for (var i:int = 0; i<myXML.*.length(); i++) {
var myInstance = new itemContainer();
addChild(myInstance);
//add caption
var textCaption:TextField = new TextField();
myInstance.addChild(textCaption);
textCaption.defaultTextFormat = textFormatter;
textCaption.x = 7;
textCaption.y = 170.5;
textCaption.height = 49.5;
textCaption.width = 200.4;
textCaption.textColor = 0x000000;
textCaption.multiline = true;
textCaption.wordWrap = true;
textCaption.embedFonts = true;
textCaption.visible = true;
textCaption.text = 'blah blah blah';
//add drop shadow
var myFilter:DropShadowFilter = new DropShadowFilter();
myFilter.distance = 2;
myFilter.angle = 45;
myFilter.color = 0x666666;
var filtersArray:Array = new Array(myFilter);
myInstance.filters = filtersArray;
//position and rotate
var xpos = randomNumber(50, 584);
var ypos = randomNumber(50, 373);
var rotate = randomNumber(-25, 25);
myInstance.x = xpos;
myInstance.y = ypos;
myInstance.rotation = rotate;
}
}
Any help would be greatly appreciated
Controlling A Movieclip With A Value In A Dynamic Text Field
Okay I know all you experts are going to be laughing your asses off at me, but I am trying to solve this issue anyways.
I have a movieclip called pointer.mc and this movieclip has only two frames, on the first one the arrow points up and I have a stop(); action on this so it does not jump to the next frame which has the arrow pointing down and this frame also has a stop(); action on it.
Then I have a dynamic text field with an instance name of tiderise which is calling a variable from a seperate .txt file called tiderise.txt and the variable is &rise= . Now I have programmed the .txt file to only supply two variables either "up" or "down" and these change periodically during the day. (I am actually making an animated tide chart if you haven't guessed already)
What I want is to get some coding that will control the movieclip pointer.mc between frame 1 and frame 2 depending on the value in the dynamic text field with an instance name of "tiderise" that can only return the value's of "up" or "down"
Hope someone can help, I have spent already about 2 hours trying to figure this out with no luck, I only seem to be able to control other dynamic text fields with values from another dynamic text field, but cannot seem to get this to work on a movieclip.
Thanks.
Using LoadVariables() To Populate A Dynamic Text In A MovieClip
Hello everyone,
I am trying to populate a Dynamic Text with data from a remote database. I have no problem populating the Dynamic Text with the data from the remote database if the Dynamic Text is placed in the main timeline using the following code.
loadVariables ("php/attorney.php", "");
Once I move the Dynamic Text into a Movie Clip with instance name of “MC_But_1” I am only able to populate the Dynamic Text if I place the above code in the movie clip. Since it is going to take sometimes for the data to be transferred from the remote database I rather to do this on the main timeline before the MC_But_1 is shown. I have used the following code but for some reason it is not working.
loadVariables ("php/attorney.php", _root.MC_But_1);
Can someone be kind enough to tell me where I am going wrong? Thank you very much and have a great day.
Khoramdin
Edited: 08/30/2007 at 10:51:05 PM by Khoramdin
RollOver MovieClip To Display Dynamic Text
I have no ides how to do this.
It must be easy but I can't seem to get it. I have a movie clip called A_mc and a dynamic text field called instance name "Names", when the mouse rolls over the A_mc I want a name assigned to the A_mc to show up in the Names text field.
It seemed simple enough, I have seen it used in educational SWF when the mouse rolls over the A_mc the name of that part or area shows us in the text field.
But I need help HHEELLLP
Dynamic Text Won't Load When Made Into Movieclip
I'm creating a music player that loads info from an external XML file. I'm using Flash8. I did this tutorial:
http://www.kirupa.com/developer/mx2004/maskfonts.htm because I need to scroll a prompt message that is masked.
And my problem isn't the mask (fonts are embeded it's fine) but the dynamic text is not loading from the XML file anymore. I think this is because in the tutorial the first thing you do is make the dynamic text field a movie clip. As soon as I do that the text data doesn't load from the external XML file. The code that previously worked was:
_root.prompt = this.firstChild.childNodes[1].firstChild.nodeValue;
prompt_txt.text = _root.prompt;
But now I made the dynamic text field prompt_txt a movie clip named prompt_mc and it doesn't load. So I realize now that prompt_txt lives inside prompt_mc but how do I get the text data from the XML file there???
Loading Dynamic Text Inside Movieclip
PLEASE HELP!!! I'm in desperate need of assistance. I've been at this for a while and can't figure it out.
I need to:
*Load Dynamic text into a container that (fades in the content and stops). It needs to be controlled by a movie clip acting as a button. I can't figure out how to link up the code so that it works properly. I have five different buttons that will bring up different text each time it is clicked. It needs to fade in with each click. I was able to set it up correctly if everything is on the main timeline, however I have a scrolling banner that has the movieclips (acting as buttons) nested within them and the code will not work. So I am clueless at this point. PLEASE HELP if you know how to do this! I would gladly appreciate it.
Movie clip as button has the following code:
Attach Code
on (release) {
loadText = new loadVars();
loadText.load("text1.txt");
loadText.onLoad = function(success) {
if (success) {
//trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}
Loading Dynamic Text Into A Nexted Movieclip
I've been working at this and searching forums and man, am I getting frusterated. any help would be greatly appreciated. here's what I have on an action frame in _root.
stop();
var format = new TextField.StyleSheet();
var path = "../main.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
_root.pa.aopindividual.styleSheet = format;
loadText = new LoadVars()
loadText.load("../content/attorneys/practice_areas/allen_haugrud.txt");
loadText.onLoad = function() {
_root.pa.aopindividual.htmlText = this.content;
_root.pa.play(1)
};
} else {
_root.pa.aopindividual.htmlText = "Error loading CSS file!";
}
};
now my movieclip is called "pa" and when I get to this scene via my root movie I have the script above loading. it plays the nested movieclip "pa" just fine, but it doesn't load the text in. however, if I take the dynamic text box out of the movie clip "pa" and just have it sitting in my main _root movie and then do this instead:
stop();
var format = new TextField.StyleSheet();
var path = "../main.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
aopindividual.styleSheet = format; //<------------
loadText = new LoadVars()
loadText.load("../content/attorneys/practice_areas/allen_haugrud.txt");
loadText.onLoad = function() {
aopindividual.htmlText = this.content; //<----------------
};
} else {
aopindividual.htmlText = "Error loading CSS file!"; //<----------
}
};
It loads the text. How do I get it to load the dynamic text into the nested movie. help. please. pretty please.
I'm VERY new to this and trying my hardest to learn. (I only know html and css so please dumb your answer down to my level)
Dynamic Text Inside A Running MovieClip
How would I create a symbol that would be a complex animation, and have it contain a dynamic text box that I would change it's value using external ActionScript?
I have noticed that I can't assign the value of the text box if it is not in the first frame of the animation. This problem is really stumping me.
Loading Dynamic Text Into A Nexted Movieclip
I've been working at this and searching forums and man, am I getting frusterated. any help would be greatly appreciated. here's what I have on an action frame in _root.
stop();
var format = new TextField.StyleSheet();
var path = "../main.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
_root.pa.aopindividual.styleSheet = format;
loadText = new LoadVars()
loadText.load("../content/attorneys/practice_areas/allen_haugrud.txt");
loadText.onLoad = function() {
_root.pa.aopindividual.htmlText = this.content;
_root.pa.play(1)
};
} else {
_root.pa.aopindividual.htmlText = "Error loading CSS file!";
}
};
now my movieclip is called "pa" and when I get to this scene via my root movie I have the script above loading. it plays the nested movieclip "pa" just fine, but it doesn't load the text in. however, if I take the dynamic text box out of the movie clip "pa" and just have it sitting in my main _root movie and then do this instead:
stop();
var format = new TextField.StyleSheet();
var path = "../main.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
aopindividual.styleSheet = format; //<------------
loadText = new LoadVars()
loadText.load("../content/attorneys/practice_areas/allen_haugrud.txt");
loadText.onLoad = function() {
aopindividual.htmlText = this.content; //<----------------
};
} else {
aopindividual.htmlText = "Error loading CSS file!"; //<----------
}
};
It loads the text. How do I get it to load the dynamic text into the nested movie. help. please. pretty please.
I'm VERY new to this and trying my hardest to learn. (I only know html and css so please dumb your answer down to my level)
Control Movieclip With Dynamic Text Variable
Hi,
I'm trying to integrate a nav section with a .swf. I want to be able to use normal html for the nav links, and to pass a variable to the swf using setVariable, and for that variable to trigger a movie clip to play.
So far, I'm able to get the variable in to the swf and for it to show on the page. However, it's not triggering the clip to play.
I've got this in html:
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
// set the variable in the SWF
function changetext(str){
if(window.Dog) window.document["Dog"].SetVariable("var_myText", str);
if(document.Dog) document.Dog.SetVariable("var_myText", str);
}
//-->
</SCRIPT>
</head>
<body bgcolor="#ffffff">
<object classid="yada" codebase="http://yada" width="75" height="150" id="Dog">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Dog.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="Dog.swf" quality="high" bgcolor="#ffffff" width="75" height="150" name="Dog" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<form name="form1" method="post" action="">
<input type="button" name="One" value="hello" onClick="changetext('hello')">
</form>
</body>
and
Code:
stop(); //because i don't want it to play till the variable is passed in
if (var_myText == "hello") {
gotoAndPlay(2);
}
on the actions layer. The dynamic text field has a Var: var_myText set. When I try this in the browser, the field is correctly updated with "hello," but the if statement doesn't fire.
Thanks,
John
Help In Passing Variables To Instances Of A Dynamic Text Movieclip
I have constructed a function that returns the square footages of the Living, Garage and Lanai for a specific home designs.
--------------------------------------------------------------
function getDimensions(i:Number):Void {
//Inside the function, arrays are prepopulated for 40 different home designs - eg:
//Martinique Design
aLiving[1]="1,657";
aLanai[1]="203";
aGarage[1]="494";
aTotal[1]="2,354";
//Barbados Design
aLiving[2]="2,040";
aLanai[2]="243";
//etc..
// Followed by code to structure and load the selected array into dynamic text variables
}
----------------------------------------------------------------
the statement:
getDimensions(2);
successfully populates a preformatted, dynamic text layout table on the main timeline with the Barbados design values. The text holder layout table was manually created.
I then moved the text holder table into a separate movieclip and dragged two instances of that MC onto the main timeline, named each instance (e.g. mcDim1 and mcDim2). The function code was left on the main timeline.
What I can't figure out next is how to use my function to populate each instance by passing the home design number (the array key) as before.
I tried things like this.mcDim1.getDimensions(2); but so far I can't get anything to work and have been unable to find the correct syntax in the extensive reference material I have.
Would much appreciate any help.
Alias Text In Dynamic Movieclip Menu Structure
I've been fiddling with Senoculars XML menu.
I wanted to alias my menutext (Tahoma 9pt) but I can't seem to get it right...
I tried Math.round on the positions of the movieclips but it's not working...
Any idea's?
|