ActionScript 2.0 :: Dynamic Text Inside Movie Clip; Move When Button Is "down"
Mar 23, 2010
I want to use a button symbol that has dynamic text in it that can be edited in actionscript. At first I placed the dynamic text field over the button and made the group into another button, but the text was not getting loaded from the actionscript. I researched and found a suggestion to group them as a movie clip instead of a button as the button won't find the contained text field.
I've changed the button+text to a movie clip symbol and now the text loads fine; however, I have the button set so that on "Down", x and y increase by 2 and the shadow decreases by 2 to give it a "pressed down" effect. However I can't figure out how to get my text to move along with it, other than by creating a function for press down and release for each button, which is really laborious.
This is what I have been doing for each instance of the movie clip to get the text to move with the button:
function moveText() {
getReady_mc.step_txt._x = getReady_mc.step_txt._x+2;
getReady_mc.step_txt._y = getReady_mc.step_txt._y+2;
Having a problem displaying a dynamic text field inside a movieclip - when I test / publish the movie, the images from my html file display in the textArea, but the text itself (also from the same html file) does not display.. I don't know why this would be happening.I'm using AS2 in Flash CS3 (Newbie).my movie clip has the instance name: contentMain.The dynamic text field (Inside the movie clip) has the instance name: myText.The text field reads a html file, which contains text and images..(I should add that I know my html file works, because I can test the dynamic text field scene in flash and see the content, but not when I test the entire movie)[code]
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.
Having a problem displaying a dynamic text field inside a movie clip - when I test / publish the movie, the text field is empty my movie clip has the instance name: Main In main Movie Clip there is another movie clip instant name is : login The dynamic text field (Inside the movie clip login) has the instance name: myText How can I chang the dynamic text inside the login movie clip using AS3 ?
I'm updating a game in a Flash, using Actionscript 2 (what it was originally built in). It's a quiz game with different categories. At the end of each test is a results page showing their score for each of all the categories; each score being saved and displayed each time it's brought up. I need to have a print button added to this page, which I was able to do with
And labeling the frame of what I want to print #p. This works, but the drawback is, I can do that on each results page frame for each category; the error that results from multiple frames labeled the same thing, 'causes the dynamic text fields displaying the score to go blank when the print button is clicked. Even if it didn't, it would still print all of the frames with that label, printing multiple copies of the same results screen. Initially I planned to tie all the quizzes to a single results page; one results page, one results frame, only one frame with the #p label, and is the only thing printed.
The problem there is, I need to be able to have a back button that goes back to a point in the category the user just finished; so they can take the test again if they want, or take another part of the test in that category. So my idea was to put all of the dynamic text fields and the print button, inside a movie clip. All the text boxes have maintained their names and have embedding enabled. All of the actionscript, on any level of that frame, has been placed accordingly into the movie clip - and yet the dynamic text boxes will not populate with the score like they do outside the movie clip.
Worst still, the print button wont work at all inside the movie clip. Clearly I'm missing something, but I can't be that far off base in thinking this would work, am I? If I can make the movie clip show the results and work the print button, then I can use instances of the movie clip in as many frames as I need, but the only place the script or label for the print button will exist, is inside the movie clip. This is the script for the button putting the data into the text fields.
Here is what i want to do contextually. I am making an interactive skeletal diagram of a back, each vertebrae is an independent button. As each button is rolled over, i want a box next to the button to show with the name of the vertebrae inside it.
How I am trying to do it:Each button is independent, as inside it is a bitmap picture of the skeletal section. All of the boxes are instances of a single movie clip located on the same timeline level as the buttons.. instances named BBox1, BBox2... through BBox26. Inside each movie clip i have a symbol that is the box named 'sbox' which is the graphic box that pops up and in the layer above a dynamic text box, named 'ttext' which is populated at runtime with the proper text to reference the button.
I am easily able to reference each sbox symbol individually from outside the movie clip... i.e._root.skel.BBox1.sbox._alpha = 0;.
I am not having the same luck with the ttext dynamic text. I am wanting to set the text inside each instance of BBox progmatically, but the text will not show unless i set it to static and type it manually before compile(in which case the text for all 26 boxes is the same). I have tried all methods of reference, even prepopulating the dynamic text box with text before compiling and it still shows nothing. This does not seem like a coding issue but a use of dynamic text inside a replicated movie clip with unique instance names.
Basically I am trying to do a Flash (AS 2.0) application that connects a FMS server. That isn't the problem, though. The problem is that when I click a button (myBtnEn) it changes a Bool variable to true, and if I click another button (myBtnDis) it changes the same Bool variable to false. The problem is:I want to display that variable's state in a Dynamic Text Box that is inside 1 Movie Clip and it doesn't change/display a thing else than when is loaded.[code]as you can imagine the code for myBtnDis is the same but "false" in the place of "true".myBoolStatus : name of the VARIABLE in the Dynamic Text Box.I have tried to name the Dynamic Text Box (for example "myBoolStatusP") and then add the ".text = " code but still the same.
I've made a flash movie which will load four movie clips at runtime. Actually, the number of movie clips will depend upon number of "NODE" in XML file. Keeping XML file thing aside, I've tried hardcoded values; 4. Let me describe you the structure very well:
There is a main empty movie clip, instance name "mc_scroll" which will be only item on stage. In this movie clip, another movie clip whose identifier name is "blueMovie" will be loaded dynamically. Inside this "blueMovie" MC, there is a button instance name is "blueButton" and inside this button there is a "Dynamic Text" field instance name is "btn_text".
Phewww.. so long chain... inshort: mc_scroll->blueMovie->blueButton->btn_text
Now, I can load 4 or any number of "blueMovie" inside "mc_scroll". But I also want to set the button text for each button inside each MC!! I'm sure you guys are getting what I want to do. But its not working. Below is the code:
Code: //INSIDE THE MAIN TIME LINE for(i=0; i<4; i++) {
[code]....
how to assign the text dynamically which is inside a button and this button inside a MC which is created dynamically inside a main MC!
I have a dynamic text box and a movie clip with a button in it in the same frame. What I want to happen is when you click the button, it will add 1 to the text box. (when I say 'Add one' I mean if the text box says 5, after pushing the button, it will equal 6). I hope people understand what I mean, if not, ill try to explain it better.
On the main timeline I have a movie clip called clock_mc and playBtn playBtn is placed in the center of clock_mc When you press playBtn clock_mc starts playing
playBtn.addEventListener(MouseEvent.CLICK, playClock); function playClock(event:MouseEvent):void { if (event.target == playBtn)
[Code].....
I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false; And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work Even when I put the button physically to the last frame of clock_mc it will not work either.
I am attempting to have the main timeline move from a stopped position over a movie clip to frame 1, where my start menu is.The code I'm using does move the timeline but in doing so it somehow breaks the 4 buttons I have in frame 1.
My code in the movie clip: stop() function replayMovie(event:MouseEvent):void
I'm having a little trouble but I think the solution is simple. I have a button in a movie trying to start another movie rooted in scene1. I have some code placed in movie 1 to try and play movie 2, both movies are in a scene1 layer.
how can i get a MC button that is inside another MC to carry out its functions
the mc button is using TweenMax for its roll-ON roll-Off effect and that works as normal when i test main movie
but the button itself dont function when pressed still mouse roll-On roll-Off effect works but not the movie clip button it this to do with it been nested inside another mc or is it the code am using below
web.onRelease = function(){ gotoAndStop,(49); }
web is just the name of the nested movie clip button i was saying
I've created a movieclip button where on release the button moves and grows into the background of my content. The problem is that if the mouse does not hover over the button while it is moving, the movieclip does not play all the way through.
I have come up with two solutions to the problem but i need help developing the coding for them.
The first option being to freeze the the cursor in its position until the clip is fished playing through.
The second option is to come up with a coding that allows the clip to play through independent of the movement of the cursor.[code]...
i have 2 movieclips: i want to move both of them but the second movie clip will only move if the first clip reach his final destination how do i do that?
i was using AS2 i have main flash movie in this main movie have a little animation after doubleclick i was created a dynamic textbox opens Tween 1 - and in this Tween 1 i have the dynamic texbox if this textbox copy to main timeline shows it perfectly text from xml only in this movie clip [and Tween]- cant show text
how do we refer the submenubutton which hasbeen masked inside a movie clip.
In my code ,
mainBtn3 is present inside "mm " movie clip . and on click of it I am able to move to another frame using below code . But, if there is a sub menu for the button , and if I am referring it as below [mm.btn3sub1] and trying to move to another frame . I am getting following error
TypeError: Error #1009: Cannot access a property or method of a null object reference. at sumiyatried12356_fla::MainTimeline/frame1()
Im able to link to a movieclip inside a movieclipUnfortunately one of the movieclips now are a scrollbar and scroll. Now the actionscript isnt working?cal.onPress = function() {gotoAndPlay(2);message1.contentMain.message.total = unit1;
I need to find a way to make a movie clip or button click and direct to a movie clip that pops up a window with data and has an x box to exit that movie clip. I also need that box WITH the x to be draggable together.
//Louisville,CO ------------------------------- louisville_btn.onPress = function () { louisville_box.gotoAndPlay(play);
i have a button inside a movie clip.I want the button, when i click it, to go to a web page in a new window.I have put my script on the top layer of the main timeline, in a layer called 'controls'
Here is the script:
Code:
function openPhotomore(yourEvent:MouseEvent):void { navigateToURL(new URLRequest("http://anarkiuk.deviantart.com/gallery/#Photograph"),"_blank"); }; photomore_btn.addEventListener(MouseEvent.CLICK, openPhotomore);
I have given the button an instance name of 'photomore_btn', but it seems to be inside a tween aswell?When running the swf i get the error:
1120: Access of undefined property photomore_btn. How come it cant find the photomore_btn?
Can anyone explain what are advantages/disadvantages to put the button inside the movie clip vs. to put a button instance directly on the main timeline? My final goal is to have plenty of animation going on inside the button stages.
I'm having trouble with buttons i placed inside the movie clip....whenever i place functions the rollover state of the button doesn't work anymore....i'm having trouble thinking where to place functions or methods.....i know programming in java and to be frank i'm having trouble with learning actionscript because the books i read don't say where to place the functions they write.Here's a link to my flash file [URL]
I have in the Scene 1, on layer 2, Frame 2 a movie clip named "Festival_conteudo_mc".And inside of this i have a buton ( close_btn ) that I would like to close this movie clip and go to the Scene 1 - to the main menu.On Scene 1 I have my menu buttons ( Festival and Contacts ).
The problem is that i dont know how to make them communicate, I've tryed _root, and As3 tells me it doesnt exist and its replace by Stage...I too new in this stuff. What happens when i put
close_btn.addEventListener(MouseEvent.CLICK,menu) function menu(Event:MouseEvent):void { gotoAndStop("Scene 1", 1); }
It give Script no error, but when i Export the movie a error 1067 is reported.
i have this code in an as layer within a movie clip called pages
ss_btn.addEventListener(MouseEvent.CLICK,reportCli ck); function reportClick (myevent:MouseEvent):void { // do something in response addChild(img_holder); removeChild(img_holder);
but the ss_btn im trying to access is within another movie clip called menu is there a way i can access the button