Referencing Nested Movie Clips From A Class File
Hey guys, its me again. With yet another question.
I am writing a class that extends the movie clip class and am having trouble with a certain part.
I have a Movieclip, and nested inside this movie clip are several other movie clips. The "Main" Movieclip has the linkage set to my class file. I have tried to link all the clips inside it to my class file but that didn't seem to work. When i go to change the image/Movie in say the 3rd nested clip it seems to change the image/movie of the "Hosting" movieclip. Is there any way to reference the nested clips from inside my class file?
As always thank you for any help that you may be able to give.
Lazerath
General Flash
Posted on: Tue May 02, 2006 10:12 pm
View Complete Forum Thread with Replies
Sponsored Links:
Help Calling Nested Movie Clips From An AS3 Class File
Here's what I did:
1) I created a movieclip (book_mc) on the stage. Inside the book is another movieclip (bookPages_mc). Inside of bookPages_mc is a third movieclip (subNav_mc).
2) On the root layer I created another movieclip (button).
3) On "button" I went to Linkage and gave it a base class of my own creation, "MainNav".
Now in the MainNav class I want to tell the subnavigation movieclip to animate.
The problem is - I can't figure out how to reference nested movie clips from an external class.
(For the record - everything has an instance name and has been double checked. The code works from within the FLA but not from an external class.)
Here is my class code (everything works except for the reference to the nested movieclip):
Code:
package {
//imports
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
import flash.display.SimpleButton;
import gs.TweenLite;//Importing TweenLite (make sure "gs" folder is in same folder as this file
import fl.motion.easing.*;
//declare class
public class MainNav extends MovieClip {
public function MainNav() {
trace("activate Main Navigation button");
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, handleClick);
}//end constructor function
function handleClick(event:MouseEvent):void {
//trace("handleClick");
book_mc.bookPages_mc.subNav_mc.gotoAndPlay("slide");
}//end handleClick method
}//end class
//end package
}
Please help! And please consider, when replying, that I pretty much only learned how to use classes YESTERDAY so I'm still a noob at this. Thanks in advance!
View Replies !
View Related
Dynamically Referencing An External Class (not Embedded Movie Clips)
I've seen several posts for how to dynamically attach movie clips from the library, since they become their own classes. This question is how to dynamically refer to external classes.
The example that showed this was:
function createNewChart(myChart:int){
var classRef:Class=getDefinitionByName("chart"+myChart) as Class;
var newChart:*=new classRef();
}
I want to instantiate an external class versus a movieclip, and using this code outright is not the trick - I get an error (Error #1065: Variable MyClass is not defined.) from the following:
var presentationClass:String = classNameFromXmlFile; // MyClass
var classRef:Class = getDefinitionByName(classFromXMLfile) as Class;
var myClassInstance:* = new classRef();
I know that hard-coding the class here does work, so the class itself is fine, as in the following:
var myClassInstance:MyClass = new MyClass();
What is the proper syntax for dynamically doing this?
View Replies !
View Related
Accessing Nested Movie Clips In Class
I have a nested movie clip linked to a class file. I can trace the children with the for loop but I can't figure out a way to access it's attributes. this.(whatever) works for the parent MovieClip (feedback_mc) but I cannot get to the nested movie clips (icon_mc & text_mc). Any suggestions would be greatly appreciated. Thanks in Advance
Code:
class feedback extends MovieClip
{
private var _sText:String;
private var _nIcon:Number;
function feedback() {
for (var children in this)
{
trace(children); // prints icon_mc & text_mc
}
trace(_parent.content.icon_mc._y); // prints undefined
trace(this._y); // prints the Y of the Parent Movieclass
}
}
View Replies !
View Related
Referencing A Movie Clip From A Class .as File
Okay, so I'm making a game. I've made various class files for various elements on the screen and used linkage to make the movie clips on screen members of my custom classes (by right clicking on the movie clip in the library and selecting linkage, etc). But I'm having an issue...
I can't reference child movie clips. So say I have a movie clip called "sea", and within it I have one called "fish" (instance name, of course). I use linkage to make "sea" a member of my custom "SeaClass" class. However if I try to do something like this.fish.gotoAndStop(5); I get an error saying that there is no property "fish". I understand that it's looking for a "fish" function instead of the "fish" subclip, but is there any way to make it reference the subclip?
This is a big issue because I'm having to use a lot of onClipEvent(enterFrame) variable checks for my subclips and whatnot to make them execute something instead of being able to put the command straight in a function and its really bogging down code.
I hope this makes sense... thanks in advance for the help!
View Replies !
View Related
Referencing A Nested, Nested Movie Clip
Here's the setup.
let's say you have a movie clip called "parent" on the root timeline.
On frame 1 of the parent clip, you have another clip called "childA"
On frame 2 of the parent clip, you have a clip called "childB"
so, only childA is on frame 1, and only childB is on frame 2
also, let's say that both childA and childB each have a local function named "Add"
using dot syntax, you can call those functions from the root timeline:
_root.parent.childA.add(); or _root.parent.childB.add();
however, Flash only seems to be aware of those children that exist on the currently selected frame of the parent. In other words, if the current frame in the parent mc is 1, you can use parent.childA.add(); but not parent.childB.add();
Is there any way to be able to reference a child movie clip in a parent movie clip when the child is not on the currently selected timeline?
I can't put all the child clips on every frame, because I need to be able to print the entire parent movie clip (multiple frames, so each child can only exist in their own frames).
Thanks in advance for your help or insight!
Cheers!
View Replies !
View Related
Loading Swf In Main File With Movie Clips Nested In One Another
hi everybody,
Can u please help me solving this problem........
I have main swf file & calling swf in that. But the problem is i have one file which includes 3 movieclips because of the effects. & i have to give link to the button which is placed in main file that go to & play the swf with the 3rd nested movieclip & 10 no frame...............
can u please help me how should i add action script to the button.
I tried doing loadmovienum(){
tellTarget(instance name)
goto&play 10,
can u please help me...............solving this problem........
thanks......
amrapali
View Replies !
View Related
External File Variables In Nested Movie Clips
Please forgive the noob question, but I am just now starting to use external data in my flash movies...so my question is, if I have an external .txt file with a list of variables, and I have mc_A 'nested' within mc_1 which is located in _root, how would I need to link to my .txt file in order for the vars listed there to work in mc_A?
>>or rather, does it matter where I specify the target and can I specify several targets at once?
View Replies !
View Related
Referencing Top Level Movie That Is Nested
Hi,
I have a main movie and then all the other sections loaded into it using loadMovie. One of the sections loaded in has a movie clip inside it that is trying to reference the top level of the movie it is in (not the main movie). I have tried level0 and parent but i think they are referencing the main movie (i.e. the _root movie). Does anyone have any ideas ?
I hope i have made myself clear. Thanks
Grimmus
View Replies !
View Related
[AS2.0] Declare Nested Clips In Class
I'm having a brain fart this week on just about everything as i haven't written much AS2.0 in months. How do you declare nested clips in AS2.0?
I get errors when I do both of the following:
ActionScript Code:
class VideoPlayer extends MovieClip
{
// list class vars
private var Scrubber.Handle_mc:MovieClip
}
// and
class VideoPlayer extends MovieClip
{
// list class vars
private var Scrubber:MovieClip
function VideoPlayer ()
{
Scrubber = Scrubber.Handle_mc;
}
}
Is either correct ? I feel so stupid this week.
View Replies !
View Related
Referencing A Subclip From Within A Class File
Say I have the following movieClip Structure
myMovieClip
myMovieClip.subMovieClip
I want to make a Class file for myMovieClip
I would like this Class to reference and adjust the subMovieClip._y using commands from the class file.
I keep getting errors when trying to do this. Is this a matter of syntax or is there no way to reference another movieClip from a class file?
Thanks
View Replies !
View Related
Maintaining Event Behavior For Movie Clips Nested In Movie Clips
Is there any way to maintain a clip's event callbacks when said clip is nested in a parent clip that has its own definitions for those callbacks?
In other words, if clip B has a definition for .onPress and clip A has a definition for .onPress, is there anyway to maintain clip B's definition if it is nested in clip A?
I have tried doing it by making clips into movie clip subclasses but it doesn't work... but how do components work then?
View Replies !
View Related
Help Referencing Movie Clips
Hello everybody
I have a big problem here:
I have a movie clip on the stage containing some movie clips inside but can´t reference them successfully from the self contained movie clips:
should I state in the container movie clip?:
Code:
this._parent.movieclip1
how can I reference the parent movie clip from the child movie clip?
Thanks in advance
View Replies !
View Related
Referencing Movie Clips
Help me, I'm completely stuck.
All I want to do is make a button when pressed, change the frame of another movie clip at the same hierarchy as it (the button and clip have the same parent clip).
I've tried this and it doesn't work:
_parent.pdf2.gotoAndPlay(2);
pdf2 is the name of the clip I want to change.
Any help is apprecieated.
View Replies !
View Related
Referencing Movie Clips
Hi,
I'm doing a simple duplicate movie like this:
duplicateMovieClip(_root.snake, "_root.snakecopy"+i,i);(i does increment)
and trying to reference the <i>_x</i> value of each new movieClip made like this:
snakeCopy = "_root.snakecopy"+i;
trace(snakeCopy._x);
But as I am finding, I can't reference the new movieClips like that. So, my question is:
<b>How can I reference a movieClip in an array</b>
View Replies !
View Related
Referencing Movie Clips
Hey all,
I have a function in a MC (let's call it MC2), which works fine when called. However, If you load MC2 inside another MC (let's call it MC1 - the main part of the site) it wont work.
The function simply changes the frame of an MC (MC3) inside MC2.
Even if I call the function from inside MC2 (using buttons on the MC2 timeline) when it's inside MC1 it seems to do nothing. I can make it tell me the framenumber of MC3, however it won't go to and play.
This all seems confusing, so I will draw a diagram.
MC1 (main site)
- MC2 (content area)
- MC3 (content I want to change frame of)
I assume this is due to a referencing problem. Like, I might need to go _root.MC2.MC3.gotoAndPlay(); however this doesn't work either. Nor do any other combinations of trying to work out the reference.
The content inside MC3 is loaded from another SWF.
Any one have any idea? Sorry if this is real confusing.
Cheers,
Dreeft.
View Replies !
View Related
Referencing Movie Clips
Hey all,
I have a function in a MC (let's call it MC2), which works fine when called. However, If you load MC2 inside another MC (let's call it MC1 - the main part of the site) it wont work.
The function simply changes the frame of an MC (MC3) inside MC2.
Even if I call the function from inside MC2 (using buttons on the MC2 timeline) when it's inside MC1 it seems to do nothing. I can make it tell me the framenumber of MC3, however it won't go to and play.
This all seems confusing, so I will draw a diagram.
MC1 (main site)
- MC2 (content area)
- MC3 (content I want to change frame of)
I assume this is due to a referencing problem. Like, I might need to go _root.MC2.MC3.gotoAndPlay(); however this doesn't work either. Nor do any other combinations of trying to work out the reference.
The content inside MC3 is loaded from another SWF.
Any one have any idea? Sorry if this is real confusing.
Cheers,
Dreeft.
View Replies !
View Related
Referencing Several Movie Clips To One Function...
In the site I'm making, I have a simple rollover effect where the button smoothly shifts to the right when you roll over it and back again when you roll off. Right now I have a seperate function for each clip on the stage but I've come to a part of the site where I'm going to have about 13 buttons doing this function and I would like to save myself the typing. In a test clip I tried putting this code on the root:
spam = function(){
current.dx = (current.targx-current._x)*.2;
current._x += current.dx;
}
this.onEnterFrame = spam;
and this code on my button:
on (rollOver){
_parent.current = this._name;
targx = 150;
}
when I test the clip nothing works. I get a hand cursor when I rollover the button but no movement. The original x position of the button is 100. I've tried switching around "_parent" , "_root", and "_this" tags and all that and I've also tried swapping out "_parent.current = this._name" with "_parent.current = targetPath(this)". Does anyone know what I'm doing wrong? Any help is greatly appreciated....
//Chris
ascendvisual@hotmail.com
View Replies !
View Related
Referencing Movie Clips In For Loop
Probably a very simple question: How can i reference movie clips in a for loop?
Lets say i have 10 MCs named movClip0,...,movClip9. How do i call them?
First i tried something like this:
Code:
var i:Number;
for(i=0;i<10;i++){
var mc = "this.movClip"+i;
mc.removeMovieClip();
}
But that of course doesnt work. So how do i reference MCs if i know their base name and their increment?
View Replies !
View Related
Please Help Referencing Duplicated Movie Clips
Hi,
I've been trying everything I can think of to get this fairly basic flash movie working but to no avail!
I've created a tsunami menu made up of duplicated menu items. Each menu item should have a rollover and selected state of 240% which works fine. When a menu item has been selected it jumps to another frame but until the user interacts with it it should loop through the different categories.
My problem is that I can't get the menu items to scale big while it is looping through the different categories on the matching category frames.
I'm thinking I could reference the duplicated menu items by their level or soemthing but I really dont have a clue. Any help would be very much appreciated!
I've attached my source file which would help to clarify.
Thanks
Joanna
View Replies !
View Related
Text Field Referencing Movie Clips...
Alrighty, suppose I have a Dynamic text field with a corresponding variable textMan. And, I've got 3 clips on the root level (clip1, clip2, clip3). At some point, I'd like to read the variable (textMan) from the text box and change the opacity of the corresponding movie clip...
If I type in "clip1" for instance, I want to change its opacity to 50...
Can I use textMan directly, or do I have to somehow parse it in-between?
(i.e. textMan._alpha=50 ??)
Thanx in advance,
BakaMattSu.
View Replies !
View Related
Problems Referencing Functions In Movie Clips.
Hi
I’m having real trouble referencing functions in movie clips. At the moment I have two movie clip sin the root: readyMix and LoginCode . Ready mix has a function in it called getContent.
In ready mix _root.readyMix.getContent(); works
In the root or LoginCode this code does not work. Why not?
It is really annoying me.
View Replies !
View Related
GoTo Command Referencing Movie Clips
Hi
In my fla file, i have a movie clip on the main timeline titled "introflyin" Within this movie clip, i have another movie clip entitled "scroller" that contains several buttons with actions on them. When I click on a button in "scroller" i want a goto action that will advance to another keyframe within the movie clip "introflyin" So here was the code i was attempting to use below, that doesn't work. If you could help me out, I'd appreciate it.
Thanks
on (release) {
_root.introflyin.gotoAndPlay(5);
}
cjohnson@gish.com
View Replies !
View Related
STUPID Question About Referencing Movie Clips
I have been on this so much time now that i must be brain dead or something... cause i don't remember how to reference a movie clip anymore!!!eek: eek: eek:
thumb_count=0;
while (thumb_count<counter) {
loadMovie("./thumb/t"+thumb_count+".jpg", "thumb"+thumb_count);
thumb[thumb_count].onData = function () {
trace ("on data works???");
thumb_count++;
};
// basically what this is supposed to do is to load a bunch of jpgs into a bunch of movies
it does it ok
but since they are so many pics i want the script to show a pic... then the other... then the other and so on...
so i figured i could use an ondata thing to make the trick
but the movie just freezes
thumb[thumb_count].onData /// is this the correct way of referencing a movie clip? (remember my movie clips are called thumb1, thumb2, and so on.
THANKS IN ADVANCE
View Replies !
View Related
Referencing Duplicated Movie Clips Problem
Hello everyone, I'm having a little problem with a menu I'm trying to customize here. As you'll see in the attached .fla I have duplicate movie clips making several buttons of a pretty cool menu. What I need to do is to attach a different icon for each of these items (but only the main ones, not the subs). I figured I could do it by using loadmovies and referencing these loadmovies to each duplicated movie clip (they are given a name like "oggetto0 , 1 , 2 and so forth".
Is it possible to use an action and apply it to this duplicated movie clip? I'd love to get some help on that!
Thanks!
Rodrigo
View Replies !
View Related
Referencing Movie Clips With String Variable
This may be such a simple question that it should be on the Newbies Forum.
I've got a picture of a human skeleton and each bone (not every single one!) is in its own movie clip. I've got the names of the bones in other movie clips. When I roll over the bone mcs I want the name mcs to play - roll out then fade out etc.
I can do this using AS, but don't want to have to repeat the same lines of code for each movie clip!
I thought of creating a string variable 'bone' and using it to refer to the movie clip which has the string as part of its name. For example if the bone variable was 'femur' I would want to refer to the movie clip 'femur_mc' and refer the text movie clip ' femurtext_mc'
How do I do that?
Here's what I've t
thighline_mc._alpha = 0;
eyeline_mc._alpha = 0;
ribline_mc._alpha = 0;
//-----functions------\
var bone:String
var lineName:String = "bone"+"line_mc";
var mcName:String = "bone"+"_mc";
var textboxName:String = "bone"+"text_mc";
function appear (bone) {
this[textboxName].gotoAndPlay (2);
this[lineName]._alpha = 100;
this[mcName].gotoAndPlay(2);
}
// ------------thigh ---------\
this.thightext_mc.onRollOver = function() {
appear;
bone = "thigh";
// this is what I had here originally but don't want to have to do for every single main bone in the body!!
//gotoAndPlay(2);
//thighline_mc._alpha = 100;
//thigh_mc.gotoAndPlay(2);
};
this.thightext_mc.onRollOut = function() {
play();
thighline_mc._alpha = 0;
thigh_mc.play();
play();
};
this.thigh_mc.onRollOver = function() {
gotoAndPlay(2);
thighline_mc._alpha = 100;
thightext_mc.gotoAndPlay(2);
};
this.thigh_mc.onRollOut = function() {
thigh_mc.play();
thighline_mc._alpha = 0;
thightext_mc.play();ried:
View Replies !
View Related
XML - Referencing A Text Box Inside Two Movie Clips
I currently have a text box ('text_txt') inside two movie clips ('Section3_mc' and 'Part1_mc').
I am using an XML file to populate this text box.
I am currently using the following code to do this:
Code:
_root.Section3_mc.Part1_mc.text_txt.htmlText=myXML.firstChild.childNodes[0].childNodes[4].childNodes[0].childNodes[1].childNodes[36].firstChild.nodeValue
The reason it is HTML text is that I'm using CDATA tags within the XML.
Why doesn't it work, though?
I'm assuming I have to place the above code outside all the movie clips and in a frame in the root of the Flash file? Would I be wrong in thinking this? Does it actually need to be in the topmost movie clip ('Part1_mc')?
Or is there something else wrong here?
Can I even reference a text box in this way?
All help is greatly appreciated.
View Replies !
View Related
Referencing Clips On Main Timeline From My Main Document Class
Hi All,
I'm trying to reference clips on the main timeline either in or via my main Document class, but if I declare any clips as public in the class body as I would have done is AS when linking an external class, I get:
Code:
1151: A conflict exists with definition tfLength in namespace internal.
If I don't declare the clip, then I can reference it from within the same class with this.tfLength, but other classes complain it the Document classes tfLength variable doesn't exist!
So how do I reference a clip on the timeline in my class?
Thanks,
Dave
View Replies !
View Related
AS2 Symbol - Nested Symbols Invisible Outside Class File Constructor
Hi there.
I never got round to classes in AS2 so I'm having a go now.
I have a symbol, let's call it outer_mc. This clip has a class file associated with it, which works fine - the constructor is called when I attach it to the stage. All hunky dory.
Inside the outer_mc symbol is a symbol called inner_mc. If I trace(inner_mc) from the class file constructor I get "_level0.inner_mc" or whatever. If I trace(inner_mc) from anywhere else I get undefined!
To summarize: Why are nested symbols invisible outside the constructor function of its parent's class file?
Or am I doing something wrong? << more likely
ActionScript Code:
class outer_mc extends MovieClip{
var inner_mc:MovieClip;
function outer_mc(){
trace(inner_mc); // works fine
}
function someOtherFunction(){
trace(inner_mc); // undefined!
}
}
Many, many thanks in advance.
James
View Replies !
View Related
Nested Movie Clips Help
Flashkit member Garbage originally helped me with this menu system. Since then I've added a menu item and now it has developed a funky problem. I've been going over and over this thing for two days and I can't see why this is happening.
http://synap-sys.com/submenu.html
here's the problem: every combination of menu choices works fine until you try to go from an open 'service' menu to an open 'civic' menu. You click on 's' service menu appears, you click on 'c' and the service menu retracts like it should but the 'civic' menu never opens up, and it also disables all the other buttons. The 'civic' menu works fine until you try to choose it after the 'service'
Man, I can't figure it out.
Someone please help!
I've included the .fla if anybody wants to take a look at the Script (originally written by Garbage,thanks)
Thanks
Adam
View Replies !
View Related
Nested Movie Clips
FLASH 5:-
I have an MC nested within another MC.
MC1 is on the stage and MC2 is nested within MC1.
Now I have 2 buttons on stage that on (rollover) display both MC1 and MC2.
However, button 1 on (press) makes MC2 goto nextFrame whereas button 2 makes MC2 goto prevFrame. This works fine until I roll out.
After rolling out and rolling over either button again MC2 has gone back to the 1st frame.
Is there anyway I can make the nested MC not return to the 1st frame ?
MC2 contains 10 frames and each frame has a STOP(); action attached.
Thanks
View Replies !
View Related
Nested Movie Clips?
OK here's the deal I have a movie clip acting as a 3 state button (3 frames: over, off, down) nested on the second frame of a movie clip.
The idea is the outer movie clip shows something, when you rollover it it goes to the second frame that has the 3 state button, which should react to the mouse rollover and click
My code is in the root time line. "mac" is the parent MC on the root time line, "mm4v" is the child movie clip on the second frame.
The first part (green) works, the second par (red) dose not.
any ideas why?
mac.onRollOver = function() {
mac.gotoAndStop("over");
};
mac.mm4v.onRollOver = function() {
trace ("good")
mac.mm4v.gotoAndStop("over");
};
View Replies !
View Related
Nested Movie Clips And As3
hi wondered if someone could help me as this problemo is really slowing me down an dmy head hurts:|
in this instance what i want to do is load in an image into a movieclip that I have already created (by hand if u will ) and place don the stage. The main clip i have placed on the stage is called port and this is the code i am using to load it in.
function showMainImage(event:MouseEvent):void {
var mainLdr:Loader = new Loader();
mainLdr.load(new URLRequest("images/" + event.currentTarget.imagePath));
port.addChild(mainLdr);
port.mainLdr.x = 2
port.mainLdr.y = 2
bitmap.visible = true;
}
the bit that throws up and error seems to be the two lines that try and position the clip. I get the following as an error message:
TypeError: Error #1010: A term is undefined and has no properties.
at AS3_main_fla::MainTimeline/showMainImage()
its really got me stumped this one and in this respec tlife used to be much easier with as2:) but i know the benefits are there so i will stop whining.
can anyone help me please? a crate of belgian beer is in it if u live close by;)
reagards
ade
View Replies !
View Related
Nested Movie Clips
hi,
I recently downloaded a flash template that was built on AS2 and have been trying to figure out how it works for a couple of weeks now (excuse my ignorance when it comes to AS). I have a question about nested Movie Clips. The way the template is constructed invovles a massive amount of nested movie clips and a large number of instances of each movie clip. The way i understand it is that if an instance of a movie clip is put on the stage and given an instance name, any modifications to that movie clip should be unique to that instance. However when i modify the colour of any of the movie clips i select, it changes the colour of all other instances.
Am i missing something obvious here??
Thanks in advance for your help
Kind Regards
Damien
View Replies !
View Related
Nested Movie Clips
If you have a movie clip inside a movie clip, and if you test the scene, and it's fine, but when you test the whole movie, the nested movie clip doesn't animate... what's the problem? Thanks for any help.
Sincerely,
Bry
kiddopail@hotmail.com
View Replies !
View Related
Please Help - Nested Movie Clips
Im working on a uni project and have his a brick wall
The project is a prototype PDA made up of a host movie (host.swf) which loads other swf's in to display on the screen.
My problem is with my menu.swf
For example i include some code
Code:
//clock section starts
createEmptyMovieClip("clock_container",1);
container._x = 225;
container._y = 100;
clock_menu_btn.onPress = function() {
loadMovie("clock.swf", "clock_container");
_root.music_container._visible=false
_root.shopping_container._visible=false
};
//clock section ends
I want the button when clicked to hide any other open movie clips.
It works fine when opened as menu.swf but if its nested in host.swf it doesn't work.
Any ideas?
Thanks
View Replies !
View Related
Nested Movie Clips?
I don't know the correct name for this...but I'm using the 3d tutorial here for a pattern to make a cover flow gallery with dynamic images, the final project will pull the image location from an xml file...I know my navigation is working...
but the images aren't showing up, I hope this quote is enough to get an idea...
Quote:
for (i=0; i<=4; i++){
obj = theScene.createEmptyMovieClip("obj" + i, theScene.depth++);
var box = "obj" + i;
box.loadMovie("poster" + i + ".jpg");
obj.x = i * 225;
obj.z = 0;
obj.target = new Object();
obj.target.z = obj.z;
obj.onPress = selectObject;
obj.display = displayObject;
obj.type = 0;
obj.selNumber = objn++;
objectsInScene.push(obj);
trace(box);
trace("poster" + i + ".jpg");
}
View Replies !
View Related
Nested Movie Clips?
Hi All...
I have been working on an animation and I do not seem to be able to move on.
I am using AS2 and Flash 8.
What I would like to accomplish is have an animation I created of a number of balls vibrating and moving around, to play within a confined area. What I mean is that on my stage I have created a frame which I changed into a movie clip. Now what I would like to do is have my animation of the various balls stay within the frame. I tried to place the animations of the balls into the frame movie clips but no success. Any suggestions on how I could solve this dilemma?
Thanks
Brutium
View Replies !
View Related
Nested Movie Clips
If you have a movie clip inside a movie clip, and if you test the scene, and it's fine, but when you test the whole movie, the nested movie clip doesn't animate... what's the problem? Thanks for any help.
Sincerely,
Bry
kiddopail@hotmail.com
View Replies !
View Related
Buttons Nested In Movie Clips
Hello, I need some help for a friend... We want to make buttons nested in a movieclip go to and play another frame/movieclip in on the main timeline. Do you target the instance on the main timeline? That is what i've been doing, it is not working.
I think the problem may be that she came to me last minute and i had only half hour to find the problem...
Any help would be great!
View Replies !
View Related
Nested Movie Clips/Buttons
This is hard to explain, but here goes...
On the main timeline, I have a movie clip. lets call
it "main". Inside that movie clip is another movie clip
let's call that one "clip2". Inside that movie clip
is a scroller movie clip. There is a button inside the scroller
that when you press it, I want to be able to call "clip 2"
and just have the playhead go to the next frame on "clip2"
I've attached a fla as an example (flash 5). I hope someone understands this and can help me.
View Replies !
View Related
Nested Dynamic Movie Clips
I'm loading movie clips dynamically into a movie.
What I would like to do is load sub-clips into previously loaded movie clips within my movie (ie: attach additional graphics to a graphic I loaded before). The reason I want sub-clips is that I'd like the sub-clips to update automatically as the original movie clip is updated, while maintaining their original offset.
This seems like it would be possible, and in fact, I can get it working with non-dynamic mcs.
Are there restrictions with dynamic clips that I am not aware of or is there another error in my code?
Thanks for your input,
sand858
View Replies !
View Related
Collisions From Nested Movie Clips
Dear all flash lovers,
I am in need of some help if possibel.
I have been playing with flash 8 and in the process of making a simple game.
but I have come across a problem with collisions that no one seems to have answered. well I have been looking all day and found nothing. I need 9 squares that move independently of each other, randomly. because of this |I have had to inbed all the variables into 1 movie clip. so that all i need is to copy that 1 movie clip 9 times without changing any code... so far so good, till I started setting up the collisions with the boundries and the other replicated squares.
Question:
I have a square(MC) that i need to detect when it collides with the boundries which are in the _root. The square is nested (inside a movie clip). and that movie clip is inside another. here is the simple code i am using to do this.
if (_root.b1.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 1;
}
if (_root.b2.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 2;
}
if (_root.b3.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 3;
}
if (_root.b4.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 4;
}
trace(_parent.variables.COL1);
but for some reason it will not play ball.
any help would be great as my mind is fried
kind regards
taz
View Replies !
View Related
Scrollbars Nested In Movie Clips[CS4] And AS3
I have developed a simple website for a college handup.
It has a main window and another window beside it, in which I have created a movie clip.
I want to use this movie clip as a window for a scrollbar.
I have nested my scroll bar within this window and it will not scroll.
I also keep getting this error:
TypeError: Error #1006: init is not a function.
at CiaraMADMT_fla::scrollwindow_6/frame1()
The scroll bar consists of one line of code:
sb.init(txt_mc, "easeOutBack",2,true,2);
I tried having the scrollbar on the main stage and not nested but it kept throwing out my other code completely.
I am starting to think that flash and AS3 secretly HATE me!
If anyone can help I would give them my firstborn
View Replies !
View Related
Duplicating Nested Movie Clips?
Is it possible to dupliacte a nested movie clip
I have a movie clip called myLoc and inside this is another movie clip called myObject and I wish to duplicate this.
I am using
duplicateMovieClip("_root.myLoc.myObject", "newObject", 1);
newObject._x=250;
newObject._y=200;
newObject.gotoAndPlay(2);
but it does not seem to work any ideas
View Replies !
View Related
Problem With Nested Movie Clips
Ok, I'm trying to write a class that draws a window which has multiple parts. I want it to draw a title bar (which it does) and I want to be able to drag then entire window around by pressing and holding on the title bar (which it does not do). Here is the relevant code from the class:
ActionScript Code:
private function DrawTitleBar(){
myTitle.removeTextField();
c = myContainer.getNextHighestDepth();
titleBar = myContainer.createEmptyMovieClip("myTitleBar",c);
titleBar.beginFill(titleBarFill,windowAlpha);
titleBar.lineStyle(borderSize, borderColor, windowAlpha);
titleBar.moveTo(Rect.left,Rect.top);
titleBar.lineTo(Rect.left,Rect.top+titleBarHeight);
titleBar.lineTo(Rect.right,Rect.top+titleBarHeight);
titleBar.lineTo(Rect.right,Rect.top);
titleBar.lineTo(Rect.left,Rect.top);
titleBar.endFill();
//
//Drag on the bar
titleBar.onPress=function(){
myContainer.startDrag();
}
myContainer is an empty movie clip I created from within the class like so:
ActionScript Code:
d = _root.getNextHighestDepth();
myContainer = _root.createEmptyMovieClip(windowTitle, d);
The following code works fine, except that it makes me drag the window no matter where I click on it:
ActionScript Code:
myContainer.onPress = function() {
myContainer.startDrag();
}
I can not get it to drag the entire window by simply clicking on the title bar. Why is that? It doesn't make any sense to me that this should not work. What am I doing wrong?
View Replies !
View Related
Help With Nested Movie Clips And Events
Hello,
I have several movie clips which are dynamically nested inside another movie clip using attachMovie. I am successful at loading these movie clips and I can manipulate them via actionscript with no problems. The problem comes on the events. None of them fire with any mouse activity (onPress, etc). The only event that fires is the onLoad event. Any suggestions as to why this might be happening? They are nested 2 deep... the second container is masked.
Thanks!
View Replies !
View Related
Nested Hit Areas (Movie Clips)
Hello again!
I have a lovely problem that I just can't seem to work out... Would appreciate it if one of you guys could help me out...
*** Scenario ***
I have an image with a hit area which when i hover over it, the mouse cursor changes to a magnifying glass...
On certain parts of the image [top/middle/bottom] I need to display closeups of whichever section the mouse is hovering over.
*** Problem ***
I have managed to create the main hit area which turns the cursor to a magnifying glass... I'm not sure how to add a hit area over the top of the MAIN hit area and still retain the magnifying glass cursor... Whenever you add the actionscript for a rollover on this movieclip it goes back to the hand - is there an easier way of nesting hit areas so to speak?
Cheers,
Luke.
View Replies !
View Related
Targeting Nested Movie Clips
I have a menu that attaches movie clips to an empty holder movie clip on the stage. Using this code:
Code:
this.button1.onRelease = function() {
var swapthedeck:String = "mc1";
_root.attachMovie(swapthedeck, "holder", 20, {_x:1, _Y:1});
enableAll();
this.gotoAndPlay("_clicked");
this.enabled = false;
}
In another area, I'm trying to find that movie clip that was loaded into holder for use in another script. I am currently using this:
Code:
this.control1.onRelease = function() {
control1.gotoAndPlay("_clicked");
var mcInstance:MovieClip = _root.getInstanceAtDepth(20);
trace (mcInstance);
}
However, when I trace the mcInstance, it returns "_level0.holder". This is the right name for the holder, but not the movie clip that was loaded inside of it. Does anybody know how to harvest the name of the movieclip that is present within holder? Any help is greatly appreciated. Thank you.
Rich
View Replies !
View Related
|