ActionScript 2.0 :: Creating Loop To Pull Data From XML And Load Into SWF

Mar 25, 2005

I am currently scripting a Flash application at work which will pull data from an xml file (.jpg's and text) into template swf's created by our designers, for use in online product commercials, realty/property tours, etc. I am creating a loop which will pull data from the xml and load them with createEmptyMovieClip(). Here's the code:

Code:
_root.dynLoad = function() {
trace( "initializing dynLoad function..." );
for( _root.g = 1; _root.g <= _root.featLength; _root.g++ ) {
if( _root.g == 1 ) {
this.createEmptyMovieClip( "dynPic", this.getNextHighestDepth() );
[Code] .....

I am not the heaviest with actionscript and I can get the first two pictures to load, but after that the pics get loaded into the duplicated clip. I tried my hardest to get the else block to dynamically increment the "dynPicNew" ( ex. load it into "dynPicNew" + _root.g ), but I can't nail it! How can I get the duplicateMovieClip() to increment the load target dynamically?

View 4 Replies


Similar Posts:


Professional :: Input Data From A Frontend Site Into A Backend SWF, Pull Data, Then Send Back To Front?

Aug 31, 2011

I have a site with an SWF that I can put some metrics into, such as ZIP Code, Weight, etc..    then, it takes that info and gives me shipping rates.
 
I need to build a front-end site that I can have a forms page that will push data to the backend SWF, and then return the data back from the SWF to the front end.
 
Front-end -> SWF (Zip Code, Weight, Size) -> *Calculates* -> Front-End
 
That should be the flow..     So I need to send data to the backend, GET the data that it calculated, and return the results to my front-end.

View 3 Replies

ActionScript 2.0 :: Pull Data From The Arrays And Put That Data Into Text Fields?

Oct 24, 2006

Flash 8, I have some XML creating a few simple arrays. These pull some movie clips onto the stage with incremented names: product1, product2 and so on. Inside these clips I have some code that is supposed to pull data from the arrays and put that data into text fields.

[Code]...

Shouldn't this last output be the number 1? I want to use this number to call the correct node for each clip,

View 2 Replies

Creating A Pull Down Menu?

Apr 22, 2010

I'm trying to create a pull down menu. Not one that drops down when rolled over but one that drops down when clicked and stays down until an item is selected. Once an item is selected or the menu is clicked out of it retracks again.

My strategy is to create a movie clip for the initial menu that when clicked jumps to another movie clip where ther menu is extracted and houses movie clip buttons that hightlight when rolled over and when clicked redirect to another movie clip related to the button that was selected.

is this the proper way to do this? And second: can you offer some direction for the action script?

View 1 Replies

ActionScript 1/2 :: Pull XML Data To A Text Box?

Oct 5, 2009

How could I get the XML data in to a text box?[code]...

View 8 Replies

ActionScript 1/2 :: Pull Data From A Column Instead Of A Row?

Mar 23, 2010

I know how to pull data from a row of an mysql db. But how do I pull the data on the same COLUMN in a MYSQL db? What do I need to send to the server side script?
 
E.g. The mysql holds 2 field names "COMPANY" and "CONTACT PERSON". How do I pull all the COMPANY names only?

View 3 Replies

ActionScript 2.0 :: Pull Data From JSON In It?

Jul 10, 2009

I am currently designing a set of actionscript charts for my company's website. For the set of charts I have set up right now I'm reading all the data from FlashVars, but as you could guess that's not a very good format for charts...

I'd prefer to use a JSON array of values,

now my question is: Where should I go to start learning about reading from JSON is AS2? I'll hit the books, of course, but this forum is always good when I need to get some advice to dive right in to an urgent project

View 1 Replies

ActionScript 1/2 :: Unable To Pull Data / Image

May 1, 2010

This is my code to impot an image + some data from a db. I'm unable to pull the data or the image (nothing appears).[code]

1. What am I doing wrong here? or is the issue is elseware? (I'm PUBLISHING this to Flash Player 9 and AS2.0
2. How can I code this without using the XMLParser?

View 7 Replies

Professional :: Flash / AS3 And XML - How To Pull Specific Dynamic Data

Aug 20, 2010

I am doing a project that consists of AS3 in flash an importing an external xml data that will populate dynamic data in text fields in my flash project. The xml is all ready set up (pre existing) data. The structure of the XML Code looks like this:

<GlobalDynamicData xmlns:xsi"[URL]">
<schema version 1.0.0>version 1</schemaversion>
<DynamicDataFields>
<DynamicDataField>
<DataField> AlertOn</DataField>
<DataValue>0</DataValue
[Code] .....
which works fine,

My question to everyone is How do tell flash to pull specific dynamic data if all the datafields are exactly the same... I would think all data fields that are named have to be diffrent so when you script the code you are telling flash to go to that data source and pull from that record. If you have the same naming convention how does flash know which one to pull from if they all have the same name..

View 3 Replies

ActionScript 3.0 :: Pull Data From Sqlite To Custom Menu?

Oct 14, 2011

I'm trying to bring data from an sqlite database into a custom made menu. I have the menu working using an array with the code shown. But, now I would like the data to come from an sqlite database.

The code shown for the database, I have used for a previous job that pulled the data into a dataGrid. I now want that same data to put into my custom menu instead of a dataGrid. How would I change the second code to do this?

I think my main question is about the "watername_dg.addItem" in the second code below and how to change that to bring the data into my buttons.

ActionScript Code:
//////////////PULLING DATA FROM AN ARRAY TO BUILD MENU//////////////
var _menuArray:Array = new Array("Apples","Oranges","Pears","Grapes","Limes", "Carrots", "Peas", "Beans");

[Code].....

View 8 Replies

ActionScript 3.0 :: 15 Seconds Delay When Push Or Pull Data From The Database?

Dec 4, 2009

my normal work day involves screen sharing with a programmer while we engineer the software.We are currently working on a site that involves flash .as3(created with flash CS3) talking with an .asmx web service (created in Visual Web Developer 2005) that talks to a sql (2008)database.When can push or pull data from the database successfully, but we are experiencing a 15 second delay if more than one request from the database is made at the same time. i.e. two customers login at the same time, or one customer logs in and another submits changes to their account.

The second request will not be instant until 15 seconds have elapsed In other words, if someone sends logs in and another person logs in 10 seconds later, the wait will be 5 seconds.Of course, the delay is cumulative...so if 3 people log in simultaneously, there is a 30 second wait. Gross.This only occurs when we are trying to access the database...flash and the web service seem to talk great together otherwise.

View 3 Replies

ActionScript 3.0 :: Pull Data From Myspace Page (show Dates)

Apr 16, 2009

I am trying to find a way, if any,to pull show information from their myspace page to show in my flash app.Want to do this using php,but other than that not sure where to begin.

View 1 Replies

Data Integration :: Creating And Saving Data

Aug 20, 2011

I'd like to know if there's a way to take data entered into a field in flash, save it, and call it later via an object.I don't want anyone to walk me through it if there is, that's not what I'm asking. I'm just asking what I need to know in order to do this. I'd like to build a certain flash app that takes information (such as a name, paragraph, and/or sentence) saves it, and can then be recalled when a user clicks a button... even if the user has closed out the application.I'm still relatively new to flash, I know enough to get by on basic projects, but I want to expand my knowledge so I don't end up stuck in a beginners rut.Would this require using PHP and Flash? Or can it be done entirely in flash via exporting data to a designated external file?

View 2 Replies

Creating 10 Functions Using For Loop?

Feb 25, 2012

I am trying to create functions using a for loop for my buttons' over and out listeners.I would like to stick to a naming convention but it does not seem to work. I am trying to create 10 buttons with function names like btnOver1, btnOver2, etc...

Code:
for(var i:int=0;i<=9;i++){
function btnOver[i](e:MouseEvent):void{

[code].....

View 1 Replies

ActionScript 3.0 :: Load A ComboBox With A For-loop To Load K School Names?

Sep 18, 2009

I am stumped. I have tried to load a comboBox with a for-loop to load k school names and can not get it to load dynamically. Here is what works:schools_cb.addItem({label:varLoad.data.school1});It manages to paste the name of school1 into the comboBox k times.Then, when I try:schools_cb.addItem({label:this["varLoad.data.school" + k]});orschools_cb.addItem({label:this.getChildByName("var Load.data.school" + k)});it brings up k blank entries in the comboBox.I am a poor teacher trying to make a signup page for our school's math contest

View 5 Replies

Creating Loop To Set Color Objects?

May 8, 2009

I'm trying to create a for loop to set the color objects outlineColor1...100 to the value defined in variable _root.outlineCol. Everything works fine when I set the color to these objects via 100 lines of code but I'd like to replace them with a for loop of course. I suspect the syntax in the first part of the second line is incorrect but I'm not sure.

for (var i:Number = 1; i <= 100; i++) {
outlineColor[i].setRGB(_root.outlineCol);
trace(i);
}

View 2 Replies

Creating Variables Dynamically Within A For Loop?

Jan 24, 2010

I need to make new sprites on-the-fly within a for loop, and this code does not work:

Code:
for(var i:int = 0; i<5; i++) {
var this['menuBtn'+i] = new Sprite();

[code].....

View 2 Replies

ActionScript 3.0 :: Creating AddEventListener Within Loop?

Jan 14, 2009

Everything works fine except MouseEvent.CLICK addEventListener.menuInfo variable contains part of defined instace name.cURL contains full URL to link.If I trace menuInfo variable, it outputs correctly in order as I exptected.But last event overwrites everything to last element of xList (contains XML list).How do I make this work correctly

Code:
function createMenuEventListener(xList:XMLList):void
{

[code].....

View 1 Replies

ActionScript 3.0 :: Creating Loop In Timeline?

Oct 21, 2009

My master timeline is 128 frames long, I want the timeline to play from frames 1 to 128 once and then from frames 64 to 128 three or four times before returning back to frame 1 and starting the whole sequence again so I end up with a continuous loop that consists of the full animation once and the second half 3-4 times all repeating endlessly. I've been reading about "for" loops and guess this is what I need to use but I don't quite get how to set it up, how I'd set up a counter to count the repeats, and how it would reset etc.

View 5 Replies

Actionscript 2.0 :: Loop Not Creating New Instances

Aug 5, 2010

I'm trying to create a vertical column of images in a mc that can be clicked. I've added listeners to reposition them once they load, but right now they are overwriting each other. I'm not sure how to rename the object and listener vars for each iteration. [code]...

View 1 Replies

ActionScript 2.0 :: Creating Arrays In A For Loop?

Jun 15, 2005

creating multiple arrays in a for loop? This doesn't work :

for (i=0; i<catNum; i++) {
var arr(i):Array = new Array ()
}

[Code].,...

View 7 Replies

ActionScript 2.0 :: Creating Objects In A For Loop

Apr 4, 2007

This piece of code gives me an error because i have an equation on the left side of the equal sign, logically it makes sense, but flash doesn't like the code how would i do some thing like this?[code]

View 2 Replies

ActionScript 3.0 :: Creating Unique TextFields In A For Loop?

Oct 28, 2008

I have a for loop that runs depending on the length of an XML file. What I want to do is create a unique text field for each run through of the loop, and give it it's own position on the stage, and finally assign it the text from an external text file that is specified in the XML file. Everything I know how to do except creating the textfields.

Quote:

for(var i:int = 0; i < blogXMLList.length(); i++)
{
var txtHolder:TextField = new TextField();
txtHolder.x = textX;

[Code].....

This code creates only one Text Field, but then replaces it's text with new text with each run through.

View 4 Replies

ActionScript 3.0 :: Creating Mutiple 'movieclips' In A For Loop?

Jun 15, 2011

I am new to Action Scripting 3 and am struggling to create movieclips in a for loop. Basically I am trying to create a series for movieclips and add these to my stage based on an array of values.

[Code]...

View 2 Replies

ActionScript 1/2 :: Creating A Sound Loop In Flash?

Jun 16, 2011

I found an issue when I was creating a sound loop in Flash. I'm using similar code (here is a short version):

[Code]...

View 6 Replies

Flash :: Creating A Function Within A Loop (pointers?)

May 27, 2010

Im trying to create a simple loop that creates 50 buttons, adds them to screen and then when a button is pressed, it traces out that number. I can get it to work by doing stuff I consider hacky (such as using the buttons X/Y location to determine its value), but I'd rather just be able to hold a single value in the function.

The code itself is:
for (var a:int = 0; a < 5; a++) {
for (var b:int = 0; b < 10; b++) {

[code]........

View 3 Replies

ActionScript 3.0 :: Creating Instances Of A Class Using A Loop

Oct 30, 2010

basically i want to create ten balls on the stage. I have a balls.as file which uses the drawing api to create a circle within it. also within the balls.as file there is a public variable.[code]how would i go about finding out: if you click one of the balls it traces that balls life.

View 9 Replies

ActionScript 3.0 :: Creating Functions With Variables Using A Loop?

Dec 11, 2010

I've created a basic function that sets a movieclip to a certain state depending on which mouse cursor is set (determined by a variable called txt_cursor). I can hard code this to work great for the one single movie clip but potentially have to do this for 624 other movie clips so obviously want to create a for loop to reproduce this.

Code:
chk1.onRelease = function()
{

[code]........

View 1 Replies

ActionScript 3.0 :: Creating Multiple 'movieclips' In A For Loop?

Jun 15, 2011

create movieclips in a for loop.Basically I am trying to create a series for movieclips and add these to my stage based on an array of values.

for (var i:Number = 0; i < product_total; i++) {
product_mc.name = productid[i]
addChild(product_mc);

[code]....

This code works fine to add one but I can't add more instances?Appears addChild not render mutiple instances on the stage.

View 2 Replies

Actionscript 3.0 :: Creating PV3D Textures With A Loop

Apr 28, 2010

I'm trying to create multiple objects in Papervision using Flash Builder, each one with it's own texture that I'm getting from an imported SWC.My code works perfectly if I apply one texture to all shapes, but when I try to put it into a loop I can't seem to get it to work. I think this is more of a syntax problem, I'm just not sure how to tell Flex what I want.Here's a chunk of the code that works fine, applying an "img1" texture to everything: [code]Does that make sense? I want each iteration of the loop to add a number to the end of "img" and apply that to the shape.

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved