ActionScript 2.0 :: Adding Multiple Text Descriptions - XML
Oct 18, 2010
URL]
What I would like to do is add a paragraph of text describing each photo in a different text field. Im not really sure how I would do this. I assume I would add another txt field in flash and set it to dynamic. I would then give it an instance name. Im not sure how I would implement it into the xml or AS though. I know its quite simple but ive been trying for awhile now.
ActionScript Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
[Code].....
View 2 Replies
Similar Posts:
Oct 21, 2010
I have a gallery page that has a UILoader Two buttons (back/next) and a Dynamic Text box.
When UILoader pulls in the new image i want to populate the text box with the description of that image. I have got the code working to pull the external text in the first time you go to the page but cannot figure out what to do to make it call the function and pass the right argument every time you click the next or back button.
Attached is my code.
var imageNumber = 1;
var textNumber = 1;
var loader:URLLoader = new URLLoader(new URLRequest("images/description"+textNumber+".txt"));
[Code].....
View 1 Replies
Aug 29, 2007
I used this code, from "Creating Websites for Dummies" to create a video playlist. The only problem is that it (the book) doesnt show how to load descriptions for the video thumbnails (saying the title etc...of the video). I cant work out how to attach a dynamic text field to each thumbnail that reads its description from an xml file, can anyone give me some pointers or explain how this is done? I've been stuck on this for a few days now and i cant work it out..
in the code below 'main' refers to an attribute in teh xml file.
Code:
ar nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
[Code].....
View 1 Replies
Oct 4, 2009
i have an application in which i have around 100 textinputs all are numbers
i want to simplify the addition ie. any other way than saying txt1.text+txt2.text.....
that would increase my code a lot
is it possible to have (n+=txt*.text) or some thing like that
View 1 Replies
Aug 29, 2011
I would like to display an items description when you "roll over" the item with the mouse (you know how a little box pops up under the mouse icon). Is there a way to do this?
View 1 Replies
Jun 8, 2009
on my stage are 5 buttons, each with the name of a product. i want to be able to hover over each product and see a Description of the product with a "learn more" link at the bottom of the description. the problem is that i want the Descriptions for each product to appear in the exact same place.
if the hit area of each button covers only the button itself, you can't click the "learn more" link because it disappears when you move off the buttonif the hit area of each button covers the Description area, the hit areas overlap each other. this causes the Description to always show the same thing (i think it is the Description of the last button i added) if you are hovering over anything besides an actual button.
View 6 Replies
Feb 20, 2007
I'm trying to do build some kind of photogallery, with movieclip loaders, but instead of having only one movieclip to load each image, I want to have a lot of movieclips to each load one image (so it increases se loading speed), and I want it to slide, so I have one movieClip, named Main, which holds numerous movieClips (it's not a movieclip loader, but each movieclip inside Main movieclip will be a movieclip loader), I have two buttons, one to go further, and one to go back.
What I want to do is, basically, that once we click on one button, for example the next button, the code tells "go inside Main movieclip and display the next movie clip" (for instance if we're on the number 1, go to number 2) etc ... So I thought I could give the movieclips inside the main movieclip a generic name, like n and n+1 (or n-1) and create variables but I don't know the syntax and to be honest how I really have to do it (I know how to declare variables, functions, but it's useless because I don't know how to describe it so it's understandable by flash).
View 7 Replies
Mar 30, 2010
IM trying to load an XML file with images and their descriptions and titles however when i attempt to trace the length of the XMLList, it displays as empty. heres the code.
[Code]...
View 5 Replies
Nov 12, 2009
I have completed the Carousel part 3 tutorial and everything is working perfectly. However, I want to add a link to an external url in each of the detailed descriptions. How would I add this to the xml file?
View 2 Replies
Apr 7, 2011
I am busy converting my online digital portfolio from AS2 to AS3. I have made a new .fla and placed within it only the elements that relate to my question, to greatly simplify things so it is easy to see what I want to do.Lets say I have 3 movieclip buttons, which do three things when hovered over :
1. play a shine animation
2. move slightly
3. cause a tooltip description to appear / fade in, somewhere else on screen.
When mouse moves off, the above 3 things revert to normal and the description fades out.These buttons serve to show a description of the relevant project in my projects folder (project1.html, peoject2.html and project3.html, for demonstration purposes), and to link to them when clicked. The point is that I am trying to do this dynamically, so I have one movieclip(called descriptions) that contains all the descriptions each on its own frame, and use something like
//pseudocode
when button 1 is hovered over, descriptions.goToAndStop(1);
It is difficult for me to explain - but if you just run my swf and also take a quick look at my code (its not a lot) you will know exactly what I am trying to do.
In summary: Basically if you run my swf, you will see 3 buttons. When you hover over each, they are all saying Description 1, but I want button 1 to show description 1 and button 2 to show description 2 etc.Key items / code to look at inside the .fla are :
1. the first frame on the main timeline, actionscript layer - the code
2. the descriptionsHolder movieclip on the descriptions layer
3. the projectDescriptions movieclip inside the descriptionsHolder movieclip
4. the dynamic button (double click any of the buttons) - this is the idea I want for the descriptions too, its a reusable button that has the label 'button1' on all 3 buttons but with some code - the labels change at runtime to button1, button2 and button3.
5. the code inside the dynamic button movieclip on frame 1, actionscript layer.
6. note the buttonLabel movieclip inside the button movieclip, same thing I want done for the descriptions.
6. Also to please note, my code for linking each button to a project (not working)- that I also want to be a reusable function, for assigning a variable to contain the link for the dynamic button, depending on which instance of it is clicked -> go to either project1.html, project2,html or project3.html. I am trying to 'think like a programmer' and use modular, dynamic stuff, but it seems I am having trouble assigning variables or individual frames at runtime to multiple instances of the same dynamic movieclip.
View 3 Replies
Mar 2, 2011
As the title states, I need to know how to save multiple text files, from multiple text boxes on the screen. Each textbox has the instance name of t1, t2, t3... and so on. Here is the code I have now:
[Code]....
View 3 Replies
Apr 25, 2011
I am still using flash MX. I'm pulling random text from a textfile (array.txt) into movieclip instance textbox.[code]All is good, but now my question is if I can have a text effect as well. For example having the random quotes typed out as they appear.
View 16 Replies
Sep 8, 2010
I'm building a calculator of sorts and have about 7 input text boxes (input text chosen) that users can enter numbers. At the bottom I have a calculate button that adds all of the numbers users have input into the boxes. The answer goes into a dynamic text box. It all works fine expect if a user does not enter in a number in one or more of the boxes. In other words, users would have to input a number in each box for it to work, I don't want that.Here is the code on the calculate button:
TransportationTotal = Number(Limo) + Number(SUV) + Number(HorseCarriage) + Number(Boat) + Number(Helicopter) + Number(LuxuryCoach) + Number(LuxuryCar) + Number(TransportationGuests);
}
whereas the names in brackets are the var assigned names. Do I need to declare the var's beforehand? Tired this and did not work.
View 2 Replies
Jun 16, 2009
I've got a long list of similar movieclips I'm adding to the stage. There's 9 in total and the code looks like this...
stage.addChild(zone0_mc);
zone0_mc.x=267.6;
zone0_mc.y=120.5;
[code].....
View 3 Replies
Sep 30, 2009
I have 60 pictures- set sequencially in frame by frame animation.I would like to enter them (imported or from the library- whatever works) into the timeline one picture per frame (or keyframe) so when I can hit play and see the animation.
View 1 Replies
Jun 3, 2010
I have entered the following code and both items do import, but i cant control the label of the second library item called "Cool"After doing some digging, i think i found out the class name of the second object was called "Cool" and the base class was "import flash.display.SimpleButton;" so it looked like i had to import that class at the top like i did! But still not working. and still no joy!I think i need to add in "public class Cool extends SimpleButton" so it inherits the SimpleButton class after the first public class and then create a new function called "public function Cool() " and then add the function body but when i go to do that it all goes wrong. Am i on the right track or am i missing a trick!!
package
{
import flash.display.Sprite;
[code].....
View 3 Replies
Jan 25, 2012
I just started recently using more of AS3.All of our previous banners were in AS2 (before my time here) so I just continued to work within that.I am on a Mac and using Flash 5.5.However, I am now creating some new banners in AS3 from scratch.There are 6 total clickTags on the banner that we track.There is an invisible button over the entire banner that stays on there to a specific keyframe and has a clickTag.Then, at the very end there are 5 text buttons each with a clickTag.
When I test it in Flash 5.5 it plays fine but gives me the following warning under the Output tab:WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.I have done some research and keep seeing that I need to place the actions on separate keyframes.What code do I use and does each clickTag need to be on it's own keyframe?Below is the general clickTag code we have been using but the banners are in AS2.
on (release) {
getURL(_level0.clickTag2, '_blank');
}
View 4 Replies
Aug 20, 2009
what I want is for the text area box to be added the same amount of times as there are nodes in my xml file (currently 5)So, I'm trying to add 5 textboxes to the stage.Whenever my loop fires this
Code:
//make titles
var songTitle:TextField = new TextField;
[code].....
View 5 Replies
May 23, 2010
Adding frames across multiple layers...that's what I want to do. I do not want to add frames one layer at a time if I can help it as I have a good 20 layers going and I'm bound to miss one or something. Now if I am in a tween layer adding frames I know what that does...but it will add more frames of what ever is going on at that point in that layer...right? (Ex. empty space...you will be adding more empty space...next layer has a tween...you are adding more tween...right?)
View 1 Replies
Dec 23, 2009
in my Doc Class I am trying to load in multiple MCs onto the stage which come from a class held in the library ...I get an error whilst trying to name them .. perhaps it too much of an AS2 way?ps code is only a snippet of the problem..
Code:
for (var m:uint = 5; m > 0; m--)
{
[code].....
View 2 Replies
Jan 19, 2011
I have seven movieclips lets say from mc1 to mc7 they all have their respective classes Mc1 to Mc7
is there a more efficient and faster way of adding them to the stage then declaring and addChilding them one by one in the code?
View 2 Replies
Oct 2, 2009
I am doing a flashlite project (AS2) for an embedded application and am having trouble figuring something out. I want a single instance of a menu button that I can move with keyboard cursor presses to specific locations on the Y axis. Figuring out that part was easy but I am stumped on adding multiple commands to the same button.
The initial script I am working with is:
on (keyPress "<Down>") {
import mx.transitions.Tween;
import mx.transitions.easing.*;
var xPosT:Tween = new Tween(high, "_y", regular.easeOut, -234.8, -186.8, 6, false);
}
[Code].....
To tell it that if the button is at -186.8 go to -135.6. So obviously I am having trouble using keyPress "<Down>" twice. What would be the best way to approach this? I would like to have numerous keyPress "<Down>" and keyPress "<Up
View 12 Replies
Dec 6, 2009
I'm trying to apply a tween fade in effect to 3 objects, it's hard to explain but here's what i have
function goDown2(e:MouseEvent):void {
var tweenfadeIn:Tween = new Tween(graphic_btn, "alpha", None.easeOut, 0, 1, .1, true);
[Code]....
I wanna apply this tween to illustration_btn, and resume_btn
View 3 Replies
Nov 23, 2010
In CS5, I want to create a series of buttons that when clicked will linked to other frames in the same timeline. So one button will link to frame 5, one will link to frame 10, one will link to 15, etc. All the buttons will appear across the top of the stage on a layer, and I want them to appear on all of the frames so the user can click back-and-forth to the different frames/screens.
1. Is the best way to do this to just add the buttons to frame 1 and add a keyframe to the last frame in the timeline, frame 15, so they are copied to all the frames in between?
View 4 Replies
Feb 6, 2011
I made a flash banner + have photo creds on each photo. I want to make it a link to source to the photographer's portfolio.I've got 5 links for 5 buttons, button1, button2, button3, etc, each is named in the library with a matching name for the instance.I got the link working for the first image, but whenever I try and do it for others I keep getting a message of [code]
View 1 Replies
Dec 17, 2011
I have a problem creating multiple mc's and adding multiple images inside each mc.This code will add all the images inside last movieclip.
Actionscript Code:
for (var i = 0; i<myXML.box.length(); i++) { var _box = new box(); _box.name = "box"+i.toString(); _box.y = _box.height *i + 200; mcArray[i] = _box;
[code]....
View 2 Replies
Jun 3, 2011
I am building a Custom Image Picker, that shows 6 alternative versions. However the photo is only showing on the 6th item.
_model.selectedPhoto returns a Sprite, and does not let the app function correctly.
However when I use _model.photos[ii], A photo is added to each item - Why is this? I need to add _model.selectedPhoto to each s:Sprite
for (var ii:int; ii < 6; ii++)
{
//Create BG
var s:Sprite = new Sprite();
[Code]....
View 2 Replies
Apr 2, 2009
I am working on application similar to [URL] how to add multiple clipart to the center rectangle. I can add one clipart but then adding second clipart/image replaces the first one.
View 1 Replies
Oct 17, 2009
i'm trying to add movieclips to a single mask. but i cant seem to get it to work.
is there a easy way to do this? or do i have to remove the mask-child and add a new one again?
View 2 Replies
Mar 7, 2012
Basically I have 5 movieclips I want positioned around the stage. So I figure the best way to this is with a for loop. However the way I've coded it doesn't appear to add new movieclips and seems to just move the first movieclip 5 times and it always ends up with an x of 169. Here's my code:
Code:
for (i=0; i<5; i++){
var barName:MovieClip =
_root.game.attachMovie("butSquare","r1wBar"+i,_root.getNextHighestDepth());
[Code]....
View 1 Replies