Actionscript 3.0 :: Use XML To Direct A Movieclip's Frames?
Sep 20, 2010
I'm new to AS3, still thinking of things with an AS2 frame of mind. However, I need to start using AS3 for my job. So, I have gotten a great deal of help setting up classes with another co-worker's help and a myriad of tuts. Basically, What I need to do is, set up an XML navigation/subnav (got it), and use those links to populate a series of checkboxes. These check boxes will then be used to populate text in a dynamic text field (got that ready to rock). For example, of the user selects in the nav Agreement > TOC, they might get presented with 4 options [code]...
View 1 Replies
Similar Posts:
Dec 9, 2009
I need to start using AS3 for my job. So, I have gotten a great deal of help setting up classes with another co-worker's help and a myriad of tuts. Basically, What I need to do is, set up an XML navigation/subnav (got it), and use those links to populate a series of checkboxes. These check boxes will then be used to populate text in a dynamic text field (got that ready to rock). For example, of the user selects in the nav Agreement > TOC, they might get presented with 4 options:
Told and Agreed
Told and Disagreed
Lost Connection before Agreement
Was Not Told - Cancelled
How would I use XML to direct the MC that holds the check boxes (in some cases, close to 50 of them) to the right frame? I can pull from an XML doc, sure, but have never had the need to use it to run a movie clip before.
Here's the XML I'm basing this off of:
Code: Select all<?xml version="1.0" encoding="utf-8"?>
<menu_content>
<level style = "main.xml">
[code]....
So, in this example, How would I get "Balance" to go to the right frame in my (for the sake of argument) checkBox_MC ?
View 1 Replies
Sep 11, 2005
I'm having trouble creating a conditional statement. I want to direct users to different Scenes / frames based on the first three numbers of their 7-digit assigned account nos.
I cant seem to figure out how to write the condition: "IF VARIABLE1 begins with "555" gotoandStop..
View 2 Replies
Nov 4, 2010
I'm using flash for the first time to create my graphic design portfolio and I'm having trouble keeping the file size small, and can reduce it by (hopefully) doing the following:
My resume has a lot of classic tweens with alpha channels (to create fadein/fadeout effects) and as of right now, I need to create a separate layer of fadein, fadeout for each transition. IE: My resume to portfolio page needs one 20-frame transition, my portfolio page to resume needs a 20-frame transition, my 2nd page of my portfolio page to my biography needs a 20-frame transition, etc. It's getting out of hand.
I could easily remedy this by using a lot of separate fadeins fadeouts and then coding buttons to navigate from, say, frames 120-130 (resume fadeout) then go to frame 160-170 (biography fadein), then navigate to a static page. I'm not sure if this is possible, as my buttons would have to change functions each frame.
Another possible way is that currently for each button I have different layers in order to direct the button to different frames, and have placing hem in the same spot. I'm wondering if there's any way to have buttons go to separate frames on different frames, if you get what I mean (on frame 120 it'll go to 130, on frame 150 it'll go to 160 but still be the same button". Right now each button is coded with on release gotoandplay <frame>.
View 1 Replies
Jan 7, 2010
Is it possible to have an movieclip of about 50 frames and navigate between these 50 frames? As if u put a marker on frame 10 and one at frame 30 and if u use a button it plays to frame 10 and stops and use another button to go from frame 10 to frame 30 and stop... and reverse if u use the earlier button.
View 5 Replies
Jun 15, 2009
Im using this script on various movieclips in a game
Code:
onClipEvent (enterFrame) {
xplace = Math.round(_x);
if (xplace<10) {
[code]....
I use this so when characters move around movieclip it detects where it is and put the appropriate clip on top (so a character can move infront and behind objects). Theres a problem. The script works GREAT and does what its supposed to do. The problem is that every movie clip i put it on carries over to the next frame when the timeline is furthered. It doesn't help that its a clean frame (or even several frames ahead) the movieclips are still duplicated to the new frame and so on.
View 2 Replies
Dec 24, 2009
Is there a library or cli program which is capable of dropping/extracting frames from a SWF movie? Let's say I have a SWF movieclip with 451 frames, of which I will like to make a new movie clip out of with only the first 450 frames. No wrappers or containers though.
View 1 Replies
May 29, 2009
How can I used ActionScript to draw on different frames of a movie clip. That is, make it so that
movieClip.gotoAndStop(0);
Will show something different to
movieClip.gotoAndStop(1);
View 1 Replies
Aug 14, 2010
So I've a movieclip with 2 frames placed on stage. 1st frame is button on state, 2nd frame is button off state which is just a bit lighter icon which can be achieved with alpha 40%.So I was wondering what would be better to do: leave the movieclip with 2 frames and then in ActionScript use .gotoAndStop() to show the off/on state or create movieclip with 1 frame and with ActionScript just change the .alpha of icon ? I mean better in performance, speed and all those things. Because if I have the movieclip with 2 frames and it's added to stage it's redrawing it going to 1st, 2nd, 1st, 2nd.. frame until I .stop() it..
View 2 Replies
Mar 11, 2006
how can I get the number of frames in a movieclip?
View 11 Replies
May 3, 2010
Even though I HATE TimeLine based code (despite it being convenient for quick prototypes) I have been dabbing a slight bit in "addFrameScript()"
The problem is, there doesn't seem to be any way to set the number of frames in a MovieClip via code, and Flash doesn't automatically adjust the number of frames based on where "addFrameScript" code is located.
I'm not sure what use it would server, but is it possible to set the number of frames in a MovieClip without using the Flash Professional IDE?
And, as usual, a "No, Andreas. For the n-th time, it is not possible." response is okay.
View 3 Replies
Jan 21, 2004
Is it possible to find out the number of frames of a movieClip using actionscript? Like in the main timeline have some actions in frame 1 to find out the number of frames in "content" movieClip?
View 2 Replies
Mar 16, 2009
I have an issue where I have a movieclip with two frames, both of which have a textfield.
The problem is, when I call gotoAndStop(2) and try assign text to the textField in that second frame I get a null Pointer exception, as if the textfield doesnt exist anymore.
Code:
public function select(){
this.gotoAndStop(2);
this.myLetter.text = "X"; //there is a textfield on frame two called myLetter
}
Its simple code but it doesn't seem to be working.
View 3 Replies
Nov 23, 2011
My app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target's color change and go to the next frame 2. In frame 2 i have a button to return to frame 1. How can i maintain the MC color when i return to frame 1?
[Code].....
View 3 Replies
Mar 24, 2011
I want to be able to load external images into different frames in a movieclip and then control it from inside the code. For this, I need to know how to create a blank movieclip with an ammount of frames that I can specify inside the code and how to put different images on different frames of the movieclip. How can I do this?
View 1 Replies
Mar 25, 2009
I need to create a button that will make a movie clip slide over 24 frames from the current frame the movie is on when the button is clicked. How I can do this with actionscript?
View 7 Replies
Aug 9, 2011
On the stage, I have a movie clip called mc which contains 20 frames.I have put mc.stop(); on frame1 of the main timeline, this puts a stop action in frame1 of mc.Now I want to put a stop(); action on frame10 of mc using the main time line where all my code is.
The code fl.getDocumentDOM().getTimeline().layers[0].frames[0].actionScript = 'stop();'; does seem to work and I don't know what to import.There also a code method addFrameScript(0, customFunction); but it only crashes flash player.
View 6 Replies
Aug 9, 2011
I'm creating an interactive that consists of 3 maps, each on its own tab. On each map, there are various circles representing data for a particular city.I want the circles to display a pop-up containing text when you roll over each one. Since I don't want the plain old buttons, I'm using 2-frame movie-clips, where the second frame represents the mouse-over state and a text box fades in as follows:
[Code]...
This all works fine, and I can get multiple buttons working on the first tab (frame 1) by grouping them all into a movie clip, as follows:
[Code]...
The problem is when I try to use the same or a similar with a different set of buttons on the second tab (frame 15). I put a similar set of actionscript on frame 15. The buttons seem to accept the buttonMode = true command, but I absolutely cannot get the rollovers to display. I've tried using different function names for the MOUSE_OVER and _OUT events, to no avail. I get no errors and nothing shows up in Output -- it just acts as if there's no rollover to display.Do I need to somehow put all the AS on Frame 1? Is it an issue related to ENTER_FRAME in the rollovers?
View 3 Replies
Nov 23, 2011
My app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target's color change and go to the next frame 2. In frame 2 I have a button to return to frame 1.
How can i maintain the MC color when I return to frame 1?
public class test extends MovieClip
{
public function test()
{
[Code].....
View 2 Replies
Jan 25, 2010
I have a movieclip with 8 frames and i would like to add each of the frames to the stage with addChild and with a different X, how can i do it? I was looking for something like addChild(nameMC[2]); //for frame nr 2 but i can't found any info related to this..
View 2 Replies
May 24, 2010
I'm working on a visualisation where the user inputs the number of songs they have and it shows you a visual of how many CDs this is (for a uni assignment). I have my variable 'output' and somehow I need to code a button so that when the user clicks it it takes them to my movie clip 'cdstack' frame 'output - 10' and plays then stops when it gets to frame 'output'. So it will play for ten frames then stop when it reaches 'output'.
View 1 Replies
Aug 17, 2010
I'm trying to convert the frames of a MovieClip (mc) --which are vector graphics-- to Bitmaps in order to improve performance.
The Logic is simple: During the first time play of the mc on every frame I convert the vector display of the mc to BitmapData with their appropriate transformation applied and store these BitmapData instances in an Object with the frame number as the key. I use these BitmapData instances to create Bitmap instances and use them in place of the actual mc during the successive play.
Everything works fine except that there is a random but small position error for the created Bitmap instances so it looks like its vibrating in its place. I have no idea what is causing this.
I have attached the Flash Builder 4 AS project for anyone who wants to look at the code. The swf file can be found in the 'bin-debug' folder when extracted.
View 1 Replies
May 17, 2011
I want to play a movieclip between some specific frames. For example, if the user puts the cursor over a button, it will play from frame 1 and stop at frame 27, when the user roll the cursor out of the button, it will play from frame 28 to 45.
I've tried something like this but of course it didn't work...
gotoAndPlay(1 -27);
View 2 Replies
Nov 23, 2011
My app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target's color change and go to the next frame 2. In frame 2 i have a button to return to frame 1.How can i maintain the MC color when i return to frame 1?See attach for pictures.
Code:
package
{
import flash.display.*;
import flash.events.*;
[code]....
View 0 Replies
Jan 21, 2004
Is it possible to find out the number of frames of a movieClip using actionscript? Like in the main timeline have some actions in frame 1 to find out the number of frames in "content" movieClip?
View 2 Replies
May 6, 2009
I have attached a movieclip with several frames on it. Onclick of a button I change the frame of the movieclip and stops it.
Code:
_mv.addEventListener(MouseEvent.CLICK, function(_e:Event){
MovieClip(_scp.content).gotoAndStop(_frm);
});
But the scrollbars are not adjusting according to the height of the content. How can I do that.
View 1 Replies
Jul 18, 2009
1, Seems like a standard job, but somehow this doesnt work: Movieclip called "Button" lies in the library.I instantiate it in code:
Code:
var button:MovieClip = new Button();
I have a dynamic textfield with an instance name of "description_text" in it, but if I try to access it (e.g: change the text), I get an error. This is how I do it:
Code:
(button.getChildByName("description_text")as TextField).text = "Success";
Cannot access a property or method of a null object reference.
Why is this not working?
2, I know it's easier to just have the movieclip invisible on all frames except the ones that I need it.
View 4 Replies
Feb 13, 2010
I have a SimpleButton that contains a different MovieClip for the Up, Over, and Down states. These MovieClips all have 10 frames and corresponding frame labels. I can use gotoAndStop on the MovieClip in the Up state, but that only works until I hover over the button. Adding stop() commands in the timeline seems to give unpredictable results. Is there a way to get a SimpleButton working with the Up and Over states with a multi-frame MovieClip?
View 1 Replies
Nov 8, 2010
I have 6 frames on the main timeline each with a different movieclip. Is it possible that when one movie clips finishes running it will go to he next frame on the maintime line and run the next movieclip on the next frame with AS3?
View 1 Replies
Mar 12, 2004
I have a movie clip that is about 80 frames. It just cycles through 4 pictures at 20 frames per pic. I want to use actionscript so I can cut down the number of frames. I thought I could use a while loop to do this. Here is what my code looked like:
[Code]...
View 9 Replies