Accessing Field Within A MC Hierarchy
Please take a look at the picture. Known Facts: 1. MC1 and MC2 are childs of MC3 2. Fields 'Test', 'Score' and 'Date Taken' belong to MC2
Problem: I cannot access those fields within the main timeline. What am I doing wrong?
Here's how I do it:
MC3.MC1.Test.text = 'English'; MC3.MC1.Score.text = '123';
Thanks, Raymond
FlashKit > Flash Help > Flash MX
Posted on: 04-28-2003, 09:39 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Accessing Dynamic Text Field
I have a dynamic text field that I have placed directly on the stage prior to run-time (i.e. not using Actionscript). The text field's instance name is "info1" and when I access it from my document class it works great. (e.g. "info1.visible = false").
When I try to access info1 from other classes however, it doesn't work. I've tried using "root.info1..." and "parent.info1..." and "stage.info1..." but nothing seems to work. Does anybody know how to access that text field from non-document classes?
Any explination for why that procedure needs to be different would also be a big help to this newbie, thanks!
Accessing Text Field - Tricky One
my problem is structured like this
Main Movie
|
result MC <created dunamically>
|
name <dy text field> + button
bacically want to access the dy text field from the on(release) command of the button
should this not be _parent.name ????
when i try to trace it it is undefined???
TNX
Accessing Dyn Field Within A Named Button
Hallo,
It seems I can't manage to change the text of a dynamic field within a named button.
here is the cod
ActionScript Code:
this.button3D.label3D.htmlText = "Ciao";
this.button3D.sign3D.htmlText = "Attention: blabla";
the button instance has "button3D" as name of course, and the inner fields have "label3D" and "sign3D" as instance name.
They are both html fields, yet: nothing, how come?
Thank you very much for any help
m.
Accessing A Text Field That Was Created In A Function
Maybe the function has nothing to do with it. But, I create a text field in a function on frame 1 and it shows up just fine:
Code:
if (nAnswers > 1)
{
var feedback:TextField = new TextField();
feedback.x = 100;
feedback.y = 200 + ((nAnswers + .5) * 30);
feedback.multiline = true;
feedback.width = 600;
var format:TextFormat = new TextFormat();
format.font = "Arial";
format.color = 0x666666;
format.size = 12;
format.bold = true;
feedback.defaultTextFormat = format;
feedback.text = "Select an Answer";
addChild(feedback);
}
then on frame 2 I want to access that text field and change what it says:
Code:
feedback.text = "New Text!"
But, I keep getting the error:
1120: Access of undefined property feedback
I see the textfield on frame 2 when I go to it, but I can't seem to change it...
What am I doing wrong?? How do I access textfields that I create on the stage?
Accessing Text Field Inside Movie
I want to address a text field ("/ann_input") which is located inside a mc ("/ann_mov"). How do I do that? This is what I've tried out already:
Code:
onClipEvent (enterFrame) {
if (ann_mov._currentFrame == 2 AND ann_mov.ann_input != "") {
this.gotoAndStop(2);
}
}
also:
Code:
onClipEvent (enterFrame) {
if ("/ann_mov"._currentFrame == 2 AND "/ann_mov"."/ann_input" != "") {
this.gotoAndStop(2);
}
}
- naturally, neither works. HELP!
Accessing A MC Instance Name From A Text Field, And Playing It...
I have a MC with an instance name, 'JOE'.
I have a dynamic text field with an instance name, 'EMP_NAME'.
The text field is set to "" default.
Upon runtime, I assign a text value of 'JOE' into 'EMP_NAME'.
Hence, _root.EMP_NAME.text = "JOE";
Once that's done, I want the MC to check the text in 'EMP_NAME', and play if the text is 'JOE'.
As of now, I have an 'if' statement to do that check. Since I'm going to have many MCs I do not want to add more 'if' statements or 'switch' cases as that would simply be hardcoding. I want to add more MCs with unique instance names like 'JOE', 'RICK', 'PAT' etc. and should correspondingly play the MC whose instance name matches to that assigned to 'EMP_NAME' directly and not with a condition.
Ideally speaking, though the syntax is incorrect, this is what I'm trying to do:
Code:
_root.emp_name.text.gotoAndPlay(10); //which is incorrect
alternatively,
Code:
var instance_name = _root.holder.text;
_root.instance_name.gotoAndPlay(10); // which is also incorrect.
So, is there a one liner code that would directly play the corresponding movie clip once after having read its instance name from the dynamic text field, WITHOUT a conditional statement?
Me make sense?
Problem Accessing Text Field Using Droptarget
Hi All
I have a flash application which is kind of quiz game. User has to drag and drop the option in appropriate location. Options and questions are movie clips on stage with text field, when I drag and drop the option on question I am unable to retrieve the text field content of the question. However I am able to retrieve textfield content of option.
Code:
function drag(evt:MouseEvent) {
trace("target name is "+evt.target.parent.name); \target name is o0
var textName:String=evt.target.parent.name;
var targetName:DisplayObject=getChildByName(textName);
trace(targetName.sname.text);
startx=evt.target.parent.x;
starty=evt.target.parent.y;
targetName.startDrag(true);
}
function drop(evt:MouseEvent) {
var textName:String=evt.target.parent.name;
var targetName:DisplayObject=getChildByName(textName);
targetName.stopDrag();
trace(targetName.x +" "+targetName.y); \65 60
evt.target.parent.x=startx;
evt.target.parent.y=starty;
trace("target name is "+targetName.dropTarget.name); \target name is instance20
var dropTargetN:String=targetName.dropTarget.name;
trace("dropTargetN "+dropTargetN); \dropTargetN instance20
var dropTargetName:DisplayObject=getChildByName(dropTargetN);
trace("Text of droptarget "+dropTargetName); \Text of droptarget null
}
Trace of above code shows
Code:
target name is o0
Cu
65 60
target name is instance20
dropTargetN instance20
Text of droptarget null
How do I get the text field content of the questions? I have tried adding the options and questions on stage programatically too. Any help would be appreciated.
Thanks in advance
Accessing Text Field Contents, Assigning To Variable
I want to set the contents of a variable ("zone1var") to the contents of a text field ("zone1"), which is inside a movie clip ("colorPicker"). So if the text field contains the text "CCFF00", I want the variable zone1var to equal "CCFF00". How do I write that in Actionscript?
This is what I tried, but it didn't work.
Code:
zone1var = colorPicker.zone1.text;
Accessing A String From A Variable Input Text Field
I'm trying to access the string from an input text field with this code but it isn't working:
Code:
empty.onEnterFrame = checkText;
var focus:String = new String();
var myTextNumber:String = new String();
var origMyText:String = new String();
var newMyText:String = new String();
function checkText():Void{
//Extract the number from the input text field in focus
focus = Selection.getFocus();
myTextNumber = focus.substr(15);
//Compare the original text with the input text
origMyText = myArray[myTextNumber];
trace(origMyText); // returns the correct string
newMyText = myInput[myTextNumber].text; //How do you do this?
trace(newMyText); // returns undefined
if(newMyText == origMyText){
trace(newMyText+" = "+origMyText);
}
}
Here's the full code so you can see more clearly what I'm doing:
Code:
//Load the text
var myVars:LoadVars = new LoadVars();
myVars.load("words_text.txt");
myVars.onLoad = function(bSuccess:Boolean):Void{
if(bSuccess){
splitText();
}else{
trace("error loading text");
}
};
//Define the Array object to store the seperated words
var myArray:Array = new Array();
//Define the _x and _y position variables of the text fields
var textX:Number = 40;
var textY:Number = 10;
var rightX:Number = Stage.width-100;
function splitText():Void{
//Assign the text to a String object
var myString:String = new String(myVars.text);
//Split the string Object at the spaces
myArray = myString.split(" ");
//Assign the split words to text fields
for(var i:Number = 0; i<myArray.length; i++){
var myText:TextField = this.createTextField("myText"+i,i,textX,textY,0,0);
var myInputDepth:Number = myArray.length+i;
var myInput:TextField = this.createTextField("myInput"+i,myInputDepth,textX,textY,0,0);
//trace(myText+" : "+myInput);
//Define TextFormat object
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Verdana";
myFormat.size = 16;
myFormat.bold = true;
myText.setNewTextFormat(myFormat);
myText.autoSize = "left";
myText.selectable = false;
myText.textColor = 0xCCCCCC;
myText.background = true;
myText.backgroundColor = 0xEEEEEE;
myText.text = myArray[i];
//Apply same textFormat to myInput text and define the text field as input
myInput.setNewTextFormat(myFormat);
myInput.type = "input";
myInput.border = false;
myInput.tabIndex = i;
myInput._height = myText._height;
myInput._width = myText._width+10;
myInput.maxChars = myArray[i].length;
//Space the text fields evenly across the stage
textX += myText._width;
//Wrap the text if it goes beyond rightX
if(textX>rightX){
textX = 40;
textY += myText._height+5;
}
}
Selection.setFocus("myInput0");
};
empty.onEnterFrame = checkText;
var focus:String = new String();
var myTextNumber:String = new String();
var origMyText:String = new String();
var newMyText:String = new String();
function checkText():Void{
//Extract the number from the input text field in focus
focus = Selection.getFocus();
myTextNumber = focus.substr(15);
//Compare the original text with the input text
origMyText = myArray[myTextNumber];
trace(origMyText); // returns the correct string
newMyText = myInput0.text;
trace(newMyText); // returns undefined
if(newMyText == origMyText){
trace(newMyText+" = "+origMyText);
}
}
Accessing Text Field In A Loaded Movie..Issue
Hello,
I have been at it for a whole day and still cannot get this working, I would highly appreciate all the help I can get with this issue. I am loading a movie called "btn.swf" from my _root. Within this movie, I have a dynamic text field called "text_inst". Before I published this movie, I named the instance "myBtn".
I am able to load the movie on _root, but cannot seem to access the textfield "text_inst.text"; I have tried using the debugger and am able to see the "text_inst" but cannot trace it. How can I access text fields in loaded movies?
Please see my code:
Attach Code
//Global gRoot is declared
_global.gRoot = this;
//Global gNext to get Next Highes Depth.
var gNext = getNextHighestDepth();
//EmptyMovieClip NAV is created
gRoot.createEmptyMovieClip("nav", gRoot.getNextHighestDepth());
gRoot["nav"]._x = 200;
gRoot["nav"]._y = 548;
//MovieClipLoader() Object is created
var loader:MovieClipLoader = new MovieClipLoader();
loader.loadClip("movies/btn.swf", nav);
I am able to trace up to _level0.nav
Accessing Atext Field Inside A Movieclip & Simple Question
how do I do this, if I have this..
Code:
for (var i:Number = 0; i<10; i++)
{
var tmp = new TextField(); //how do I name it,tmp wont reference all 10 textfields..
tmp.text = "Hello";
tmp.width = 100;
tmp.height = 30;
obj[i].mc = new MovieClip();
obj[i].mc.addChild(tmp);
}
how do I access the text field inside it?
Accessing Dynamic Text Field In Multiple Instances Of Movie Clip
I have multiple instances of a movie clip (mc1 to mc10, created with DuplicateMovieClip) which contain dynamic text with a variable name "id." I want to access the various id's from my main scene.
for (i=1;i<10;i++) {
"mc"+i.id="foo";
}
DOES NOT WORK.
How would one do it?
Accessing A Dynamic Text Field In A Class Other Than The Primary Class
I have tried to read and understand some of the other threads for this issue but, I think it would be easier to understand if I show my specific issue. I left some code out to make my issue more clear.
Alpha is the primary class with access to the stage. If I write the event listener and function contained in the Bravo function into the Alpha function it works. Although, I want it to be in a different class in the same package (such as the Bravo class).
I have created a instance of a class which is a physical object on the stage (lets say it's a card). The event listener is in the instance so that each instance has a self contained listener.
The bottom line is it works in the primary class but in no others. How can I make it access the text field (so when I click on the "card" the text field shows "something"?
ActionScript Code:
package a {
public class Alpha {
public function Alpha() {
x:Bravo = new Bravo();
}
}
}
package a {
public class Bravo {
public function Bravo() {
this.addEventListener(MouseEvent:CLICK, clickEvt);
function clickEvt(event:MouseEvent) {
<MovieClip>.<MovieClip>.<DynamicTextField>.text = "something";
}
}
}
}
Help Hierarchy
I have a file that has animated buttons.
http://mycustomhometeam.com/partners.swf
I want info to slide on screen when you click one of the topics and stay there till you click again. I want to info to stay there and keep the topics animated. Because of the hierarchy issues, it won't do it.. HELP!
I tried go to flip name but it appears that it only works if it on the same level as as where it is placed.
I need help NOW!!! Thanks so much
ludicrousman@yahoo.com
Hierarchy
I'm having a little trouble sorting out my hierarchy system. Something like this--
main.swf -- blank with empty_mc1.
submain.swf loads into empty_mc1.
Within submain.swf there are two more mc's, empty_mc2 and empty_mc3.
sub1.swf loads into empty_mc2. The code to load it from submain is:
_parent._parent.(the button is within a container)
Now, sub3.swf loads into empty_mc3 from sub2.swf, what would be the code for that?(the button is on the main stage or embedded in another mc--either code would help out)
Hope that makes sense
Any help would be appreicated
Hierarchy
hi. i made a flash form that works great until i load it into another movie. i know i have to change some fo the script but i don't know what i need to change. i am loading the movie into another slot labeled box_signup. here is the set variable frame.
formData = new LoadVars();
formData.name = "";
formData.email = "";
formData.city = "";
formData.comments = "";
formData._vDeckformid = "87";
replyData = new LoadVars();
replyData.onLoad = myOnLoad;
here is the script.
function ckName(){
if (formData.name ==""){
errBox.setMessage("Sorry, there are no annonymous MONEY MONEY fans.");
return false; }
else {
return true};
}
function ckCity(){
if (formData.city ==""){
errBox.setMessage("MONEY MONEY needs to know where you live.");
return false; }
else {
return true};
}
function ckEmail(){
if (formData.email ==""){
errBox.setMessage("How are we supposed to send you updates if you don't give us your email address silly?");
return false; }
else {
if(formData.Email.indexOf(".",0)==-1 || formData.Email.indexOf("@",0)==-1){
errBox.setMessage("That's not a real address now is it?");
return false;}
else {
return true;}
}
}
function clrData(){
this.formData.name = "";
this.nameIN.text = "";
this.formData.email = "";
this.emailIN.text = "";
this.formData.city = "";
this.cityIN.text = "";
this.formData.comments = "";
this.commentsIN.text = "";
}
function myOnLoad(success) {
errBox.setEnabled(true);
if(success){
errBox.setIcon("info");
errBox.setTitle("Thank you");
errBox.setMessage("Thank you for signing up for the MONEY MONEY Newsletter.");
errBox._visible=true;
clrData();
}
else {
errBox.setIcon("Warning");
errBox.setTitle("Error");
errBox.setMessage("There has been a system error submitting your signup form. Please try again.");
errBox._visible=true;
}
}
function goPostal(){
if(!ckName()){errBox._visible=true;return;}
else{
if(!ckCity()){errBox._visible=true;return;}
else{
if(!ckEmail()){errBox._visible=true;return;}
}
}
errBox.setIcon("info");
errBox.setTitle("Sending submission");
errBox.setMessage("Your submission is being sent.");
errBox._visible=true;
errBox.setEnabled(false);
formData.sendAndLoad("http://wearemoneymoney.com/v-cgi/forms.cgi",replyData,"post");
}
thanks to anyone who can tell me what to do.
jeremy b
CollapsingMenu Or Hierarchy
Hi all
I am looking for tutorial on CollapsingMenu or hierarchy menu with main--> sub-->sub-sub category Collapsing...Could someone please recommend me a a link please.
thanks
PilotX
Hierarchy In Flash
hi,
my name's diane.
i am working on a flash site for a friend photographer and i am new.
i have a question about the following :
2 scenes.
1)in the first i got a MC, insite it another MC, and insite a button.
2)his function ? go to the scene number 2.
3)Where do i put the actionscript ? i tried in the button, the effect is working inside the effect, but it has no effect when i play the movie.
i would like to keep my actionscript inside the last MC and not put it in the timeline of the first scene. can i do that ??
I would appreciate any help.
thank you very much.
Hierarchy Is Killing Me
i need help with the path of my grid of boxes.
the problem is i have created a grid of boxes looking something like this
# # # # #
# # # # #
# # # # #
# # # # #
each boxes has a unquie instance name.
Scene 1
posX = 5;
posY = 20;
var myLife = new Array();
for (i=1; i<=300; i++) {
_root.attachMovie("blokk", "blokk"+i, i);
_root["blokk"+i]._x = posX;
_root["blokk"+i]._y = posY;
posX += 12;
live[i] = "alive";
if (i%15 == 0) {
posX = 5;
posY += 12;
}
}
then i want to be able to change the color of each of the boxes and then use a button and antoher for loop to check the color of each box.
Any ideas out there?
thanks
Movie Hierarchy
How would I modify my Actionscript to handle Flash 5 hierarchy?
I have a movie loaded as a symbol and I need it to tell the main scene "root" to action an event.
error output:
Symbol=SlideG3, Layer=Layer 1, Frame=1: Line 2: You must export your movie as Flash 5 to use this action.
_root.gotoAndPlay(11);
Hierarchy Problem?
I'm having trouble working with a coloring book project. The problem in with the tip of the paintbrush. I can't get it to change color when clicking on the swatch. the hierarchy is as such
swatchMC
BrushMC>BrushTipMC
The brushtip movie clip is inside of the brush movie clip which is in the same level as the swatch.
Any Ideas?
_________________________________
Code for the swatch
on(release){
fillColor=0x00FF00;
}
__________________________________
Code for the Brush Tip
on(press){
iColor = new Color(this);
iColor.setRGB(_root.fillColor);
delete iColor;
}
Hierarchy Of Movies
Here's the situation, I'll keep the wording simple:
I have one main movie (called "Index") with a navigation bar.
This movie has an empty area containing a movie clip called "Zone."
When you click a button on the navigation bar, a new SWF movie is loaded into "Zone."
Within one of these movies (entitled "Comic") there is a button called "Archive."
When I click "Archive" I want it to load a new movie in place of "Comic."
The problem is this:
When I use the unloadMovie function for "Archive" it unloads the ENTIRE flash website. "Index" and everything, so I'm left with a blank screen.
I just want it to unload "Comic" and nothing else. I've tried using the 'level' parameter, but because "Comic" is a separate movie, it does not recognize any levels of "Index."
I've also tried using "target" but it does not know that "Zone" exists, because it is a separate movie.
Sorry if this is hard to understand.
I just want a movie within a movie to unload itself, and not the whole thing.
Hierarchy Of Movies
Here's the situation, I'll keep the wording simple:
I have one main movie (called "Index") with a navigation bar.
This movie has an empty area containing a movie clip called "Zone."
When you click a button on the navigation bar, a new SWF movie is loaded into "Zone."
Within one of these movies (entitled "Comic") there is a button called "Archive."
When I click "Archive" I want it to load a new movie in place of "Comic."
The problem is this:
When I use the unloadMovie function for "Archive" it unloads the ENTIRE flash website. "Index" and everything, so I'm left with a blank screen.
I just want it to unload "Comic" and nothing else. I've tried using the 'level' parameter, but because "Comic" is a separate movie, it does not recognize any levels of "Index."
I've also tried using "target" but it does not know that "Zone" exists, because it is a separate movie.
Sorry if this is hard to understand.
I just want a movie within a movie to unload itself, and not the whole thing.
Hierarchy Problem
ok. so i'm using some code to scroll a movie clip when the mouse rolls over it. this works fine when the clip is on level0 but when i use it inside another movie clip it doesn't seem to work.
i've tried replacing '_root' with the name of the clip and with '_parent' but to no avail.
here's the code:
Code:
_root.scrollerName = _root.scrollerClip;
_root.left = 80;
_root.innerLeft = 120;
_root.right = 490.9;
_root.innerRight = 450.9;
_root.top = 84;
_root.bottom = 167;
_root.minXposition = -17;
_root.maxXposition = 83;
_root.idleScrollSpeed = 1;
_root.overScrollSpeed = 10;
if (_root.scrollerName._x <_root.minXposition) {
_root.scrollerDirection = "right";
} else if (_root.scrollerName._x> _root.maxXposition) {
_root.scrollerDirection = "left";
}
if (_root._ymouse <_root.bottom && _root._ymouse> _root.top) {
if (_root._xmouse> _root.left && _root._xmouse <_root.innerLeft) {
if (_root.scrollerName._x> _root.maxXposition) {
break;
} else {
_root.scrollerName._x = _root.scrollerName._x + _root.overScrollSpeed;
}
} else if (_root._xmouse> _root.innerRight && _root._xmouse <_root.right) {
if (_root.scrollerName._x <_root.minXposition) {
break;
} else {
_root.scrollerName._x = _root.scrollerName._x - _root.overScrollSpeed;
}
} else if (_root._xmouse <_root.left or _root._xmouse> _root.right) {
if (_root.scrollerDirection == "right") {
_root.scrollerName._x = _root.scrollerName._x + _root.idleScrollSpeed;
} else if (_root.scrollerDirection == "left") {
_root.scrollerName._x = _root.scrollerName._x - _root.idleScrollSpeed;
}
}
} else if (_root.scrollerDirection == "right") {
_root.scrollerName._x = _root.scrollerName._x + _root.idleScrollSpeed;
} else if (_root.scrollerDirection == "left") {
_root.scrollerName._x = _root.scrollerName._x - _root.idleScrollSpeed;
}
any ideas?
Instance Name Hierarchy?
Hi all.
Is it possible to display an instance name hierarchy in Flash 8?
This would help with referencing mc's within AS.
regards,
Jase
Screens Hierarchy
Im using screens,
What do I adjust to make it so that the main 'presentation' screen is on the top layer compared to the children screens?
I have a navigation on the main presentation screen, and when it loads up the child screen, the child screen is on the top, covering the main screen.
How do I keep the main screen on the top?
[F8] Flash Hierarchy
Firstly I would like to thank you for reading my post.
I have two movie clips:
button that contains a button
bg that contains the background (two frames)
How do I get it so when I click the button, it goes out of the movie clip "button", and into the bg movie clip and switches the bg movie clip to frame 2?
Thanks.
Sorry everything is so messy.
Deleting Hierarchy
Heres one for the smart folks...
If I have a movie clip and I put any number of instances inside of it, when I delete that movie clip, do those instances go with it? Or do they still exist somehow?
I'm using a "contentBox" movieclip to as a box to add things to the stage and move them as a unit, which works great. When I delete it, they go too, but I want to be sure that theyre REALLY gone. Is that so?
e.g.:
(and this is made up, it's not my actual code):
Code:
var contentBox:MovieClip = new MovieClip();
addChild (contentBox);
contentBox.addChild(object1);
contentBox.addCHild(object 2);
//etc etc etc
//and then:
removeChild(contentBox);
Is that gonna kill object1 and object 2?
God I hope so...
Hierarchy Question
I have a movieClip in the library called mc_preloader with the linkage of "preloader". Within this movieclip is a graphic and a textfield called txt_preload (neither are generated dynamically)
In AS2 I could attach this to the stage and then with:
ActionScript Code:
mc_preloader.txt_preload.text = "loading";
could get text displayed within the textbox...
Now using AS3:
I have tried creating an instance using:
ActionScript Code:
var mc_preloader:MovieClip = new preloader();
and attaching to the stage:
ActionScript Code:
addChild(mc_preloader);
and then accessing the textfield using the same method as above, the movieclip appears however I have had no luck with getting text to display
I have embeded text within the field and it still doesnt work
Any help, pointers, FLAs or links to tutorials that explain this for me would be greatly appreciated
ty
Flash Hierarchy
I have three dynamics text :txt0,txt1,txt2 (main.fla)
I also have a class
Interfaz.as:
ActionScript Code:
public class interfaz
{
public var entidad:XML;
public function llenarMuestra()
{
for(var j=0;j<3;j++)
{ this["txt" + j].htmlText = value; }
}
}
Main.fla
miInterfaz.llenarMuestra();
ERROR: there is no txt0 property in interfaz
How can I acces txt0,txt1,txt2 from interfaz ?
thanks
Hierarchy Of Layers?
Hi--
code:
layer 1 -- empty_mc01
layer 2 -- empty_mc02
//empty_mc02's code--
on(press){
_root.empty_mc01.loadMovie("movie.swf");
}
Question:
Is that possible? If the mc's are in the same x0 y0 position? For some reason it is not working when I publish.
Any help would be appreciated.
Thanks
Scene Hierarchy
Is it possible for a flash file to automatically open in scene other than the 1st scene?? I need to set up scene 3 as the default scene when the viewers access the website.
Copy MC Hierarchy
when i copy the parent mc that has a bunch of mc's and those in turn have another within em, i only get a new instance of the parent mc and not the children/movie clips inside it. The ones inside it seem to be the same instance as the original ..how can i perform the copy operation to get new instances throughout the mc hierarchy?
thanks
Object Hierarchy
As a new user of this forum and finding the help invaluable. I thought I would post this object hierarchy. I looked everywhere for one and could not find, so compiled my own.
Attach Code
Object (core)
AbstractPlayer
FLVPlayer
MP3Player
RTMPPlayer
Accessibility
AccImpl
ComboBaseAccImpl
ComboBoxAccImpl
DataGridAccImpl
LabelAccImpl
ScrollSelectListAccImpl
ListAccImpl
SimpleButtonAccImpl
ButtonAccImpl
CheckBoxAccImpl
RadioButtonAccImpl
WindowAccImpl
AlertAccImpl
arguments (core)
Array (core)
FunctionArguments
AsBroadcaster
Back
BitmapData
BitmapFilter
BevelFilter
BlurFilter
ColorMatrixFilter
ConvolutionFilter
DisplacementMapFilter
DropShadowFilter
GlowFilter
GradientBevelFilter
GradientGlowFilter
Boolean (core)
Bounce
BroadcasterMX
Camera
capabilities
Color
ColoredSkinElement
ColorTransform
ContextMenu
ContextMenuItem
CSSSetStyle
CSSStyleDeclaration
DataGridColumn
CSSTextStyles
CuePoint
CuePointEditor
CuePointList
CustomActions
DataAccessor
Bool
ComposeString
Custom
Data
AutoTrigger
Calculated
DatasetDeltaToXUpdateDelta
DateToNumber
Num
RearrangeFields
DataProvider
DataSelector
DataType
Bool
Custom
DataProvider
Dte
Num
Int
Obj
PhoneNumber
SocialSecurity
Str
Xm
ZipCode
Date (core)
DateBase
Dte
Defaults (halo)
Delegate
DepthConrol
DepthManager
DisplayControls
Elastic
Error (core)
EventDispatcher
UIEventDispatcher
ExternalContent
ExternalInterface
FileReference
FileReferenceList
Formatter
NumberFormatter
Function (core)
IME
Iterator
ValueListIterator
Key
LoadVars
LocalConnection
Locale
LowLevelEvents
Math (core)
Matrix
MediaConfig
MenuDataProvider
Microphone
Mouse
MovieClip
Chrome
CuePoint
CuePointEditor
CuePointList
FrameVideoTime
FullScreenToggle
FullScreenToggleControl
HMiniPlayBarTray
HPlayBarTray
LoadBar
LoudButton
MiniPlayBar
MsVideoTime
MuteButton
PauseButton
PlayBar
PlayBarThumb
PlayButton
PlayPauseButton
SkinElement
FocusRect (halo)
ToEndButton
ToStartButton
UIObject
Border
CustomBorder
ScrollThumb
RectBorder
AccordionHeaderSkin (halo)
ActivatorSkin (halo)
ButtonSkin (halo)
RectBorder (halo)
Label
ProgressBar
UIComponent
AlertForm
CalendarLayout
CheckCellRenderer
ComboBase
ComboBox
DateField
DateChooser
FocusManager
MediaController
MediaDisplay
MediaPlayback
MenuBar
View
Accordion
Loader
Screen
Form
Slide
ScrollView
ScrollPane
ScrollSelectList
List
DataGrid
Tree
Menu
TextArea
Window
Alert
MenuBarItem
NumericStepper
ScrollBar
HScrollBar
UIScrollBar
VScrollBar
SelectableRow
DataGridRow
MenuRow
TreeRow
SimpleButton
Button
AccordionHeader
Checkbox
CustomButton
RadioButton
TextInput
VideoTime
VMiniPlayBarTray
VolumeControl
VolumeControlHandle
VPlayBarTray
MovieClipLoader
NamedFrameCuePointListener
NetConnection
RTMPConnection
NetStream
PlayNetStream
None
Number (core)
ObjectCuePointListener
OnEnterFrameBeacon
OverlappedWindows
PlayerControls
Point
PopUpManager
PrintJob
RadioButtonGroup
Rectangle
Regular
ScreenAccommodator
security
Selection
SharedObject
SlideCuePointListener
Sound
Stage
StreamingMediaConstants
String (core)
Enumeration
File
FontName
ObjectID
URI
Strong
StyleManager
StyleSheet
System (core)
SystemManager
TextField
TextFormat
TextRenderer
TextSnapshot
Tracer
Transform
Transition
Blinds
Fade
Fly
Iris
Photo
PixelDissolve
Rotate
Squeeze
Wipe
Zoom
TransitionManager
TreeDataProvider
Tween
UIComponentExtensions
UIObjectExtensions
Video
XMLNode
XML
XMLSocket
XMLUI
Edited: 02/08/2007 at 05:51:09 AM by Graham Butcher
[F8] Flash Hierarchy
Firstly I would like to thank you for reading my post.
I have two movie clips:
button that contains a button
bg that contains the background (two frames)
How do I get it so when I click the button, it goes out of the movie clip "button", and into the bg movie clip and switches the bg movie clip to frame 2?
Thanks.
Sorry everything is so messy.
Here's a picture of my actionscript window:
http://img440.imageshack.us/img440/2042/picture3lz5.png
So I have:
ROOT >> Button Movie Clip >> Button
ROOT >> Background Movie Clip >> 2 Frames
Hierarchy Methods
I've been trying to develop GOOD flash habits and am not quite sure how to nest buttons/movies/etc to work towards a 'pro' look, such as teh uber-brill group94.
Does anyone have any good references (tutorials, articles, books) that you could refer me to? Any good advice?
Hierarchy Of Targeting..?
I have my main swf file which is the layout of the site in which I have loaded into a container an external swf which is my contact.swf. The problem is that when this file is loaded you cannot see any of the input boxes etc and the php file is not processed I've tried various targetting etc but still no result.
AS on the first frame
true_btn.onRelease = function(){
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
form.loadVariables("email.php", "POST");
}
stop();
AS on the second frame
back.onRelease = function(){
prevFrame();
}
And the AS on the form movieclip
onClipEvent(data){
// show welcome screen
_parent.nextFrame();
}
Thank you for everyone's time.
Hierarchy In ActionScript ?
Sup All
Alrighty, still fairly new to the flash scene, but slowly I'm figuring things out.
Okay my navigation menu is made up of a few movie clips that open up to dropdown menu buttons. Anyway I can't figure out where to place the coding, or if there is a hierarchy in the script.
For example the first item in the menu :: you rollOver onto it and it displays the rest of the hidden menu ::
attached to the button in actionscript is ::
on (rollOver)
{
gotoAndStop("open");
}
But I also want to add
on (release)
{
_root.contents.loadMovie("student.swf");
}
Can I have both of these actions attached to the same button? Or am I totally lost and I should put the loadMovie action some place else. Attached is the .fla file :: If you have time to gander at it that would be great, or if you can solve my problem w/o it Thank you so much
Thank you in advance
-michael
FLA FILE
Hierarchy Of Actionscript?
What gives? I'm using MovieClip.prototype code in my movie. I put it in the first frame of the main timeline with a stop();. The code affects the MCs like it should. When the timeline plays to the next keyframe with a stop(); in it the MovieClip.prototype code doesn't affect the MCs at all.
Why does a simple stop(); kill the MovieClip.prototype code?
Listbox Hierarchy
Hey all,
Is there a way to organize data into a hierarchy within a listbox? I would like to have a parent-child list with the parent always being bold.
I'm not asking someone to do it for me, I would just like to know if it can be done and maybe some direction.
Thanks in advance.
Class Hierarchy
I'm having problems planing how to go about extending certain classes in my project.
Part of the problem is that some may need to be extended dynamically.
What I need: (this is for a fighting game)
General Actions (movement and such)
Character class (stats and specials)
Player control (human input)
AI
I need stage elements too, but I got that planned already
SO, with those classes I need a general blueprint for all characters, a class for the characters stats and specials wrapping up with the controls which is either player(with variables inside for player 1,2,etc) or an AI class.
Hierarchy Methods
I've been trying to develop GOOD flash habits and am not quite sure how to nest buttons/movies/etc to work towards a 'pro' look, such as teh uber-brill group94.
Does anyone have any good references (tutorials, articles, books) that you could refer me to? Any good advice?
Hierarchy Of Targeting..?
I have my main swf file which is the layout of the site in which I have loaded into a container an external swf which is my contact.swf. The problem is that when this file is loaded you cannot see any of the input boxes etc and the php file is not processed I've tried various targetting etc but still no result.
AS on the first frame
true_btn.onRelease = function(){
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
form.loadVariables("email.php", "POST");
}
stop();
AS on the second frame
back.onRelease = function(){
prevFrame();
}
And the AS on the form movieclip
onClipEvent(data){
// show welcome screen
_parent.nextFrame();
}
Thank you for everyone's time.
Hierarchy In ActionScript ?
Sup All
Alrighty, still fairly new to the flash scene, but slowly I'm figuring things out.
Okay my navigation menu is made up of a few movie clips that open up to dropdown menu buttons. Anyway I can't figure out where to place the coding, or if there is a hierarchy in the script.
For example the first item in the menu :: you rollOver onto it and it displays the rest of the hidden menu ::
attached to the button in actionscript is ::
on (rollOver)
{
gotoAndStop("open");
}
But I also want to add
on (release)
{
_root.contents.loadMovie("student.swf");
}
Can I have both of these actions attached to the same button? Or am I totally lost and I should put the loadMovie action some place else. Attached is the .fla file :: If you have time to gander at it that would be great, or if you can solve my problem w/o it Thank you so much
Thank you in advance
-michael
FLA FILE
Establishing A Hierarchy
I have a quick question-- I have a script where I have created a managing object, which handles and manages data from multiple subobjects.
The subobjects handle user input events, and after altering the data, they pass it back to the manager, invoking one or more of its methods.
I've tried to set it up so that the manager is the parent of all of these, and I've hit a grey area where I'm unsure of how this is treated in actionscript.
So let's say I have:
myManagingObject = new ManagingObject();
and I have code set up for UserInputObjects-- so I say:
myManagingObject.myUserInputObject1 = new UserInputObject();
myManagingObject.myUserInputObject2 = new UserInputObject();
The relationship isn't explicit; if I trace UserInputObject1._parent it's undefined. Since I need the UserInputObject to invoke methods on its parents, I need it to know where to go.
I tried setting it explicitly in the constructor-- so I could pass it a parent and just link them directly.
myManagingObject.myUserInputObject1 = new UserInputObject(myManagingObject);
and then:
function UserInputObject(parent) {
this._parent = parent;
}
Which worked, but then when I went to debug it, it looked like it wasn't storing a reference to myManagingObject but a copy, so it seemed to create a nasty, infinite loop, since the copy of myManagingObject had its own UserInputObject, which had a copy of its myManagingObject, which had its own UserInputObject, ad infinidum.
So I'm assuming I'm just horribly ignorant about something simple here, and I'd appreciate any info that could shed some light on this. Is there a best practice way to explicitly identify a generated object's parent here?
Thanks!
[as2 Help] Scope & Hierarchy
Hello all,
While working on some code on the "IF Statements" thread on this same forum, I stumbled on two situations and I would like to know if anyone has an answer:
Case 1 (passing variables into event functions):
Is there any way I could have passed the 'i' variable into the onRelease event function instead of having to resort to the 'item' variable workaround?
ActionScript Code:
for (i=1; i<61; i++) {
this["b" + i].onRelease = function() {
item = new String(this._name);
item = item.slice(1);
roll = "r" + item;
};
}
Case 2 (object hierarchy):
The objects referenced on the code above all sit on the same timeline. On this case, the main timeline.
Why is that then "_root["b" + z].gotoAndPlay(11);" works, but "_parent["b" + z].gotoAndPlay(11);" doesn't?
ActionScript Code:
for (i=1; i<61; i++) {
this["b" + i].onRelease = function() {
for (z=1; z<61; z++) {
if (roll == "r" + z) {
_root["b" + z].gotoAndPlay(11);
}
}
};
}
Stupid Hierarchy - How To Address MCs
Hi! - I am officially going nuts. Now, can anyone help me. I have a projector file or it could be an swf that loads external MCs into a MC on its main timeline called "mc_loader". So I say okay, on click of this here button load an external swf into "mc_loader". Cool, no problem. The issue comes when I want to affect a MC within the externally loaded swf from inside the externally loaded swf.
I thought I'd say:
_root.mc_loader.someMCinExternalSWF._visible = 0;
and thus be able to control the MC - thought you have to start way at the _root (the movie that loads the external swfs). But sometimes I am right sometimes wrong - things in the external swfs work great UNTIL i load them into the mc_loader in the main movie. Any ideas? Help!
Hierarchy Of Movies & Variables...
hey guys I got stopped & can do nothing with it. Has anyone
some ideas...
the problem is:
I have a main Movie1, and I load another Movie2 into it . OK thats fine. the Movie2 has text variables loaded into it. But however text variable is loaded not to _level0
but directly to movie clip ( _level0.MovieClip) & here where the problem starts... When I publish Movie2 independently of Movie1 it works, but when I publish Movie1
(with Movie2 loaded into it) the text isn't displayed.
where do you think problem comes from?
I appreciate your help...
|