Refencing movie clips created dynamically
I am adding a series of clips using attachMovie and adding a
unique numeric identifier to the name of those clips by
incrementing through the number of photos in an xml file using "i"
as the variable and adding it to the name ("ptextHldr" + i + "_mc"
= ptextHldr1_mc, ptextHldr2_mc etc.) each clip has within it a text
box that I want to get to dynamically by incrementing again through
the names using a variable for the unique identifier, but I can't
seem to find the way to reference each clip in this manner.
ptextHldr1_mc.textBox1_tb.text works fine, but how does one
accomplish the same if I am incrementing through all created using
a variable.
Thanks
if they're on the same timeline as the code, then its
this["ptextHldr"+i+"_mc"].textBox1_tb.text
Otherwise replace 'this' above with the path to the timeline
they're on, e.g.
_root.myContent["ptextHldr"+i+"_mc"].textBox1_tb.text
if myContent was the name of the movieclip holding all your
ptextHldrs
Similar Messages
-
My current os x is 10.9.5, using final cut express vers. 4.0.1. I have imported .mov clips created on a older mac os x (lion) and when I wanted to import them into fce, a quicktime conversion window opened up and converted them (I haven't experienced this in the past). I then imported the converted quicktime clips into my fce project. After doing this I took selected clips and put those edited clips on the fce timeline. When playing the video back in the fce timeline,I noticed
1) the video wasn't playing back smoothly like the original content
2) when looking at the timecode reading of the timeline, the timecode was sputtering as well as the video and audio. I exported to quicktime just to see if that was consistent, it was.
When I play the converted quicktime content independently of fce, it plays normally (no sputtering of timecode, video and audio. Need help to resolve the sputtering playback of converted video content in the fce timeline. I've never experienced this before. Any suggestions?When you say you converted the clips before importing them into FCE, did you convert to AIC or DV and do the converted clips match your FCE Sequence settings exactly? If not, go back and convert the original files again, using the intended Sequence settings as a guide.
-DH -
Printing a movie clip with dynamic text boxes
I've got a certificate inside a movie clip, and i want the
dynamic text box to dispay the user name, but for some reason it is
coming up undefined, even though i have the dynamic text box set to
finalname = _root.inputname, but it comes up as undefined on the
screen. :( Can anyone tell me where i am going wrong?
Is there a way to print just a specific movie clip on the
screen? I can only print all the frames in the movie and without
the dynamic text box... any help would be greatly
appreciated.assign the mouseChildren property of your movieclip to false.
-
How do I remove a the contents of a movie clip created using loadClip?
I have a Flash site that loads specific SWFs into a movie
clip called "content_mc" based on a button click. I do this using
the "loadClip" method. I then remove (I thought) the SWF from the
movie clip with "unloadClip" and replace it with a new SWF using
"loadClip." All seemed to be working fine, but now I see that
scripts from a SWF that I thought I unloaded are still running.
I'm sure this is due to my lack of understanding of what
"loadClip" and "unloadClip" are doing. And there certainly may be a
better way to do what I want to do... but such is life. What is the
method to delete a the contents of a movie completely from memory?
or is there a better way to do what I want to do?
Thanks for your help,
DavidNope you understand more or less correctly. unloadClip takes
away the contents that loadClip placed. However there are certain
things that don't go away.
My guess is that you have some setIntervals. Those must be
cleared (clearInterval) before you do the unloadClip.
Or perhaps you have set up some listeners? Again those must
be removed. -
Drag movie clip with dynamic text box inside it?
Hi team, I can drag a movieclip with static text inside it, but when I change the text to dynamic, I get a Property Startdrag not found on Flash.text.textfield and there is no default value.. Any help?
Cheers
subassign the mouseChildren property of your movieclip to false.
-
Whenever I load a movie clip into the target and test my
movie, the loaded movie clip always loads in the bottom right. I
think this is a registration error but I am not sure how to fix it.
My target is 835px by 635px, same as the movie clip I want to load.
Any help would be much appreciated.Position the blank movie clip in the top left corner where
you want to have
the external movie clip loaded.
Note that if the external movie clip has dynamic content
creation via AS or
different content size on higher numbered frames you may find
it will show
content to the left and top of the blank movie clip because
initial size is
not detectable. In particular if you are loading Flash movie
that you
created that you used a third party tool such as xCelsius. In
this case you
need to MovieClipLoader and once the onLoadInit event fires,
manually
position the blank movie clip which is passed as an argument
for coding
convenience.
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
"northstar_86" <[email protected]> wrote in
message
news:e27cer$5i2$[email protected]..
Whenever I load a movie clip into the target and test my
movie, the loaded
movie clip always loads in the bottom right. I think this is
a registration
error but I am not sure how to fix it. My target is 835px by
635px, same as
the
movie clip I want to load. Any help would be much
appreciated. -
I am making a website based in flash actionscript 3.0 i have a button nested in its own movie clip, because I have the button expanding to be able to read it i have figured out the only way to do this is by creating it as a movie clipa nd inside the movie clip creating it as a button
I added an event listener to the blog button by saying,
blog.addEventListener(MouseEvent.ROLL_OVER,gotoblog);
function gotoblog(evtobj:MouseEvent){
gotoAndStop(2)
this part of the code works it goes to the 2nd frame of the timeline it is in and stops wich is a blown up version of the origanal symbol
i added on frame 2 a second command
blog.addEventListener(MouseEvent.CLICK.gotoblogpage);
function gotoblogpage(evtobj:MouseEvent){
gotoAndStop("blogframe")
trace("the blog button was clicked")
i have named the symbol blog and have name the frame of where the blog page is going to be "blogframe" this line of code at the bottom is where i run into trouble the output window in Flash is saying "The blog button was clicked" just like i want it to. no errors are accouring why than is the playhead not going to frame "blogframe"? if the button is working when i click it the code is right i belive the problem here is it does not want the playhead to go to the frame i want it to. So i gues my question is, how can i make a button withing a movie clip interact with the main timeline?I have a similar problem if could please help me i'd really apreciate it!!
So i have a looping animation of some thumbnails, the hierarchy goes like this
Scene1(main timeline) -> imgBar(MC)->imgBarB(MC within the imgBar MC)
My buttons symbols are in the last MC "imgBarB" where i have this code:
ss1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
function OneButtonClicked(event:MouseEvent):void{
MovieClip(root).gotoAndStop("ssbox1");
I want to control the Btns in my "imgBarB" MC to play a labeled frame(named "ssbox1") on another MC on the main timeline,this other MC goes like this:
Scene1(main timeline)->ssbox_mc(MC where my labeled frame is) -
Am I missing a step? I have a movie clip created from a jpeg
by importing the jpeg to library. Dragging jpeg to Scene selecting
and Convert to Symbol (movie clip with exports set and Named). Both
the graphic and the movie show in the library, but only the bitmap
shows the picture in the preview Library pane (or in the Scene).
When I test the movie the movie clip behaves and displays
correctly, but I thought that it should display in the preview
pane.
Has any body got any ideas what I am doing wrong (if
anything)?
Many thanksDont worry found the option myself View > Preveiw Mode
> Full -
Problem with accessing dynamically created movie clips, returns null...
Hopefully this is a stupid question with an easy answer, if my code is straight forward enough.
I am using this snippet of code to create menu items, and then use the jCount variable below to give the clips an index number, like so (which seems to be working just fine):
for(var j:Number=0;j<xmlSubMenuLength;j++){
var mcSubMenuItem:mcSubMenu=new mcSubMenu();
addChild(mcSubMenuItem);
jCount++;
mcSubMenuItem.name = "mcSubMenuItem" + jCount;
//traces out names correctly
trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
mcSubMenuItem.x=mcMenuHolder.x+20;
mcSubMenuItem.y =mcMenuHolder.y;
mcSubMenuItem.y+= nextBtnY;
nextBtnY+=subtopicSpace;
global_subi.text = String(jCount); //i see the proper count of 10 in the text field
However, when I try to access the clips using this snippet:
for(var j:Number=0;j<Number(global_subi.text);j++)//
trace("GLOBAL SUBI = "+ String(global_subi.text)); //traces out 10, which it should
var scSubMenuItem:String = "mcSubMenuItem" + j;
var scSubContent:Object = this.getChildByName(scSubMenuItem);
trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent); //returns null!
My last trace statement returns null. Can anyone see my error, or explain why I can't access my clips after they have been created?
Thank you muchly,
~ChiplehHi kglad,
Thanks for the response.
"it's not clear from the shown code that jCount is initialized." - I've posted the relevant code below, which shows that I'm initializing jCount.
"and it's not clear why you don't use j instead of jCount in that for-loop" - j is used as loop for creating the subtopic movie clips within the i for-loop. So, for each topic in i for-loop, create a group of suptopics using the j for-loop. The j for-loop re-initiates j every time the length of the subtopics is reached(if that makes any sense) - i.e. topic1>subtopic 1,2,3,4 : topic2>subtopic>1,2 : topic3>subtopic1,2,3,4
jCount is used to keep a running count of the total number of subtopcs created - i.e. per the example above, jCount will display 10.
var topicSpace:uint=button_mc.height;
var subtopicSpace:uint = button_mc.height;
var nextBtnY:uint = 0;//whatever;
var jCount:Number = 0;
function createXMLMenu(menuLength:Number,itemName:XMLList):void{
var navItemText:XMLList = itemName;
for(var i:Number=0;i<menuLength;i++)
var mcMenuItem:mcMenu=new mcMenu();
addChild(mcMenuItem);
mcMenuItem.btnTxt.htmlText = i+1 +". " +navItemText[i];
mcMenuItem.ivar = i;
mcMenuItem.name = "mcMenuItem" + i;
mcMenuItem.x=mcMenuHolder.x;
mcMenuItem.y =mcMenuHolder.y;
//kglad's addition
mcMenuItem.y+= nextBtnY;
nextBtnY+=topicSpace;
var subVar:Number = i;//mcMenuItem.ivar
//Submenu content
var xmlSubMenuLength:Number = xml.sim.bodyText.page[i].subpage.length()
var menuItemAttachment:MovieClip = MovieClip(mcMenuItem);
for(var j:Number=0;j<xmlSubMenuLength;j++)
var xmlSubPageNumber:XMLList = xml.sim.bodyText.page[subVar].subpage;
var subNavLinkNumber:Number = xmlSubPageNumber[j];
var subTitleText:String = xml.sim.bodyText.page[subVar].subpage.subNavItem[j];
var mcSubMenuItem:mcSubMenu=new mcSubMenu();
trace("mcSubMenuItem.ivar = "+ j+1);
var mc2Attach2:MovieClip = MovieClip(menuItemAttachment);
mcSubMenuItem.btnTxt.htmlText = j+1 +". " +subTitleText;
mcSubMenuItem.ivar = Number(subVar);
mcSubMenuItem.jvar = Number(j);
addChild(mcSubMenuItem);
jCount++;
mcSubMenuItem.name = "mcSubMenuItem" + jCount;
trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
mcSubMenuItem.x=mcMenuHolder.x+20;
mcSubMenuItem.y =mcMenuHolder.y;
//kglad's addition
mcSubMenuItem.y+= nextBtnY;
nextBtnY+=subtopicSpace;
global_subi.text = String(jCount);
mcSubMenuItem.lExtend.visible = false;
global_i.text = String(i);
Then I try to access the clips like so:
-The first for-loop access the topic movie clips, no problem, and traces out scContent correctly.
-The second for-loop traces out null everytime, when I would expect it to be tracing out the names of the subtopic movie clips.
function accessClips(){
//This will access the topic movie clips
for(var i:Number=0;i<Number(global_i.text);i++)
var scMenuItem:String = "mcMenuItem" + i;
var scContent:Object = this.getChildByName(scMenuItem);
trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scContent:Object = "+ scContent);
//This is supposed to access the subtopic movie clips
for(var j:Number=0;j<Number(global_subi.text);j++)//
var scSubMenuItem:String = "mcSubMenuItem" + j;
var scSubContent:Object = this.getChildByName(scSubMenuItem);
trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent);
Hope this makes sense, Chipleh confused. If the code is not clear enough, let me know and I'll try to further clarify.
Thanks again,
~Chipleh -
Creating a function in a movie clip.
OK - so i have this method (which is in a class, if that
matters) that receives a MovieClip. I want the method to create a
function inside this movie clip and link it to the onEnterFrame
even of the movie clip.
What kind of syntax can i use for this? I'm familiar with
creating and deleting events, but not familiar with creating
functions dynamically.
Thanks for your help!I would imagine you are trying to do something similar to
what I am doing.
I would add the onEnterFrame to your class constructor...
look at my code below... -
Dynamically adding multiple instances of a movie clip to the stage with one button
hello,
I was wondering if there was a way to add several instances
of the same movie clip to the stage dynamically utilizing one
button.
I can do one with the following code placed on the button...
on (release) {
attachMovie ("filledCircle", "filled1", 5);
filled1._x = 370;
filled1._y = 225;
But I want the user to be able to hit the button again and
get yet another instance of "filledCircle" on the stage.
I also want the user to be able to drag these instances
around...
Any help would be appreciated...
Thanks,
MuhlMuhl,
> I was wondering if there was a way to add several
> instances of the same movie clip to the stage
> dynamically utilizing one button.
Sure thing.
> I can do one with the following code placed on the
> button...
>
> on (release) {
> attachMovie ("filledCircle", "filled1", 5);
> filled1._x = 370;
> filled1._y = 225;
> }
Gotcha.
> But I want the user to be able to hit the button again
> and get yet another instance of "filledCircle" on the
> stage.
You're in luck, because this isn't very hard to do. The main
thing to
keep in mind is that each instance must have A) its own
unique instance name
and B) its own unique depth. In your example, the instance
name is filled1
and the depth is 5. The next clip's instance name should be
filled2 at a
depth of 6. Then filled3, depth 7, and so on. You can use a
single
variable to handle the incrementation.
// code in a frame
var counter:Number = 1;
// code on your button
on (release) {
attachMovie ("filledCircle", "filled" + counter, counter +
4);
With me so far? The variable counter contains the numeric
value 1. The
second parameter of attachMovie() is provided with a
concatenation of
"filled" + 1, which makes "filled1". The third parameter is
provided with
the sum of counter plus 4, which makes 5. Obviously, we need
a bit more.
The button must, in addition, increment the value of counter.
The ++
operator handles this perfectly.
on (release) {
attachMovie ("filledCircle", "filled" + counter, counter +
4);
counter++;
Now, it seems you also want to position the attached movie
clip to (370,
225). Are they call supposed to go to the same place? If so,
you may use a
second variable to hold a reference to the newly attached
clip. Look up
MovieClip.attachMovie(), and you'll see that the method
returns the exact
reference you need.
// code in a frame
var counter:Number = 1;
var mc:MovieClip;
// code on your button
on (release) {
mc = attachMovie ("filledCircle", "filled" + counter,
counter + 4);
counter++;
mc._x = 370;
mc._y = 225;
Make sense?
> I also want the user to be able to drag these instances
> around...
Then you need to handle a few events. You're dealing with
movie clips
here, so your best bet is to study up on the MovieClip class,
which defines
all movie clips. (Note, also, that the TextField class
defines all input
and dynamic text fields; the Sound class defines all sounds,
etc. This is a
very handy arrangement of the ActionScript 2.0 Language
Reference.)
// code in a frame
var counter:Number = 1;
var mc:MovieClip;
// code on your button
on (release) {
mc = attachMovie ("filledCircle", "filled" + counter,
counter + 4);
counter++;
mc._x = 370;
mc._y = 225;
mc.onPress = function() {
this.startDrag();
mc.onRelease = function() {
this.stopDrag();
Easy as that. You're simply assigning a function literal to
the event
of each new MovieClip instance as you create it. Take a look
and you'll see
each of these class members available to you -- that is, to
all movie clips.
MovieClip.onPress, MovieClip.startDrag(), MovieClip._x, etc.
Wherever it shows the term MovieClip in the Language
Reference, just
replace that with the instance name of your clip -- or a
reference to that
clip (which even includes the global "this" property).
David
stiller (at) quip (dot) net
Dev essays:
http://www.quip.net/blog/
"Luck is the residue of good design." -
Dynamic Instance for a MOVIE CLIP
Hi Please help me!!!!!!!!!!
I am creating dynamic Movie Clip using as3, but I don't have
any idea about dynamic Instance name, please give me some idea that
how I can assign Instance name for a movie clip.
I am waiting your reply.
Thanks
Sushil KumarYou can assign a value to the name property of the MovieClip,
but refering to the variable name of your MovieClip instance is
preferable. This code illustrates the difference: -
How to load dynamic text inside a movie clip?
hello all - i have a main stage where on the first frame my
"home" movie clip displays. i did this by dragging/dropping, and
then i put a stop action. all works fine.
inside this home movie clip on the main stage, there are
links to other movie clips. for example, to get to my faq's page -
you click that button, then it takes you to frame 4 on my main
stage, where my faq's movie clip (followed by stop action) has been
dragged/dropped and displays properly.
within the faq's movie clip this process is repeated, with
buttons taking to you various pages (different frames where
different movie clips play - all works fine).
so now i want to add a dynamic text field within my faq's
movie clip. i have read numerous tutorials where i have created the
text file but i have not been able to display it with success
within my faqs movie clip.
here is some code that my dvd tutorial instructs me to place
on main stage as i practice getting this to work:
var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object();
myMCL.addListener(myListener);
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading
the requested information. Please contact the webmaster.";
and here is some code that i place on the faqs button within
my main movie clip that takes me back to main stage and plays faq
movie clip all successfully:
on (release) {
//Movieclip GotoAndPlay Behavior
_root.gotoAndPlay("4");
//End Behavior
and finally, here is some code that i place within my faqs
movie clip in an attempt to display my dynamic text within the faqs
movie clip - so far unsuccessful:
_level0.myLV.load("vars/faqs.txt");
NOTE:
i have published this to view - not working.
i have my faqs text file starting as info=
i have eliminated white space within my text file
i am using flash 8 pro
can anyone offer some sugestions? thanks!hmmmmm lemme double check as i seem to be a bit lost now.
// this is my actions layer code on frame 4 of main timeline:
stop();
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading
the requested information. Please contact the webmaster.";
myLV.load("vars/faqs.txt");
1. fyi - at frame 4 on main timeline, one layer beneath the
actions layer where i dragged/dropped my faqs movie clip i gave my
faqs movie clip an instance name of "mainfaqs" - although nowhere
do i refer to this specific mc within my code.
2. where would i replace/insert the following code?
_level0.faq_mc.loadedInfo.text = myLV.info;
3. i didn't know about embedding font but i saw the option
and embedded it - still no results.
4. i'm not sure how to do the following:
_level5.loadedInfo.text ='test'; //although I would still
change the path as above
To see if your getting a return from the load call adn text
file, use a trace statment before the success condition and see
what it returns:
trace(myLV);
sorry to be such a pain - i really have looked around for
answers through previous postings and i googled it and i've been
taking instruction through lynda.com and dvds but i seem to be
stuck here.... as always - thanks for your time -
How to access dynamic movie clips in a loaded swf
Hello,
I have a main movie file that loads a swf through loadclip.
There are several dynamic movie clips in the library of the
loaded swf (all set to export in first frame).
I'm trying to create a popup window (using the Window
component) by using code in the main movie to popup content that is
in a dynamic movie clip within the swf loaded by loadclip.
So far, I can create the popup without any problem as long as
the contentPath refers to a linkage identifier of a library item in
the main movie, but it won't work for a library item in the loaded
movie. Is there a way to make this work? Is there a special way to
reference library items in loaded movies?
Here's my code to create the window:
myWin = mx.managers.PopUpManager.createPopUp(this,
mx.containers.Window, true, {title:mytitle, contentPath:myref,
closeButton:true});
where myref is a string containing the linkage identifier for
the library item within the loaded swf.
Thanks in advance for any assistance,
JuliaI have found out that I can access a dynamic mc from the
loaded library (using attachMovie), but cannot use that same
dynamic mc as the contentpath for a popup window.
Any ideas why? -
Center movie clips dynamically, as3.0
Hi. I have seen this discussed both on Adobe Forums and other sites but I can't seem to make sense of the code supplied by what I have seen thus far.
I am trying to center display objects that are added to the stage at runtime dynamically through a basic drawing application.
the code is something like this:
1. add an event listener for the drawing event.
2. add the path you want to draw to a container movie clip on the stage.
3. add an enter-frame event listener to change the scale of the path randomly .... and this is the moment i want to change the default top,left registration point to the center,center of the path. each path has its own registration point as i can tell thus far but at this point the scale is happening from the top,left of the container rather than about the path's own self. and if it were to happen about the path i would have to get the bounds of the path and do some averaging to center the registration point.
unfortunately i don't know what the code looks like to achieve what i'm trying to get.
any help is appreciated. thanks in advance.Well if using the graphics.lineTo method is Bitmap data then that is what I'm using. But each call to the shape that I'm drawing is a new Shape(); . The second paragraph you wrote seems a bit daunting when viewing it in the abstract sense. Your first reply was a bit more concrete but I guess the first response didn't account for everything being in one container. Should I create a container2 Movie Clip and create that as a new box on a per-shape basis so that I have multiple container2 mc's in the following path:
container.container2[i].shape[i] where i would be an index (such that i++) though the code wouldn't be written exactly that way. ?
(To store localX,Y positions in an array or vector shouldn't be too hard but I would need to try it several times before I get it right).
Maybe you are looking for
-
Greetings, I'm working on making a slideshow in iPhoto for a friends wedding. So far I've been able to create the slideshow and export it to iDVD. Those DVD creations are going to be given to the parents after the wedding, but my question for you is
-
I'm having some issues trying to get an EXPLAIN plan from an MySQL database, using Oracle SQL Developer. One, the EXPLAIN plan button is greyed out. I can understand that maybe the functionality isn't quite implemented for displaying it in the same f
-
Web Page title is showing technical name of the report
When BI report is running from portal (web), in the wab page titel is showing report technical name. But i want to display report description, If any one knows about this pls send me the how fix that. I am working on BI 7 Thanks Samit
-
Synchronous writethrough and Asynchronous writethrough cache group
Hi! My question is that can we use Passthrough feature in sychronous or asynchronous writethrough. and of which level passthrough=0,1,2,3 please help........ regards USman
-
When I try to download Creative Cloud on my mac Error Starting Creative Cloud comes up
When I try to download Creative Cloud on my mac Error Starting Creative Cloud comes up message is:cookies dir: cannot make folder/cookies:Permission denied (error 13). What to do?