IDE :: "for Loop" - Displaying The CurrentIndex On Stage
Apr 7, 2009
having trouble with XML() / XMLList. Specifically displaying the currentIndex on stage. I'm able to display the default index[0] but can not cycle through the others. I'm under the assumption the error lies at the within the code.
[Code]...
View 1 Replies
Similar Posts:
Apr 28, 2010
I am having trouble just getting started on a simple as3 image slider. I cannot figure out oop in flash.In my fla file I have:
[code]...
Also, why is my currentIndex not getting updated? I tried every combination of incrementing I could think of, but the output is the same.
View 2 Replies
Feb 8, 2011
I am trying to create a menu using a for loop. I got the loop working at the data to display, but after the 3rd button I want to put the other 3 buttons to the right of the first three, if that makes sense.Right now the first 3 displays, and the last 3 are moved over where they need to be, but it's still below the 3rd one, how do I get the 4th item to line up with the 1st time on the x axis?Here is that code I am using.
var mc:MovieClip;
var yCount:Number = 0;
for (var i:int=0; i<navigation.length; i++)
[code]......
View 1 Replies
Oct 21, 2005
I have the following XML. Currently it is only pulling one event item from xml data source. I would like to add the ability to pull multiple events listed on the same day.
XML structure:
<year value="2005">
<month value="10">
<day value="20">
<label>Test</label> .....
Code that I am modifying:
_root.dayNode_xml=monthNode_xml.firstChild;
_root.dayNode_xml=setDay(_root.dayNode_xml,1,"squa re1");
Researching I found this code and I'm pretty sure formatted correctly this is the answer to my issues:
if (topLevel != null) {
for (i = 0; i <= topLevel.childNodes.length; i++) {
if (topLevel.childNodes[i].nodeName == "mp3file") {
var track = topLevel.childNodes[i].attributes["track"];
View 1 Replies
Jan 26, 2012
I am just learning how to use Flash AS3. I have made a very basic animation that is a circle with a slice in it that grows larger over a couple of seconds until it is about a quarter of the size of the circle. It is designed for my research subjects to watch and follow for range of motion and speed as they complete a leg exercise task. I used a basic for loop in the animation to repeat it 10 times, then a frame appears that says "Set Complete." I would like to add a repetition counter to the screen so that subjects know which rep they are on throughout the animation. I know that I have to use a dynamic text box to do this, but I don't know where to put the script so that the new counter number will appear on the screen after each loop. Here is what I have so far for script:
Action Layer first frame of loop:
var count: Number=0;
Action Layer last frame of loop:
count++;
if(count<=9){
[code]....
View 6 Replies
Aug 17, 2006
Anyway i want to try load multiple movieclips using a for loop and displaying them in different spots.
Code:
for(i = 1; i < 5; i++){
createEmptyMovieClip(["target"+i] , i);
[Code]....
First of all , how can i change that "stub1.swf" to change its value like stub1.swf, stub2.swf stub3.swf etc. Also, it doesnt seem to create multiple movieclips; it only makes the one.
View 2 Replies
May 15, 2009
I'm making an interactive animation for my project and I need to display chinese characters on stage. I've already installed the neccessary Window XP features to display chinese and it does display chinese anywhere I go. The strange thing is that the chinese characters are displayed as little white squares on stage but not in my library. In other words, I can read chinese in my library or any other places in my computer besides those that were set on stage.
View 2 Replies
Nov 9, 2009
I've got a Global variable here in my flash project, which is stated like this,_global.swfloaded = "home";This variable then changes throughout the project, depending on what buttons are pushed.One example of the change is when a button labelled Classic is clicked, taking the user to the Classic page, the variable is changed like this - swfloaded = "classic";I then have a dynamic text field with the instance name of 'output' on the stage, which I want to display the variable, the code I've used for that is - output.text = swfloaded;The problem is the 'output' field doesn't update at all, no matter what is clicked.
View 6 Replies
Sep 1, 2010
I have a menu movieclip that has 800 x 22 px i need to embed this flash menu in a jsp page and make that the displayed menus got outside of this size and overlay the contents of jsp. kinda of what does the menus of the adobe page
View 1 Replies
Sep 30, 2010
I was wondering if there was a way to display emptyMovieClips created in Actionscript while working in Flash? I don't mean on run time but rather in real time, as you're working on the Stage in Flash. Basically, I drew a couple of things in Actionscript since I work with banners in varying sizes for different countries. I figured that it would be easier to draw the redundant things in AS and have them adjust automatically to the sizes of the banners rather than to do it for every single one. However, the downside is that myself and the other designers would like to see what we're working with on the Stage.
View 1 Replies
Mar 24, 2009
I have an small app the generates pdfs. In order to generate the pdfs I need to make a screen shot of the stage. I want to integrate this generator into my air application. I would prefer to not show the stage of the generator project, but only output the pdfs file. Is it possible to make a screenshot of the stage without displaying it ?
View 1 Replies
Nov 9, 2009
I've got a Global variable here in my flash project, which is stated like this,
_global.swfloaded = "home";
This variable then changes throughout the project, depending on what buttons are pushed. One example of the change is when a button labelled Classic is clicked, taking the user to the Classic page, the variable is changed like this -
swfloaded = "classic";
I then have a dynamic text field with the instance name of 'output' on the stage, which I want to display the variable, the code I've used for that is -
output.text = swfloaded;
The problem is the 'output' field doesn't update at all, no matter what is clicked. How I can quickly and easily get the field to update when the global variable itself is changed.
View 3 Replies
Sep 30, 2010
I'm just trying to get a SimpleButton to appear on the stage in an AS3 project. For some reason, it won't appear.
Code:
//Main class:
package {
import flash.display.Sprite;
import view.controls.CustomButton;
import view.controls.Button;
[Code] .....
View 1 Replies
Feb 4, 2011
I have a DynamicText movie clip call mcShotsText. In my .as file I'm creating an instance via:
private var _mcShotsText:MovieClip;
_mcShotsText = new mcShotsText();
_mcShotsText.x = 300;
_mcShotsText.y = 300;
addChild(_mcShotsText);
If I make the symbol so that it starts with text, it displays that fine. I want to alter it in code throughout the course of the game. I was hoping this would work:
_mcShotsText.text = "I am a cample";
View 2 Replies
Mar 26, 2011
I have a datagrid on the stage with an instance name of dg. When I add a element to it, the data-grid adds it correctly (like it shows an empty row) just the data isn't shown. It's like the font is invisible or something. Do I need to like set a font on a datagrid component I have on the stage?
View 3 Replies
Sep 27, 2008
The following script works perfectly, but I can't get the library item (which is a mc, class "helmet") to display. Do I need to import additional classes to display the mc?
package {
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import fl.controls.listClasses.CellRenderer;
[Code]...
View 3 Replies
Apr 5, 2012
I have code for the user to enter their name in a text box. Once the submit button is clicked I want the name entered to be dispatched with an event as well as displayed on the stage. The reason I want the text field input name to be dispatched is because the text box to enter your name is on the main menu which is loaded and unloaded in order to play through various games.Below is the code to enter your name into the text box.
Code:
var NameTextField:TextField = new TextField();var MyFormat:TextFormat = new TextFormat();
MyFormat.size = 20;
NameTextField.defaultTextFormat = MyFormat;[code].....
View 1 Replies
Feb 26, 2012
how I export the thing (as an image, or a movie, and in any format) I can't see the text. This is especially frustrating because text forms the entire basis of my animation.Tried converting text to movie clips, no difference. The weird part is, I was able to test the thing early on with no problem-- text displayed and everything. I should add: I have used MULTIPLE fonts... and I think this was about when things started not working.I'm working on a deadline and if you know how to fix this, it would make a big difference to my life.
View 1 Replies
Jul 20, 2011
i want to loop through movieClips like in AS2; i have some movieClips and Components on the stage.i want loop through them to check their properties. i had used [ getChildName ] method to get the movie clips ,but i can't access their properities.
here's my code
Quote:
for(var i=1;i<=4;i++) {
var tempisplayObject = getChildByName("my_mc"+i);
trace(temp.currentLabel);
}
when i run this code i am getting error like this
Scene 1, Layer 'Layer 2', Frame 1, Line 251119: Access of possibly undefined property currentLabel through a reference with static type flash.displayisplayObject. i am getting the same error also when i access to components.
View 3 Replies
Feb 21, 2006
I have several buttons on stage (8), and I want to add a slighty different action for everyone of them. How do I do that, All the buttons always get the last past of the "FOR"..
Code:
function loadThumbs(eventoUrl:String) {
for(i=1; i<=9; i++) {
temp = this["thumb_"+i];
with (temp) {
image = "fotos/"+eventoUrl+"/thumbs/"+i+".jpg";
loadImages(image, temp);
temp.onRollOver = function() {
this.play();};
temp.onPress = function() {
this.loadImages(image, image_big);
};};};};
loadImages() is a LoadMovieClip type function I created.
View 3 Replies
Jun 26, 2009
I have a flv component on my stage and i have buttons load different flvs into that component. However, I need to have it loop when its over. How do I do this??
View 3 Replies
Oct 28, 2009
I have added text to my stage through a loop. There are 3 different words that are added to the stage. I put the text in a mc and then used the mc for the reflection. but for some reason the whole word does not reflect. Just the last 4 and 5 letters. All of the words are 6 and 7 letters long.Heres my code:
Code:
public function placeletters():void {
for (var i:Number=0; i<numButtons; i++) {
textfield = new TextField();[code].....
View 1 Replies
Aug 2, 2011
Taking this thread to the next level and now making a Main.as class to display different "screens" of my game.For right now I only have 1 screen called ControlPanel, but this will eventually have multiple levels (each level will be a separate screen) and a level selection screen, etc. added. So at this point I'm losing control over how to give things access to the stage (in other words... it's getting really thick with multiple levels and this noob's brain is being overloaded lol).
To start off, I took all of my graphics that were on the stage by default (buttons, lights, meters, score text, etc.) and created a new symbol (MovieClip) that I called ControlPanel and checked off "Export for ActionScript" with a class name of ControlPanel. So now my games fla stage is black and I made it's document class Main.as. which looks like this:
public class Main extends MovieClip {
public var controlPanel:ControlPanel;
public function Main() {[code].........
Running this worked perfectly in that my Control Panel screen popped right onto the screen. Of course all the buttons didn't work yet but that is the next step. So I modified my old Game.as to now be called ControlPanel and read like so:
public class ControlPanel extends MovieClip {
private var docRef:Main;
private var _player:Player;[code]...........
this is a hodgepodge of ideas torn between the docRef and the View idea. I need to have access to the stage for my mouse and keyboard listeners, but then I also need access to the buttons in the ControlPanelView symbol. Do I need to pass both the view and the docRef here? How to I maintain access to the stage and the ControlPanelView graphic?
View 1 Replies
Nov 2, 2009
I am just getting back into AS after about 4 years so bear with me. I have a movie that I show and remove as needed on my stage. The movie shows 2 frames of content that pauses between them so the view can see the data. I simply want to loop the frames when the movie is on stage. This is what I have written to control the movie.
[Code]...
View 1 Replies
Mar 20, 2011
I'm trying to use a loop to add some movie clips to the stage, but I want to give each one a different name so I can refer to them in another function, but I don't know how that is done. I'm trying to learn how to do this so I can create an Isometric game. Here's my code....
[Code]...
View 3 Replies
Dec 2, 2009
I am reading in collection objects from an XML file. Each collection has an img field that stores a URL to the collection image. So I am trying to load the images of each collection, storing each image in a MovieClip, and add these MovieClips to the stage. However, my problem is that after adding a MovieClip (with the collection image) to the stage, when a new MovieClip is created in my 'for each' loop it overrites the previous MovieClip. So the images I am adding to the stage are being replaced by the following collection's image on each loop iteration. What can I do to avoid this?
[Code]....
View 1 Replies
Jun 14, 2010
I was trying to loop through the buttons(movieclips) on the stage so I can just write one functions for all of them.
[Code]...
View 3 Replies
Mar 5, 2011
Ok what i want to do is to put MORE than one instance of a MC on stageFor that i try to create a name to the MC inside a (FOR) loop (working)what dident work is to put multiple instance of it on stage.Seem preety basic but i can figure it out
function generateHex(e:MouseEvent)
{
tileSet.x = tileSize;
[code]......
View 2 Replies
Oct 7, 2006
I've been working on this for over 3 hours and it is about to drive me crazy! I was one of those people who never paid attention to math in high school because i thought i would never use it ( i knew i wanted to be an artist/designer of some sort). But now of course, that attitude is coming back to haunt me. I'm using a for loop to place several objects on stage. I need a formula that will space objects along the x axis evenly, and center all the objects on the stage. Kinda like if you use the align panel in flash to distibute the vertical centers of several objects to the stage, if that makes sense. If there is only one item, it should be directly in the center of the stage. If there are 2, it should place them in the center of the 2 halves of the stage, and so on for howeve many objects there are. I also want a buffer of about 25 pixels on either edge of the stage so that no object is ever on the very edge of the stage. I made a simple diagram to illustrate:
View 5 Replies
Oct 9, 2010
i have 3 check box's and input text fields on stage that i would like to null out using the reset button however i seem to be targeting the objects incorrectly as i am getting this error:
Error #1009: Cannot access a property or method of a null object reference.
Code:
package
{
import flash.display.*;
import flash.events.MouseEvent;
[Code].....
View 4 Replies