ActionScript 2.0 :: Calling/targeting Dynamic Mcs?
Aug 15, 2006
I can't seem to target the mc's that I have pre-loaded externally. The problem is that mcs like 'screen_roadmap' play at the beginning of the compiled movie, and not when I make them visible by pressing on the button. I currently have a stop(); command on frame one, so I would like the movieclip to gotoAndPlay(2); only when I press the button. I have tried things like : this["screen_roadmap"].gotoAndPlay(2);. I used this code from an actionscript book, but it makes no mention of targeting the mcs.
ActionScript Code:
menu.roadmap.btn.onRelease = function() {
gotoScreen("roadmap");
[code]....
View 1 Replies
Similar Posts:
Jun 15, 2009
I have a small problem with dynamic targeting inside a loop. Shortly, I have some buttons which I add listeners to in a loop. loop works fine. I got everything to work, but the second line in it gives this error : TypeError: Error #1034: Type Coercion failed: cannot convert []@d4abe81 to Function.[code]Can anyone help me with the correct syntax for the second line ?
View 1 Replies
Oct 14, 2009
ActionScript Code:
for (var i:Number = 1; i<=15; i++) {
_root["window_"+i].onRelease = function() {
_global.myvariable = window[i].name ; //doesnt work
}
}
How can i get name of clicked button? In as3 is evt.target.name action, but in as2?
View 2 Replies
May 18, 2005
Ive been talking about this in another thread, but I guess its a better idea to start a new thread to ask this question: How can I target a named instance of a dynamic text field that is inside a button, which is inside a movie clip, which is on the root timeline, from a frame in the root timeline?
I tried _root.movieclipname.buttonname.txtfieldname but that doesnt work...and to make issues a little more complicated, its not a static movie clip, but a duplicate that needs to be targeted every iteration of a 'for' loop.
I thought it would be something like -
_root.movieclipname[i].buttonname.txtfieldname
But thats not working...How can I target that textfield?
View 7 Replies
Jan 5, 2012
I want to add a logo to my dynamic menu tabs, the code below adds the logoLdr to the very last tab, but i want to add logoLdr to the first tab generated?How do i target individual tabs in this loop?
PHP Code:
function createMyMenu():void {
//This will be used to represent a menu item
[code].....
View 1 Replies
Sep 13, 2005
I'm trying to target a dynamic text box for a slideshow that is located in an attached movieclip.This is the array:var slideShow = ["slide1", "slide2", "slide3", "slide4"]; Each slide is a movie clip that is loaded with attachMovie(). These movies each have a dynamic textbox named "slideDescription". How would I be able to target that text box and get it to change the desciption each time I move to the next slide in the array?
View 1 Replies
Jun 29, 2006
I made an array containg 3 clips and dynamically attached them to my main timeline. I can successfully tween all of them with the following code.
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
[code].....
View 2 Replies
Aug 15, 2007
I'm generating movieclips based off of an xml file. The images load fine but I can't figure out how to target them for onPress actions.
[Code]...
View 4 Replies
Dec 18, 2011
I'm trying to create a movieclip from the library dynamically on a certain event and then being able to target one specific movieclip by name after they've been created. I'm having problems being able to target and have tried a tone of different approaches, I think I'm close but I'm getting the error '#1006: getChildByName is not a function.'
Code:
package {
import flash.display.*;
import flash.events.*;
[code]....
View 14 Replies
Sep 10, 2010
I have a dynamic text and i am calling it through XML, i can see the text appearing but there is an extra line space appearing in my swf. I have tried hard to fix it but it's not going.
View 9 Replies
Sep 14, 2011
i have the following script, i'm just doing tests over failed attempts, I have a "cnc+i" dynamic variable, wich is a BitmapData type, i'm sure it's declared since the trace function returns true at the output, what i have a problem with, is at the moment of attaching the Bitmap, i don't know how to call it, and i don't want to do it manually like this: cnc1. Since i am planing on putting the attachBitmap inside a for loop:
ActionScript Code:
import flash.display.BitmapData;
this.createEmptyMovieClip("CNC",this.getNextHighestDepth());
CNC._x=50;
[Code].....
View 1 Replies
Jun 4, 2009
I'm sure this is a quick and easy question but I've been at it for a while and can't seem to get what the problem is.Inside my movieclip called "movies", I created a dynamic movieclip
Code:
var my_movie:MovieClip = new MovieClip;
addChild(my_movie)
[code].....
View 2 Replies
Nov 18, 2009
Code:
var whatSpecialTrain;
var specialTrain:int;
var a:Array = [1,2,3]
[Code]....
how i can do what i'm doing here without doing it the long way? The only other way i know how to do this is do if statements and duplicate heaps of code, one for each corresponding value...
View 3 Replies
Oct 28, 2010
I have a sprite menu which populates a dynamic textfield with textlabels as users click individual items in the menu in addition to ordinary actions(gotoAndStop). As these labels appear in the textfield, I want to be able to link them to the frames assosciated with the menu - item frames. As you can understand from this, I am working with the timeline. By enabling html rendering of text in the textfield, I have been able to link these output labels via a a href - tag, but I am not able to call a function from this html. The function I am trying to call uses a switch statement to take the appropriate actions according to which label is being clicked, but the only effect I get is the html opening a browser window...... Unfortunately I do not know how to explain this any better, but here is my code for the following:
[Code]....
View 2 Replies
Oct 29, 2010
Tried several approaches for making this happen, but can't seem to do it. I could really use an example of how to do this in my particular case, since I'm not exactly a code - guru..... I have a sprite menu which populates a dynamic textfield with textlabels as users click individual items in the menu in addition to ordinary actions(gotoAndStop). As these labels appear in the textfield, I want to be able to link them to the frames assosciated with the menu - item frames. As you can understand from this, I am working with the timeline.
By enabling html rendering of text in the textfield, I have been able to link these output labels via a a href - tag, but I am not able to call a function from this html. The function I am trying to call uses a switch statement to take the appropriate actions according to which label is being clicked, but the only effect I get is the html opening a browser window...... Unfortunately I do not know how to explain this any better, but here is my code for the following:
Main Timeline, frame 1, actions layer:
ActionScript Code:
import flash.display.*;
import flash.events.*;
import flash.display.Stage;
var buttonTrace:TextField;
var sectionNames:Array = new Array("Frontpage","Introduction",
[Code] .....
View 0 Replies
Mar 7, 2010
i'm attempting to instantiate a bunch of sounds by creating a string array containing each sound's filepath (or name).
var soundByName:Object = {};
var channelByName:Object = {};
var soundName:String;
[code]....
View 1 Replies
Sep 21, 2009
I have a flash movie within it quite a few scenes. When I go to a certain scene it has a movie clip on it (UGFT_MC). Within this I have a dynamic text box (UGFTtxt). I have the render text as HTML selected and the variable called "data". On my main timeline at the start of this scene I have the actionscript: loadVariables("UGFT.txt","_root.UGFT_MC");
Within my text file I have the following:
data=<B>All the code I want in my text box</B>
<p><img src="test.jpg"</p> etc.
This part all works, except I have lots of text and images in the text file and need a scroll bar on my dynamic text box. I have tried the UIScrollBar and it only works some of the time, and there is no pattern as to whether the scroll bar will appear. Quite often it is just a grey area. Though the top of the text called from the file is visible.
View 0 Replies
Mar 2, 2010
I'm getting stack overflow errors when I'm trying to publish() a NetStream after close()ing it. Pasted below is the error stack:[code]
View 1 Replies
Jan 14, 2012
For some reason, the same code works now, without any problem at all. I don't know what happened, or why, but I no longer have this problem Here's the original post: To put simply, I created a MovieClip, put it with addChild() to stage, and when I tried to call this piece of code:
[Code]...
View 2 Replies
Mar 2, 2006
I have made a navigation that is a movieclip, now within the movieclip are 6 movieclips that are the "buttons" of the navigation. This is then placed on the maintimeline as the movies navigation. When one of the "buttons" is pressed i want it to go to a specific point on one of the 6 movieclip "buttons" timeline. This is the code that I have used before on the maintime line to target a movieclip there... but never a mc within an mc. First, would I still place this code on the maintime? or within the mc that the 6 mc buttons are placed? Second how would I target the nav buttons mc's?
stop();
but1.onRelease = function() {
this.gotoAndStop(9);
[Code]....
View 2 Replies
Jan 15, 2009
I've got a dynamic textfield clip which is placed twice on the stage. It also includes a button. Funny thing is, the first trace works (tracing its _y value: 0 for clip 1 and 200 for duplicate clip 2). When I press the down button of both clips however it traces undefined though it's the same line. How does onPress mess up the targetting of both clips? [code]
View 6 Replies
Nov 11, 2009
1. I'm loading an external swf onto my main swf.
2. Then I'm tweening an object which is separate to the loaded swf.
3. When the tween has completed I'm calling a function to make the loaded swf gotoAndPlay(2);
[Code]....
View 8 Replies
Feb 12, 2010
I have 2 SWF (swf1 and swf2). I want to load swf 2 into 1, but getting it start on a label or a particular frame.I use this to load SWF 2
Code:
on(release){
loadMovie("movie2.swf",0);
}
How do i target it to start from a label in a scene from movie2.swf?
View 3 Replies
Apr 28, 2011
I'm trying to target an MC that is already placed on the stage (as opposed to adding it from the library).
But I get this error:
Quote:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com::Test()
at objects_fla::MainTimeline/frame1()
[Code]....
View 5 Replies
May 27, 2009
With AS2 I u sed to do createEmptyMovieClip("name"+i, to create multiple instances of an mc. I ocuuld then target these individual instances
[Code]...
View 4 Replies
Feb 4, 2011
I made a play/pause button for this project I'm working on (basically a slideshow with a different movieclips on each frame) and I have managed to get it to target either the main timeline or a nested MC. The problem is with the code I have is that the button will only work for one MC at a time. This means I will need a separate play/pause button for each individual slide. Is there some way to make a button that globally starts and stops any MC without effecting the main timeline?
Here is the code I am using now:
stop();
pause_btn.addEventListener(MouseEvent.CLICK, stopplaying);function stopplaying(event:MouseEvent):void { MovieClip(parent).green.stop(); gotoAndStop(2);}
Ned proposed adding an event at the beginning of each movie clip and programming the play/pause button to work that way. My problem (after spending a lot of time with it) is that I can't get my play/pause button (a MC itself) to target the event in a separate MC.
This is my event placed on the first frame of my movie clip:
dispatchEvent(new Event("imHere"));
This is the code I have in the play/pause button that doesn't work:
stop();
pause_btn.addEventListener(MouseEvent.CLICK, stopplaying);function stopplaying(event:MouseEvent):void { gotoAndStop(2);}
[Code]....
View 8 Replies
Jul 31, 2009
I am building an ecard, and I created two swfs. The first swf is the actual ecard, with a dynamic text box that is going to display the message. The second swf is where you would actually type in the information, such as name, email, and message. Is it possible for two swfs to "talk" to each other inside an html document? Also, I am not quite sure how to send the card to someone's email. I am assuming that when you hit SEND it reads the input box with that email, but not sure how that works.
View 1 Replies
Dec 30, 2009
I have a main.fla which has 3 movieclips inside it. All 3 mc's have timelines that run 40 frames. The main.fla timeline has each mc instance on a frame.
mc_1 is on frame 1
mc_2 is on frame 40
mc_3 is on frame 81
as the main timeline plays the clips each one fades to the other.
I need to know how to target this scenerio
after mc_3 plays I need to have a goToAndplay (frame) set up so the animation inside mc_1 starts playing (frame 20) of mc_1.
I know how to do off a button
but there is no buttons, the action needs to happen when the playhead reaches the last frame of the main timeline in main.fla
View 2 Replies
Oct 5, 2004
targeting external .swf's.I am trying to load external movies to a main movie in a branched manner (i.e. root -> first movie has buttons to load second -> second movie has buttons to load third) in specific areas on the main movie.
In this simple flash im trying to get the main-button to load onto the main movie. Once it loads, a button appears and replaces the black square. When you click on it a series of other buttons appear on the side and replace the red square. Once those buttons appear, when one clicks one of them a small movie loads into the blue square and replaces it.
View 3 Replies
May 1, 2003
this code is working to load and position the external swf, but it won't gotoAndPlay to the frame inside the external swf--what am doing wrong here?
PHP Code:
bio.onPress=function()[code]......
View 3 Replies