Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[F8] Changing Text In Nested Mc



I think this might be a stupid question and there is probably any easy way to do this but I can't work it out for the life of me.

Ok I have a Mc that has about 3 levels so mc nested inside mc's inside another mc. I need to copy the the main mc and use it a number of times. My problem is that I need to alter the text which is deeply nested in the clip.

I don't know if that makes any sense at all? I basically need to a MC repeated but with different text contained within it. can anyone think of a way of doing this? Thanks for any help



FlashKit > Flash Help > Flash Newbies
Posted on: 11-02-2006, 08:09 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Changing Attributes For Mc And All Nested Mc
I don't remember how to change the attributes of mc and all of their nested mc.

meaning:

if I have myMC, and I have myBlueMC within that and myRedMC within that. And say I want to change all of their _color to grey. How do I do this without having to access all of the names of the nested movie clips?

Help With Changing Scene From Nested MC's
Here's the setup. On the main timeline there is a MC (MC1)inside of MC1 there is another MC (MC2)and actions to control MC2. Inside of MC2 are 6 buttons, the navigation for the site. My question is how do I make these buttons change the scene of the main timeline? I tried using the following scripts suggested to me by others but neither worked.

on (release){
_parent._parent.gotoAndPlay ("Fash Portfolio", 5);
}

and

on (release){
_root.gotoAndPlay ("Fash Portfolio", 5);
}

need some help here. thanks

Changing The Depth Of A Nested Movie Clip
Does AS2 offer a way to change the depth of a nested movie clip? I'm working on a project where I need to move a clip (however deep it is nested within other clips placed manually on the stage) to the very top of the movie. I've only had luck bringing the clip's outermost parent to the top using DepthManager.

Thanks in advance.

Changing Color Of A Nested Movie Clip
Ok, so I can change the color of a movie clip fine using actionscript. But say that my movie clip contains an outline and a color inside, and I only want the color inside to change. I figured I should separate the movieclip into two separate clips in order to to this. So now, I need to know how to changed the color of a nested clip.

circle consists of circleOut and circleFill movie clips

container.attachMovie("circle","circle1",1);
var circlefillcolor = new Color(container["circle1"]);
circlefillcolor.setRGB(0x333333);

This code will turn the whole circle including the outline gray.

container.attachMovie("circle","circle1",1);
var circlefillcolor = new Color(container["circle1"].circleFill);
circlefillcolor.setRGB(0x333333);

This code won't do anything color related.

I know I am doing it wrong but I don't know how to fix it. Any suggestions?







Attach Code

container.attachMovie("circle","circle1",1);
var circlefillcolor = new Color(container["circle1"].circleFill);
circlefillcolor.setRGB(0x333333);

























Edited: 02/08/2007 at 03:36:46 PM by Jurgamund

Changing Variable In Document Class From Nested Subclass
Hello you Flash Gurus.

I really hope you can help me on this one. I'm developing a 'point-and-click' OOP game, with several states (of gameplay) and scenes.
In my head, the best structure would be a nested one, where a change of scene or state (in an in-game scene) would send informations to the document class, which then would change the scene.
All right, that's sounds quite complicated I guess. Take a look at this structure:


So there's only a few variables, that controls where the you are in the game.State e.g. Normal Gameplay
SceneNumber or DialogueNumber e.g. Scene1

At this point, I've succeeded in setting State and SceneNumber to "Normal Gameplay" and "Scene1" (where you start the game).
Several actionscript files are then in use, to add MoveClips on to the stage, and the first scene plays just fine.

However, and here's the main issue, I having great trouble telling the document class (state) that it's suppose to change the State or sceneNumber variables.

What I've done, is to let Scenenumber be an extension of Normal Gameplay, and then use
ActionScript Code:
super(_newState, _newSceneNumber)
to bring the information up the structure.
But when I try to make the Normal Gameplay an extension of State, I get the following error:

Quote:




Error: Error #2136: The SWF file file:///C|/Documents%20and%20Settings/(...).swf contains invalid data.
at Tilstand$iinit()




Do any of you guys have a clue, why that isn't possible? Or how to make those kind of "super variables", that is can be edited from a subclass.


Thanks in advance.

Show Text In Dynamic Text Box (nested Movie Clip)
can someone please help me look in my file.. i stuck here 1 day already..
i wan the dynamic text box fill in the number when i click on the button. And the value is keep increasing by 1 once i click the button.

the nested movie clip is as folo,

mc_A-->mc_B-->txtnumber

the button is in the mc_B..


please help me... thanks..

Inserting Xml Text Into A Nested Text Instance
Hi,

I am trying to get some text from an xml file into an instance of a text area named "link1Text" which is nested in a button instance named "link1".

When link1Text was on the stage, not in the button instance, what I have worked fine, but I can't seem to get the code right to have the text show up when it's nested.

here's the code I have for the un-nested instance of link1Text and it works:


HTML Code:
//init link text
link1Text.html = true;
link1Text.wordWrap = true;
link1Text.multiline = false;
link1Text.label.condenseWhite=true;

//load css
myStyle = new TextField.StyleSheet();
myStyle.load("ebook.css");
link1Text.styleSheet = myStyle;

//load in XML
pageContent = new XML();
pageContent.ignoreWhite = true;
pageContent.load("tcm.xml");
pageContent.onLoad = function(success)
{
if(success)
{

link1_Text = this.childNodes[0].childNodes[6].childNodes[1].childNodes[7];
link1Text.text = link1_Text;

}
}
Can anyone tell me how to update my code so it works when link1Text is nested in link1? I know it must be a simple path issue, but my lack of experience is keeping me from figuring this out...

Thanks in advance for any help!

TEXT CHANGING, When I Copy And Paste Text Scroller, And Add New Text......?
here's the problem:

I have a text scroller I took from a fla. file on here.
on my site, I wanted to just change the text. in the text scroller, and
place it in diffrent sections of my site a number of times with diffrent text.

I do not have a problem, copying and pasting the scroller.
But when I change the text from one section, to the next, it will make all the text the same.

If I copy the scroller and paste it somewhere else, swap the text it will change all to that last text I entered.

I tried, typing one section's text. Then copy/pasting the scroller, and putting new text, and converting that text to a symbol (graphic). Hoping it would work but had no LUCK.

This is huge and i need help, considering I am a newbie, there has got to be away this can be accomplished so I dont have to build seperate text holders/scroller, for all 15 sections of my site.

Let me know..and thank you all so much.

Nested Text Field
Hi,

I'm trying to nest an input text field withing a movie clip. Normally it works fine, but when i define and sort of mouse events for the parent movie clip, the text field no longer recieves mouse events, it doesn't even get a cursor anymore.

can anyone help?

Nested Dynamic Text
Hey everyone!

I have a problem (as if you haven't heard that before).

Basically I have a dynamic text field inside a movie clip called
mcAboutText, which itself
is nested inside a movieclip called mcAboutPage which itself is nested
inside a movieclip called mcMain.

Assigning text to mcAboutText from mcMain has no effect on displaying
the text. here is a sample..

****mcMain MovieClip****

_root.mcMain.mcAboutPage.mcAboutText.text = 'The Text To Be Displayed' ;

I've even tried LoadVariables with an external txt file and
that doesn't work either.

Any help or advise would be much appricated

Why Do My Text Fields Not Appear If They're Nested?
Code:
///////////CREATE CLIENT LIST DAMMIT//////////////////


//createEmptyMovieClip("top_menu",this.getNextHighestDepth())

function readSingleDatabaseV(var1, var2, var3, var4, var5) {
var result_l:LoadVars = new LoadVars();
var cI:Number = 1;
result_l.onLoad = function(success:Boolean) {
if (success) {
var txtFormat:TextFormat = new TextFormat()
txtFormat.font = "Tahoma";
txtFormat.color=0x000000
txtFormat.letterSpacing = 1;
txtFormat.size = 10;

top_menu.onEnterFrame = function () {
top_menu.createTextField("prj" + cI,top_menu.getNextHighestDepth(),-2,cI * 19,200,20)
with(eval("top_menu.prj" + cI)){
html =true;
text = (eval("result_l.dbVar"+cI))
//selectable=false;
setTextFormat(txtFormat);
}

cI++;
break;
if (eval("result_l.dbVar"+cI) == undefined) {
delete top_menu.onEnterFrame;
}
};
} else {
trace('got ****ed');
}
};
var send_l:LoadVars = new LoadVars();
send_l.var2 = var2;
send_l.var1 = var1;
send_l.var3 = var3;
send_l.var4 = var4;
send_l.var5 = var5;
send_l.sendAndLoad("http://localhost/tvg/readDB.php", result_l, "POST");
}
readSingleDatabaseV("*","projects ORDER BY prjName ASC","0","0","1");




////////END CLIENT LIST DAMMIT/////////////////////


If top_menu. is gone, they appear fine.. but if nest it... they're invisible... but you can click and copy the text.. just cant see it....

wtf?

Nested Dynamic Text
Hey everyone!

I have a problem (as if you haven't heard that before).

Basically I have a dynamic text field inside a movie clip called
mcAboutText, which itself
is nested inside a movieclip called mcAboutPage which itself is nested
inside a movieclip called mcMain.

Assigning text to mcAboutText from mcMain has no effect on displaying
the text. here is a sample..

****mcMain MovieClip****

_root.mcMain.mcAboutPage.mcAboutText.myTextField.t ext = 'The Text To Be Displayed' ;

I've even tried LoadVariables with an external txt file and
that doesn't work either.

Any help or advise would be much appricated

Nested Component Text Not Appearing
Hello all,
I am creating a module for e-learning. I have the content of the lesson as my main timeline with a quiz at the end as an external swf (that has been placed in a blank movie clip). When testing the file, I can progress through the lesson, and get to the quiz, however, when looking at the quiz items, the text for the individual component items is not appearing. The various button states and graphics are visible, just the text associated with multiple choice, fill in the blank, etc is not showing up. Can anyone tell me where I should look to be able to fix this? Thanks in advance for any help that can be given.

Nested Text Field Alpha
My problem at the moment is as follow. I have a button, which inside has a textfield containing simple labels. My problem is that when I command the button to have an alpha of 0, the text remains. Here is an example of what the text is put into and what I call to tell it to "disappear."

Code that makes button disappear:

Code:
public function removeMenu()
{
menuHolder.alpha = 0;

}//end removeMenu

Code that makes button with text inside:


Code:
private function makeMenu():void
{
var yPos:Number = 0;//y position of next button
addChild(menuHolder);// put holder on stage



menuHolder.alpha = 1; //makes sure the holder is visible
//makes sure text box is visible

//all text formatting IMPORTANT!!
var format:TextFormat = new TextFormat();
format.font = "Verdana";
format.color = 0x000000;
format.size = 12;

var count:int = 0;//counter var
var p:XML; //XML variable to be used in loop
//loop to create each section button
for each (p in menuList) {

// Create the button.
var section:Sprite = new Sprite();
section.name = "section"+count;

//all other mouse events turned off
section.mouseChildren = false;

//makes image behave as a button
section.buttonMode = true;


// creates text field in button
var insideText:TextField = new TextField();
insideText.autoSize = TextFieldAutoSize.LEFT;
insideText.selectable = false;
insideText.defaultTextFormat = format;
insideText.text = menuList[count].text(); //finds section name and prints on button



var down:Sprite = new Sprite();
var up:Sprite = new Sprite();
var over:Sprite = new Sprite();


// button with no mouse over it
up.graphics.lineStyle(1, 0x000000); //rim color
up.graphics.beginFill(0x999999); //rect inside color
up.graphics.drawRect(0, 0, 200, 20);//draws rect
up.alpha = .75;
up.name = "up";//names button state

// mouse is over the button
over.graphics.lineStyle(1, 0x000000);//rim color
over.graphics.beginFill(0x333333);//rect inside color
over.graphics.drawRect(0, 0, 200, 20);//draws rect
over.name = "over";//names button state

// clicked button state
down.graphics.lineStyle(1, 0x000000);//rim color
down.graphics.beginFill(0xCCCCCC);//rect inside color
down.graphics.drawRect(0, 0, 200, 20);//draws rect
down.name = "down";//names button state

// adds the made up, down, and over states (and text label)
section.addChild(up);
section.addChild(over);
section.addChild(down);
section.addChild(insideText);

// Position the text in the center of the button.
insideText.x = (section.width/2) - (insideText.width/2);
insideText.y = (section.height/2) - (insideText.height/2);

// Add mouse events to the button.
section.addEventListener(MouseEvent.MOUSE_OVER, overState); //adds listener for when mouse is over
section.addEventListener(MouseEvent.MOUSE_OUT, noState); //adds listener for when mouse is not over
section.addEventListener(MouseEvent.CLICK, goToLink);//adds listener for when button is clicked

menuHolder.addChild(section);//adds the button to stage

section.y = yPos;//places button's x coordinate
yPos += section.height + 2;//puts next button 2 pixels below current


over.alpha = 0; //hide over state
down.alpha = 0;//hide down state
count++;//add one to count

} //end loop and button creation

menuHolder.x = 15; //place menu location
menuHolder.y = 55; //place menu location


}//end makeMenu()

Accessing A Nested Text Box W/ A For Loop
Hi,

I have four Movie Clips with the following instance names: "A", "B", "C", "D". Each Movie Clip has a nested Dynamic Text box with an instance name of "txt".

I am aware that I can change the dynamic text inside these clips like so:

A.txt.text = "some new text for A";
B.txt.text = "some new text for B";

My problem is that I'm trying to do this using a loop and I can't seem to make it work. Here's what I have:

var mcArray:Array = new Array("A","B","C","D");
for(i:uint = 0; i < mcArray.length; i++)
{
mcArray[i].txt.text = "some new text";
}

What am I missing here to make this work?
Any help is appreciated, thanks!

Dynamic Text Field In Nested Mc
I'm having problems with a dynamic text field not displaying its text. It's nested several clips deep, but if I check the "display variables" debug option, it's receiving the text from the variable; if just doesn't show.

After searching around a bit, I've tried the following things:

* Setting the mask through ActionScript, rather than through the GUI
* Making the dynamic text field its own movie clip
* Embedding the font for the dynamic text field

None of these, either individually or in any combination with the other methods, have shown the text in the text field. Anyone have any other ideas?

Rys

Invisible Text In Nested Movieclip
Hi every one!

Is it somehow possible to display dynamic text that is first loaded into a container (movieclip) in one .swf which is then loaded into a container i another .swf? I've tried to do this but without any luck so far. Ive embedded both the font (Arial) and characters used, which did not do the trick...

Can someone please help me?

Nested Dynamic Text Won't Display
Everything works correctly below. The new button displays on stage, but the nested dynamic text (instance name "campText") will not display.

1119: Access of possibly undefined property campText through a reference with static type flash.display:SimpleButton.


Here's the short code:

import flash.display.SimpleButton;
import flash.display.*;
import flash.text.TextField;

var myButton:SimpleButton = new camp();
myButton.x = 350;
myButton.y = 100;
myButton.campText.text = "CAMP";
addChild(myButton);

Targeting A Nested Input Text Box
I have a movie clip which contains an input text box. This movie clip resides on my main stage, and is masked using a mask layer which is also on the main stage. I am unable to select or enter information into the input text box. Is there a way to target the input text box within the masked movie clip?

Nested Dynamic Text Won't Display
Everything works correctly below. The new button displays on stage, but the nested dynamic text (instance name "campText") will not display.

1119: Access of possibly undefined property campText through a reference with static type flash.display:SimpleButton.


Here's the short code:

import flash.display.SimpleButton;
import flash.display.*;
import flash.text.TextField;

var myButton:SimpleButton = new camp();
myButton.x = 350;
myButton.y = 100;
myButton.campText.text = "CAMP";
addChild(myButton);

Loading Text In Nested Clip
i got and modified the following code for my movie. But it seems not to load the text from the external .txt file. the code resides in vita_group.swf and i'm loading the vita_group.swf into an empty movie clip (contents) which is located in my main movie. I think the targeting may be off but i'm not sure. I tried changing this.loadVariables ("filename.txt") to _root.contents.loadVariables("filename.txt") but it didn't work
any ideas?

onClipEvent (load){
this.loadVariables("http://www.tonyoursler.com/tonyourslerv2/vita/collections.txt");
loadText.onLoad = function() {
daTextBox.html = true
daTextBox.htmlText = this.daTextBox;
}
scrolling = 0;
frameCounter = 1;
speedFactor = 2;
numLines = 7;

origHeight = scrollbar._height;
origX = scrollbar._x;
needInit = false;

function initScrollbar(){

var totalLines = numLines + daTextBox.maxscroll - 1;
scrollbar._yscale = 100*(numLines)/totalLines;
deltaHeight = origHeight - scrollbar._height;
lineHeight = deltaHeight/(daTextBox.maxScroll - 1);
}
function updateScrollBarPos(){

scrollbar._y = lineHeight*(daTextBox.scroll - 1);
}
}

onClipEvent (enterFrame){

if( needInit ){
if(daTextBox.maxscroll > 1){
initScrollbar();
needInit = false;
}
}
if( frameCounter % speedFactor == 0){

if( scrolling == "up" && daTextBox.scroll > 1){
daTextBox.scroll--;
updateScrollBarPos();
}
else if( scrolling == "down" && daTextBox.scroll < daTextBox.maxscroll){
daTextBox.scroll++;
updateScrollBarPos();
}
frameCounter = 0;
}
frameCounter++;
}

onClipEvent (mouseDown){

if(up.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "up";
frameCounter = speedFactor;
up.gotoAndStop(2);
}
if(down.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "down";
frameCounter = speedFactor;
down.gotoAndStop(2);
}
if(scrollbar.hitTest(_root._xmouse,_root._ymouse)) {
scrollbar.startDrag(0,origX,deltaHeight,origX);
scrolling = "scrollbar";
}
updateAfterEvent();
}

onClipEvent (mouseUp){

scrolling = 0;
up.gotoAndStop(1);
down.gotoAndStop(1);
stopDrag();

updateAfterEvent();
}

onClipEvent (mouseMove){
if(scrolling == "scrollbar"){
daTextBox.scroll = Math.round((scrollbar._y)/lineHeight + 1);
}
updateAfterEvent();
}

onClipEvent (data){
needInit = true;
}

Text From .txt Not Loading Into Nested Clip
my .txt file is not loading into my nested movie clip for some reason. I think I have directed it correctly (a section of the code is below which I think is the problematic part)

onClipEvent (load){
_parent.contents.vitaHolder.loadVariables("http://www.tonyoursler.com/tonyourslerv2/vita/solo.txt");
_parent.contents.vitaHolder.loadText.onLoad = function() {
_parent.contents.vitaHolder.daTextBox.html = true
_parent.contents.vitaHolder.daTextBox.htmlText = this.daTextBox;
}

I have always had problems with loading outside text into nested mcs. Hoping to understand once and for all!!!!

mista

Load Text In Nested Swf Problem
I have a problem with nested swf files. I have main.swf loading separate sections (section1.swf, section2.swf, etc.)
I placed on the main timeline of section1.swf the following:

text_area = new LoadVars();
text_area.onLoad = function(success) {
if (success) {
content.htmlText = this.content;
}
};
text_area.load("welcome.txt");

It works fine when I test section1.swf by itself, but when I load section1.swf into main.swf the text no longer loads.

What am I doing wrong?

Dynamic Text Field In Nested Mc
I'm having problems with a dynamic text field not displaying its text. It's nested several clips deep, but if I check the "display variables" debug option, it's receiving the text from the variable; if just doesn't show.

After searching around a bit, I've tried the following things:

* Setting the mask through ActionScript, rather than through the GUI
* Making the dynamic text field its own movie clip
* Embedding the font for the dynamic text field

None of these, either individually or in any combination with the other methods, have shown the text in the text field. Anyone have any other ideas?

Rys

Dynamic Text Variable In Nested MC
Good day,

I am working on passing variables from dynamic text boxes to a PHP script. Most of the dynamic text boxes are located on the main timeline, and the values get passed without a problem. However, I have two dynamic text fields in separate nested movie clips that when passed show up as 'undefined'.
I am pretty sure that the path I am using is wrong (although I am using every combination that I can think of). I am still a bit of a newbie, so it could be anything. I have spent the last two days googling, checking out forums and reading the books I have without any luck.

Does anyone have any ideas as to what I can try?

The code I am using is;


Code:
var name = this.nested_movie_mc.text_variable
I have also tried


Code:
var name = _root.nested_movie_mc.text_variable.text

Code:
var name = _parent.nested_movie_mc.text_variable
and every other combination I could think of.

Just to make sure everything is clear; 'name' is the variable I want to send to the PHP script, 'nested_movie_mc' is the name of the movie clip in which the dynamic text box resides and 'text_variable' is the variable name of the dynamic text box.

Any help would be greatly appreciated.

Thanks and have a good day.

Nested Dynamic Text Box Problem.
I'm setting up a drop down menu that will contain dynamic text boxes that allow me to change the names of the various menu items from a text file. Anyways, I can't seem to get the text box in the slide out movie to use the variable data in the text file. Here's the code in the main scene --

loadVariablesNum("names.txt", 0);
_root.dropdownmov.item1.text = dropdownmov.var4;

"dropdownmov" is the name of the first drop down movie that contains the first set of menu items and is called via telltarget when I roll over a button in the main scene.

"item1" is the instance name for the first menu item button.

"var4" is the variable associated with the item1 button.

The text file contains this line:

&var4=page_info&

I want the first menu item to get the name "page info" from the text file. Any help would be appreciated, beause I'm banging my head against the wall at this point.

Loading Text In Nested Clip
i got and modified the following code for my movie. But it seems not to load the text from the external .txt file. the code resides in vita_group.swf and i'm loading the vita_group.swf into an empty movie clip (contents) which is located in my main movie. I think the targeting may be off but i'm not sure. I tried changing this.loadVariables ("filename.txt") to _root.contents.loadVariables("filename.txt") but it didn't work
any ideas?

onClipEvent (load){
this.loadVariables("http://www.tonyoursler.com/tonyourslerv2/vita/collections.txt");
loadText.onLoad = function() {
daTextBox.html = true
daTextBox.htmlText = this.daTextBox;
}
scrolling = 0;
frameCounter = 1;
speedFactor = 2;
numLines = 7;

origHeight = scrollbar._height;
origX = scrollbar._x;
needInit = false;

function initScrollbar(){

var totalLines = numLines + daTextBox.maxscroll - 1;
scrollbar._yscale = 100*(numLines)/totalLines;
deltaHeight = origHeight - scrollbar._height;
lineHeight = deltaHeight/(daTextBox.maxScroll - 1);
}
function updateScrollBarPos(){

scrollbar._y = lineHeight*(daTextBox.scroll - 1);
}
}

onClipEvent (enterFrame){

if( needInit ){
if(daTextBox.maxscroll > 1){
initScrollbar();
needInit = false;
}
}
if( frameCounter % speedFactor == 0){

if( scrolling == "up" && daTextBox.scroll > 1){
daTextBox.scroll--;
updateScrollBarPos();
}
else if( scrolling == "down" && daTextBox.scroll < daTextBox.maxscroll){
daTextBox.scroll++;
updateScrollBarPos();
}
frameCounter = 0;
}
frameCounter++;
}

onClipEvent (mouseDown){

if(up.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "up";
frameCounter = speedFactor;
up.gotoAndStop(2);
}
if(down.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "down";
frameCounter = speedFactor;
down.gotoAndStop(2);
}
if(scrollbar.hitTest(_root._xmouse,_root._ymouse)) {
scrollbar.startDrag(0,origX,deltaHeight,origX);
scrolling = "scrollbar";
}
updateAfterEvent();
}

onClipEvent (mouseUp){

scrolling = 0;
up.gotoAndStop(1);
down.gotoAndStop(1);
stopDrag();

updateAfterEvent();
}

onClipEvent (mouseMove){
if(scrolling == "scrollbar"){
daTextBox.scroll = Math.round((scrollbar._y)/lineHeight + 1);
}
updateAfterEvent();
}

onClipEvent (data){
needInit = true;
}

Text From .txt Not Loading Into Nested Clip
my .txt file is not loading into my nested movie clip for some reason. I think I have directed it correctly (a section of the code is below which I think is the problematic part)

onClipEvent (load){
_parent.contents.vitaHolder.loadVariables("http://www.tonyoursler.com/tonyourslerv2/vita/solo.txt");
_parent.contents.vitaHolder.loadText.onLoad = function() {
_parent.contents.vitaHolder.daTextBox.html = true
_parent.contents.vitaHolder.daTextBox.htmlText = this.daTextBox;
}

I have always had problems with loading outside text into nested mcs. Hoping to understand once and for all!!!!

mista

Load Text In Nested Swf Problem
I have a problem with nested swf files. I have main.swf loading separate sections (section1.swf, section2.swf, etc.)
I placed on the main timeline of section1.swf the following:

text_area = new LoadVars();
text_area.onLoad = function(success) {
if (success) {
content.htmlText = this.content;
}
};
text_area.load("welcome.txt");

It works fine when I test section1.swf by itself, but when I load section1.swf into main.swf the text no longer loads.

What am I doing wrong?

Text Rendering Problem In Nested MC's
I'm having one of those "Why the *&#$& isn't this working" problems, and am about to chuck my Apple 23" HD display out the window... hope someone can help.

I have three SWF files, we'll call them clipA, clipB, and clipC. clipA is basically the core of the site, and provides navigation, sound, etc. Within cliipA is a blank MC where clipB is loaded when the user makes a selection from the navigation. Within clipB I have another blank MC where I load clipC. Again, the user makes a choice from the submenu in clipB, therby loading the appropriate clipC.

My dilemma: clipC contains htmlText which is drawn from a MySQL database via PHP. The text renders properly, and the scrollbar moves the text up and down within the box when clipC.swf is run.

The same goes for clipB. When I run clipB.swf and trigger an event which causes clipC to load into the MC, again the text in clipC renders correctly (using CSS) the scrollbar works, blah blah blah...

But alas, when I try it from the main clip, in this case clipA the textbox is empty. The scrollbar appears as if there is text in the box, and I can drag it up and down just like I could in the previous 2 examples. But no text is visible.

I can't figure it out. For the life of me, I can't figure it out -- and a deadline is fast approaching.

Any ideas???

Setting Text In Nested Movieclips?
setting text in nested movieclips?

I want to create movieclips depending on the amount of letters in a string and next I'd like to embed textfields inside these clips (works fine). Now I'd like to set the text in those textfields. But it seems to be that it's impossible to address these created fields.

What am I doing wrong over here guys and girls ;-)



Code:
createField = function(nr) {
this["clip" + nr].createTextField("fld" + nr, 100+nr,20*nr,0,20,20);
// the code below doesn't work
// I'd like to fill the fields with some text
// how should I address the fields
with(this["clip" + nr]) {
this["fld" + nr].text = nr;
}
}

createClip = function() {
for (j=0; j<10; j++) {
createEmptyMovieClip("clip" + j, 200+j);
with(this["clip" + j]) {
createField(j);
}
}
}


createClip();

Dynamic Text Nested In Movieclips
Hello, I am new to this forum. I joined because I need some help with dynamic text.
I have a movieclip resting on the main timeline that contains a dynamic text field. I would like to be able to edit the text outside of Flash. Currently I can get this to work if the dynamic field is on the main timeline. Inside a movieclip is another story.
The script calling the external text is on an actions layer within the movieclip
loadVariablesNum("prime.txt", 0);
The var name set on the dynamic field is
vp01
The variable set up in prime.txt is
vp01=Hello

Does anyone know how to do this so that the text shows up?

Nested Dynamic Text Problem
Okay, I've seen this listed before, but I am having a lot of problems with this issue and I can't resolve it. So, here goes:

I have a main timeline with a mc holder. I am loading a swf into that mc holder. In that swf I have another mc holder that is loading yet another swf. I have a scrolling, dynamic text field in a third move that is being loaded into that movie. It is dynamically loading a txt file.

(envision - main menu loading a section page loading a subsection page loading a txt file)

It works when I export the movie it lives in.
It works when I export the movie it is nested in.
It does not work when I export the main movie.

What gives?
thanks
laura

Changing Font And Size Of Text Added To Dynamically Created Text Fields
Whew.. That long-winded subject line pretty much covers it.

Link

In the galleries, I have text I am adding to a movieClip. I have been able to add the description text, change it's colour, but the font and size are not responding. I'm using FlashMX2004. Can anyone show me what I'm doing wrong? Here's the pertinent code:

_parent.Gallery.createTextField(["Txt_" + CVar], _parent.LevelCount + 1000, 175, _parent.EntryY, 325, 110);
_parent.Gallery["Txt_" + CVar].font = "Arial";
_parent.Gallery["Txt_" + CVar].text = _parent.Description[AVar];
_parent.Gallery["Txt_" + CVar].textColor = 0xFFFFFF;
_parent.Gallery["Txt_" + CVar].textSize = 25;


Thanks so much!

Changing Text Inside A Text Field, Bold/Italic/Underline Ect ...
Is it possible to change the appearance of text inside a text field, like say to bold, italic, underline, color and even a type of font if need be ... ?

Example:

Like say you have text field, and you have some option buttons, (bold/italic/underline/color/type-of-font) that when clicked on will dynamicaly change the text/font appearance in the text field.

Any tutorials on this matter, anyone know ?

Copy And Paste Of TEXT SCROLLER, CHANGING TEXT, To Stay For Each Section......?
here's the problem:

I have a text scroller I took from a fla. file on here.
on my site, I wanted to just change the text. in the text scroller, and
place it in diffrent sections of my site a number of times with diffrent text.

I do not have a problem, copying and pasting the scroller.
But when I change the text from one section, to the next, it will make all the text the same.

If I copy the scroller and paste it somewhere else, swap the text it will change all to that last text I entered.

I tried, typing one section's text. Then copy/pasting the scroller, and putting new text, and converting that text to a symbol (graphic). Hoping it would work but had no LUCK.

This is huge and i need help, considering I am a newbie, there has got to be away this can be accomplished so I dont have to build seperate text holders/scroller, for all 15 sections of my site.

Let me know..and thank you all so much.

[F8] Can Flash Load Text Without Changing It And Display Whats Raw In The Text File?
just curious... I just want flash to read a txt file and do nothing to it... just echo it out loud and display it in Flash...
is there a way to do this?

like if the text file had "the quick brown fox jumped over the lazy dog" in it and NOTHING else... no variable syntax or anything..

is there a way this can be done?

I appreciate anybody who can help

Dynamic Text/scroll Bar Component Changing Text Formatting
I would apologise if this has been answered before but I have done a quick search & was unable to resolve it & I'm up against a dead line.

I have a dynamic text field onto which I have placed a scroll bar component problem I have got is that the dynamic field has now lost all of it's formating -the header was orginally slightly larger & of a different font.

Anyone please tell me how to resolve this.

Thanks

Nested Movie Clips, Dynamic Text, Help
I am developing a little site, and I have a menu on the root level of the movie, when you roll over a button, there is an action script to start up a movie clip called "menu_clips" , menu clips has a text box that tweens into place and a dynamic text box that changes for each menu item. the root level is all in frame 1 and I have menu_clips in its own layer with instance name "menu_clips" , it works fine with a dynamic text box in the clip "menu_clips" however I want to place the dynamic text box into a container movie clip called "text_box" or something like that, so I can move it around within "menu_clips" more easily. I am having some trouble getting this to work. With "menu clips" I placed an intance of "text_box" (which contains my dynamic text box, variable "menuTextBox") and named the instance "text_box", on the root level, I originally had an actionscript like this:

on (rollOver) {
if (menu_clips.menuTextBox==_root.about) {
stop ();
}else {
setProperty ("menu_clips", _visible, 1);
setProperty ("about_matt", _visible, 1);
about_matt.gotoAndPlay(1);
menu_clips.gotoAndPlay(12);
menu_clips.menuTextBox = _root.about;
}
}
this worked fine, however I can't really do much with a dynamic text box on its own, the new script which does not work looks like this:

on (rollOver) {
if (menu_clips.text_box.menuTextBox==_root.about) {
stop ();
}else {

setProperty ("menu_clips", _visible, 1);
setProperty ("about_matt", _visible, 1);
about_matt.gotoAndPlay(1);
menu_clips.text_box.menuTextBox = _root.about;
menu_clips.gotoAndPlay(12);
}
}

I have also tried just
"text_box.menuTextBox = _root.about;"

but I am having no luck with this one

Please help if you can, any suggestions would be very much appreciated. Thank you.

If you'd like to see the movie, you can check it out here
http://www.roznet.com/ and click on the new roznet preview link, keep in mind it's just a preview and will eventually be full of nice effects and content, but for now it's very basic

Problem With Nested Components And Displaying Text.
Help!

I have a strange problem, which i'm not sure why is happening.

Here is my scenario. I have a component that i have created. It is basically a dynamic text box with HTML rendering enabled. It has a variable name associated with it so that when i type in my HTML code in the external component definition it shows up as one would expect displayed in the text box. I have a couple of other variables that i pass it as well so i can do things when the user clicks on the "link", so in total i have like 3 variables i pass in.

This component works like a charm and i have used in the past for alot of things, BUT last night i encountered a problem with it. It seems that for some reason when i take this component and put it inside a another symbol (like a movieclip or something) the text no longer shows up. The variable is being passed properly as i have tested it using Actionscript traces, the text just plain and simple doesn't show up. The link is even there since when i do a mouse over it turns to the little hand and you can click on it and it does what you asked it to do.

So I found this guys blog entry that talks about problems with fonts not embedding properly in flash http://www.scottmanning.com/archives/000400.php and so i tried embedding the font in all my movies and doing what he said but it still didn't work. Does anyone have any idea why this is doing this? I may have missed something with embedding the font or something (it was late) but i can't figure out why it's doing this.

Any help would be MUCHO appreciated.


Thanks

Brent.

Dynamic Text Problem With Nested Movies
i have a dynamic textfield using just the 'Arial' font, populated by an xml file.
without embedding the font, the text field appears correctly when tested on the server....
however, this movie (that contains this textfield) when loaded into another swf does not display the dynamic text at all!!

this is not an issue with flash not reading the xml file, because it still correctly passes images into the nested swf correctly....

do i need to embed the font into either of these movies? but it's not like i'm trying to use some exotic font...

i'm stumped!

thanks!

Dynamic Text Field Not Displaying In Nested MC...
Now I have a dynamic text field that loads and displays fine when I play the movie it is in from _root. But... I have that movie nested in another which is nested in another. When I play them nested together the dynamic text field will not display. There is an apparent area where the mouse changes to a cursor like a text field should be there, but nothing...

Anyone know how to fix this?

Here is the code where I create the text field...


ActionScript Code:
var news_var:String = "";
var xmlNews:XML = new XML();
xmlNews.ignoreWhite;
xmlNews.load("../news.xml");

xmlNews.onLoad = function(bSuccess:Boolean):Void {
if (bSuccess){
var xnRootNode:XMLNode = this.firstChild;
var aNewsItems:Array = xnRootNode.childNodes;
for(var i:Number = 0; i < 3; i++){
var aNewsItem:Array = aNewsItems[i].childNodes;
for(var j:Number = 0; j < aNewsItem.length; j++){
news_var += aNewsItem[j].firstChild.nodeValue + "
";
}
news_var += "
";
}
}
else{
news_var = "Document failed to load or parse. Error code: " + xmlNews.status;
}

_root.createTextField("newsText",5,251.9,7.8,348,197);
newsText.multiline = true;
newsText.wordWrap = true;
newsText.border = false;
newsText.html = true;
newsText.selectable = true;
newsText.embedFonts = true;

newsFormat = new TextFormat();
newsFormat.color = 0xffffff;
newsFormat.bullet = false;
newsFormat.underline = false;
newsFormat.size = 12;
newsFormat.font = "fontNews";

newsText.text = news_var;
newsText.setTextFormat(newsFormat);
};

Dynamic Text Field Not Showing In Nested MC...
Now I have a dynamic text field that loads and displays fine when I play the movie it is in from _root. But... I have that movie nested in another which is nested in another. When I play them nested together the dynamic text field will not display. There is an apparent area where the mouse changes to a cursor like a text field should be there, but nothing...

Anyone know how to fix this?

Here is the code where I create the text field...

var news_var:String = "";
var xmlNews:XML = new XML();
xmlNews.ignoreWhite;
xmlNews.load("../news.xml");

xmlNews.onLoad = function(bSuccess:Boolean):Void {
if (bSuccess){
var xnRootNode:XMLNode = this.firstChild;
var aNewsItems:Array = xnRootNode.childNodes;
for(var i:Number = 0; i < 3; i++){
var aNewsItem:Array = aNewsItems[i].childNodes;
for(var j:Number = 0; j < aNewsItem.length; j++){
news_var += aNewsItem[j].firstChild.nodeValue + "
";
}
news_var += "
";
}
}
else{
news_var = "Document failed to load or parse. Error code: " + xmlNews.status;
}

_root.createTextField("newsText",5,251.9,7.8,348,1 97);
newsText.multiline = true;
newsText.wordWrap = true;
newsText.border = false;
newsText.html = true;
newsText.selectable = true;
newsText.embedFonts = true;

newsFormat = new TextFormat();
newsFormat.color = 0xffffff;
newsFormat.bullet = false;
newsFormat.underline = false;
newsFormat.size = 12;
newsFormat.font = "fontNews";

newsText.text = news_var;
newsText.setTextFormat(newsFormat);
};

Dynamic Text In Nested Movie Clip
i have a dynamic text box in nested movie clip.. there are..

A_mc--->B_mc-->txtnumber

txtnumber is in B_mc, B_mc is in A_mc..

the txtnumber is blank. i wan to fill in number when i press on the button. and keep increasing if i continue press the button..
my code is like follow,


Code:
on(release){

Number(_root.A_mc.B_mc.txtnumber.text)=Number(_root.A_mc.B_mc.txtnumber.text)+1;

}
but the number has not show in the txtnumber....could someone please help me?? thanks a lot..

Nested Dynamic Textbox Will Not Display Text
Hi All,

Having a weird problem with my flash file (MX 2004).
I am loading an XML file in, and have no problems parsing the data into arrays etc.

I have 2 textboxes. 1 textbox is for debugging, it is in the root timeline (_root.testfield_txt). 1 more is inside a movie clip. 2 movie clips deep to be exact (_root.map_mc.infobox_mc.info_txt).

Note:
both testfield and infobox are dynamic textboxes, html enabled, font is arial, and i have embedded NO characters.

I have setup a rollover handler to display the text i loaded from my XML, which is a mix of english and korean text. I set it up to display in both the testfield and also the info field by using a simple textbox.htmlText = mytext.

Problem:
testfield: the text will ALWAYS display correcty, both english and korean.
infobox: NO text appears. Only if i embed the characters (Uppercase and Lowercase) will the english text display. Korean text still comes out as blank or squares.

I am also tracing the output, and both show the same output text. I just can't see anything in the infobox if i don't embed anything.

Why will I only see the infobox if i embed characters when it obviously works without even needing to embed any? (ie. testfield works fine, english and korean)

Is it because it's nested too deep?

Any and all help will be much appreciated
My apologies for the long post. Have spent half a day with this already


Thanks

irot

Text Field Nested In Movie Clip
in this code here, i create a movie clip, which will be used as a button, and then a text field inside of it. everything works when i don't specify width and height properties to menu.home. but when i do put width and height, as is shown in the code below, the text doesnt show up.

i need to have a button, and then be able to move the text inside the button wherever i want without actually moving the position of the button.


Code:


menu_buttons();
function menu_buttons() {
var textformat1=new TextFormat();
textformat1.font="arial";
textformat1.size=16;
textformat1.color=0x000000;
menu.createEmptyMovieClip("home",201);
menu.home._height=50;
menu.home._width=150;
menu.home.createTextField("menuText",202,20,60,100,40);
menu.home.menuText.setNewTextFormat(textformat1);
menu.home.menuText.text="Home";
var inX=menu.home.menuText._x;
var outX=inX+50;
menu.home.onRollOver=function() {
menu.home.onEnterFrame=function() {
this.menuText._x+=(outX-this.menuText._x)*.15;
}
position*=-1;
}
menu.home.onRollOut=function() {
menu.home.onEnterFrame=function() {
this.menuText._x+=(inX-this.menuText._x)*.15;
}
}
}

Changing Input Text To Dynamic Or Static Text.
How would I do this? Is it possible? Or is there another way such as changing the input text fields variable?



Thanks for your patience,
Nionicle

Changing The Color Of The Text In Dynamic Text Field..
Hi all,

on click of a button is it possible to change the color of the text in the dynamic text field... & how??? using Flash 5...

thanx,
Shibs..

Changing The Color Of Text In A Dynamic Text Field?
Any ideas how I can change the color of a dynamic text field when a button is pressed. I have tried everything but nothig seems to work. Any ideas appreciated :-)


but.onPress = function (){
change = new FStyleFormat({textColor:0x8D0101});
change.dytext.applyChanges();
}

Copyright © 2005-08 www.BigResource.com, All rights reserved