ActionScript 3.0 :: Load Only Certain Items From XML File?
Jul 23, 2009
I can not alter the content of the XML file, as a third-party program creates it. I need to select only certain XML items. I specifically need to exclude the SAMPLEINFO and TIMEINFO items. The problem is the existance of these items creates empty cells in the datagrid (see picture below). I need the rows with the red x's removed.
I'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 ?
I have created a bit of flash that buffers and loads an flv which plays up to a certain cue point and then seeks back 2 seconds ina loop, Got that OK.Now what I want to do is make certain movieclips visible and fade in when the video has initially buffered but heres the problem, when the video loops back it re-does these actions of fading in the movieclips as if it has just buffered again, but I want it to only fade the clips in when it has initially buffered not when it re-loops.[code]
I have a couple of movieclips in my library (there's 52 of them actually, I'm making a card game. ) and I have them exported for actionscript through the property menu.Is it possible to load them by passing a variable with the name of the movieclip class?[code]
The three text fields below (txt1, txt2, txt3) are in three different frames (1, 2, 3)... With my current code, text data from my xml file seems to be uploaded only in the textfield in the first frame. How do I load the other items from my xml file into the other textfields?
Code: var myXML:XML = new XML; var myXML:XML = new XML; myXML.load("file.xml"); myXML.ignoreWhite = true;
I am using Adobe Flash CS4 Professional. I have a simple navigation menu that I am trying to edit. I may be in the wrong place in the file, but when I open the .SWF files I can see the lines of code and I can see the actual navigation menu as it appears on our web site. I have not been able to figure out how to change / edit / delete the line inthe drop down menu that I want to delete on our web site.
I'm trying to get the number of items with a certain attribute in a xml file....for example, i want to find out how many "thumbs" there are with an attribute of "websites"
var items = web_xml.firstChild.firstChild.childNodes; var numOfItems = items.length;
The above gets me the TOTAL number of items in the WHOLE list (numOfItems) so i'm guessing i need something like:
var webItems = items.attributes.type == "websites"; var numOfWebItems = webItems.length;
I'm trying to load a swf file within another swf file and then load different swf files from buttons.This is the code I'm using, but I can't get any of the swf files to load.
var Xpos:Number = 0; var Ypos:Number = 0; var swf:MovieClip;[code]...........
I have a large swf that is embedded in Director as a sprite I now want to put it onto a web page, so file size is critical Is there a way to remove unused library items when publishing so that file size is reduced? Is there another way to compress the swf so it is much smaller?The current size is about 25 Mb.What about streaming the swf?I'm not talking about streaming video or audio, just any Flash content.In Director, there is a way to right-click on a cast member and choose "find in score".If something isn't found it means that it either is not used in the movie or is implemented through code
This is a hard question to phrase and having trouble finding the right search terms. In the last couple of weeks I have been learning AS 3.0 and the fantastic Classes that are cool as heck (not a programmer... well sort of). Everything has been working great and I've grasped the concepts well, but because of my lack of experience I am not sure of the "best" way to do some things. For example where (which "as file" to create an array of characters?)
This is a very simple game: 25 "characters" (character class in Character.as) All characters have the exact same properties with different values: charName:int life:int strength:int movement:int type:String char_mc:MovieClip (or sprite.. probably mc)
There are 2 types of characters; shipCrew and aliens. The differences between the two is that shipCrew can use various weapons and have unique "names". Aliens don't have names, just a type and they can grow and/or multiply. All of the interaction and basic game play I can handle no problem once I figure out "where" to create my characters and classes and or subclasses. My initial "training experiments" worked well... until I started reading up on "best practices" in coding and realized I had it kind of all mixed up and backwards. My concern is "doing it wrong at the start".
My first stab at this was to create the array of ALL characters in the "main.as" class for the document, then looping the array, creating new character instances on the stage. Since each character has different properties I just created the same array properties for each with a different value. So basically I am "hard coding" all the characters up front "by hand" so to speak with all the properties in the array. Since they were all identical basically, looping the array to "do stuff" was straight forward... for now. The array looks horrible in the code and is hard to "read" but since it's all "static" anyway it doesn't seem to matter... but would still like to "do it right".
Game play is simple because at a basic level each character regardless of what type it is will do the same thing. I would expand on the differences later. However as part of this inquiry I will need class instances on the stage to communicate with each other (like the idea of a registry for this). So my questions are: Should I create individual as class files for all 25 characters? (icky?) Or use an array to store the character class objects? A dictionary? A vector?
They all worked, I tried them all. I like arrays better because easier to deal with, but dictionaries look like fun and might be more efficient (only 25 items, how bad could it be?) storing in an object works too. Whatever type of "array thingy" I choose, Which class file do I create the array in? In the "main" document class or the character class itself? In another type of file like an "init" file? Could I create a "custom" file "type" or class... thingy like "CharacterCreator.as"? How about using a registry?
I have a large swf that is embedded in Director as a sprite. I now want to put it onto a web page, so file size is critical. Is there a way to remove unused library items when publishing so that file size is reduced? Is there another way to compress the swf so it is much smaller? The current size is about 25 Mb. What about streaming the swf? I'm not talking about streaming video or audio, just any Flash content. Any tricks for speeding the process up so that the user doesn't have a long wait before the swf starts?In Director, there is a way to right-click on a cast member and choose "find in score". If something isn't found it means that it either is not used in the movie or is implemented through codeIs there a similar way in Flash of detecting unused items or automatically eliminating them when publishing?
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 have 10 dynamic text fields inside a movieclip, which are populated via an XML file. However, the xml file sometimes has less than 10 items. It never has more than 10. This results in the following error, which is normal. I need the code to count the amount of items in the XML file and then create a for-each loop. I can visualize it, but I don't know how to write it. Basically what I need the code below transformed in to is this... (notice the #'s)
I 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;
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
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
I am new to flash and decided to start out using templates to gain a beter understanding. I grabbed a template - that when I went to save it said it was an MX version - once I began to make changes in it re-save and publish it I noticed that some of the elements were missing. I thought it was something I did so I copied the entire directory and just opened the .fla and saved it without making a change and then published it and the items were gone again. I saved it in the same directory only changing the output .swf file and used all of the same html files
I have a rotaing menu that loads in images from an xml file, I would also like it to load in text info from the same xml file to the left side of the images that load in. In my main .fla have created a movieclip and called it 'textInfo' and inside that I have two dynamic text fields called 'headerText' and 'bodyText' where I want to load the text in. this is what I am using to loading in the text in my actionscript, is this correct?
I'm currently working on a project that contains a lot of data, about 14.000 records. This means an xml file of about 3mb. Now my question is: Should I use the xml file to load all the data at once, or should I use a webservice, that provides the data when I need it? Keep in mind that I'm new to webservices. And if I'm going to use a webservice: How do I store the data, in a mySQL database?How fast is a webservice?
I have a little app that can read and write content that is stored in XML files. As those files get updated and re-loaded quite often I have made the experience that the browser tends to use the old/cached XML-data. Can I somehow flag the URLLoader that I use to load the XML to always load the actual file instead of looking for cached versions?
When i try to load an external swf file using Loader.Load(); The swf starts playing even before the init event is fired. Is there any way to stop the swf from playing atleast until the init event or complete event is fired?
- A.fla includes buttons, movie clips and also B.swf is loaded in A.fla using a LOADER
- i want to access elements in A.fla, from the actionscript codes inside B.fla to modify those movie clips and buttons based on actions going on in B.swf
for instance, lets say there is a button X in A.fla, and there is a button Y in B.fla, B.swf is loaded into A.fla, and I want the button Y to erase button X when clicked.
general question: accessing elements in a stage, through a SWF file loaded into that stage.