AS3 :: Xml - Loading All Items With For Each?
Feb 20, 2011I'm low level as3 programmer and I need whit this code:I have gallery XML file:
<gallery>
<item>
<id>1</id>
[code].....
I'm low level as3 programmer and I need whit this code:I have gallery XML file:
<gallery>
<item>
<id>1</id>
[code].....
[Code].....
only shows last item from XML file:
3.jpg
I used to put a load of instance names linking to library objs into an array in AS2, then use a loop to add them to the stage..I htought this would work in AS3, alas no.
Code:
var list:Array new Array("one", "two","three");
for(var i:int=0;i<list.length;i++)
[code].....
The application will pre load 5 different images and place them in an array of bitmaps.My only problem is that i want to display a progress bar to the user.I know how the calculate the progress of one image:progressBar.source=loader.contentLoaderInfo;but i want to load the images using a loader one by one, which means that after each loaded image
View 1 RepliesI am attempting to load text from an external .txt file into dynamic text fields using AS2When you click on a button (named forward and back), I want the next &-denoted "news" item to repopulate the current dynamic text boxes to replace the first bit of info.This is what I have so far, but I'm stumped. I used the trace to make sure the button is "clicking" (it is), but I can't get the integer to go up a number and repopulat the fields.
var newsData:LoadVars = new LoadVars();
newsData.load("data.txt");
newsData.timeline = this;
[code].....
I have a project underway where I am making an interactive game. It is a personal character creator game and I need Actionscript 3 help with this.Something similar here:http:[url]....
I have tried already with toggling visibility and 'gotoAndStop()' to make items appear over other items when the corresponding button is pressed, for example, when the user tries out different pants/shirts on their character.
I would like to use the selectionMode=multiple described in the Flex docs, but with a few modifications:
1) I would like the box that the user drags over the graph to remain there until the user drags a new one.
2) In the top right corner of the box I want to display the sum of the items selected by that box.
How to make list items as tool tips for combo box items?
View 2 RepliesI'm creating a facebook application in flex. I'm actually working on the friends component that shows your friends who are using the application. now, each friend has a profile image.
I created the component using a s:List element.
In the Skin Class of the element i configured the requestedColumnCount to 3, which means it shows 3 friends. i added buttons to scroll left and right in the list.
Whenever I scroll to see a different friend, for a half of a second i see no image because the List component is loading the image in order to view it.
is there a way to make the list preload all the elements so i won't have this kind of problem ?
im having some dificulties in the combobox of Flex 3, after defining the dataProvider and filling the combobox, how can i remove the items in the combobox later (without removing items in the dataprovider)? if i set the provider to "" or null, the items in the combobox are still there
View 1 Replieshow to get my CollectionEvent to work, and I seem to be able to see the problem, but I am not sure how to get it to work properly.
In my actionscript, it seems to only tell that event.items.length is 1, while I am calling my array collection from the HTTPService, and I have tested the length of my Array Collection, which seems to be accurate. What I tried to do is to use that number in the CollectionEvent function, but that does not work at all.
Attach Code
private function onChange(event:CollectionEvent):void{
for (var i:int=0; i< event.items.length; i++) {
Alert.show(event.items.length.toString()); //This always gives me 1 when I have 12 items
[Code].....
I have placed TextFileds inside TileList Compontent. When i try to select the TextField it can't show the selected Textfield in the TileList items by default the TileList items are selected.Finally i need to select the TextFields.
Here is my code:
import fl.controls.TileList; import fl.data.DataProvider; import flash.display.Sprite; import flash.events.Event;
function TileListExample() { var dp:DataProvider = new DataProvider(); var totalEntries:uint = 3; var i:uint; for(i=0; i<totalEntries; i++) { dp.addItem( { source:getTf(), scaleContent:false}
[code]....
I only started yesterday with no knowledge at all.How do you make draggable items? I looked around and I saw things about actionscript and all that but what do you do?
View 5 Repliesam creating a little game... It is about selecting some items...If 2 right items are selected on frame 1, the "next" button will appear for the user to click on it to go to frame 2.
View 1 RepliesSay I create a symbol, and then another inside the symbol. In the library I now have 2 symbols. Is there a way to combine these into just one library item?
View 1 RepliesI am trying to load MC's from an array but I need to make it so that after ever 2 MC's the Yposition changes down say 300px so that I have a new line. I have tried using if(see at the bottom of this script.) bellow but it doen't work.[code]...
View 2 RepliesWhat I'm trying to do is, create 5 or 7 movie items in a list and when you click on any of the items the items in the front will move to the back of the list.sort of like selecting a specific cd in a jukebox.So when you click on the 3rd item the first one in the front fades and shows up in the back, than the second item fades and comes back in the back and the 3rd item is now in the front.I think I can do it to 1st item in the front by changing the stack order but not sure how I can make the first 2 items move to the back.
View 2 RepliesI have a flash file, which is a header for a website. I inherited it from my company's previous webmaster. I was looking through the library items & see alot of images & graphics that I don't see in the finished product on the webpage. The guy worked really sloppy so it's possible there's alot of unused items. Is there anyway to easily tell which items are not used in the final exported flash file so I can clean it up?
View 2 Repliesi am newbie action scrpt 2.0 and do escape room game i can able to take items to my inventory but i want use example , if i use hammer on a vase , vase will crash (motion tween) player will find key. yea important is player can continue to play game after this animation i didnt understand how to do that with codes:[code]
View 1 RepliesI am new to Flash so please bare with me, I have some items that start in my movie and then go onto the pasteboard as well as Items that are on the pasteboard that I do not want to show in my movie, but when I test movie everything is showing including the items on the pasteboard... how can I just make my movie show the stage size and not the extra stuff leaving the stage and on the pasteboard?
Additionally, I have created a series of classic tweens in one layer starting on frame 30 through frame 60. How can I shrink just those frames and scale the tweens with them so they are proportionate to what I had originally?
I am trying to make my game increase in balls after each level passed by the player.
The script below are all on an enterFrame function
var level:int = 5;
var ball:ball_mc;
[Code].....
My Flash designer is reading an XML stream I'm sending back to the browser (I'm a C# dev). We have this working fine.
He is then selecting into an XMLList where a element has its id a certain value i.e. . This is also working just fine.
In this XmlList, are Events, that look a little something like this:
event
startdate
enddate
end event
I don't know how to use the formatting here - but each of those items is an element. startdate would have a value such as 04/02/2010 and enddate 6/30/2010.
Now, from this XmlList I do have of Events, I need to select all Events where a new variable myDate, falls in between the startdate and enddate.
I've used programmaticSkin to customize an element i use. I would only like to use it on certain occasions. (on some instances - yes and on others no, or use other skin) is it possible?
View 1 Replies<themeRandomAngles></themeRandomAngles>//this doesnt contain anything
<themeAngles>90</themeAngles>//this does
How could I check for that?
[code]I need ONLY the text of the LogType's (FROM CENTER "BOCC" ONLY) to show up in a list component. I do not want to see any other results (e.g. from SOMEOTHERCENTER). Like show:[code]The actual file I'm working with (and can not alter) is media.chp.ca.gov/sa_xml/sa.xml.
View 5 Repliesif there was any way to specify the different items in a combo box, i wanted it to go to a different part of the site when u click on it heres what i have now (notice the combobox at bottom left)combo
View 3 RepliesHow do I align items to the right (or any edge of the stage for that matter).
Isn't it something along the lines of...
Code:
movieclip._x=stage
i am have a small doubt in actionscript, i think its a silly one but banging head to solve it...f there are some items present on a panel and if i select one of them then how can i get the id or name of that particular selected item.For example if there are two accordions and if i select one, how can i get the id or name of that selected accordion.
View 3 Replieswhen copying one timeline to another it keeps asking me to 'replace existing items'.When i do this it pastes 2 instances of the same item on my page + another random item.
View 1 Replieswriting a code for adding an extra space on every 5th items?I only know how to space them out evenly,
for(var i:int = 0; i<20; i++)
{
var item:MovieClip = new MovieClip();
[code]......