ActionScript 2.0 :: AddChild Buttons Pointing At XML Data?
Jan 25, 2009
I have a scroll component that I use to scroll through a long movie clip that loads a list of 3 text fields from an XML file (each item is called Li and some of the fields include a unique bID (b1, b2, b3 etc) pN, Da etc. on XML load I use a loop to populate the movie clip with the primary information fields creating a list of each <Li> Item in the list by showing the first three fields in that item. Now I would like to add a button to each item that allows the user to see the complete information in that list item. This button should either generate a new movie clip (or make a current one visible) and populate that new movie clip with information taken from said list item. What I don't seem to be able to figure out is how does AS3 handle this, how do I either generate or add a button that will know that if this button is clicked it should get the information from the corect XML list item.
View 2 Replies
Similar Posts:
Jan 25, 2009
I have a scroll component that I use to scroll through a long movie clip that loads a list of 3 text fields from an XML file (each item is called Li and some of the fields include a unique bID (b1, b2, b3 etc) pN, Da etc. on XML load I use a loop to populate the movie clip with the primary information fields creating a list of each <Li> Item in the list by showing the first three fields in that item. Now I would like to add a button to each item that allows the user to see the complete information in that list item. This button should either generate a new movie clip (or make a current one visible) and populate that new movie clip with information taken from said list item. What I don't seem to be able to figure out is how does AS3 handle this, how do I either generate or add a button that will know that if this button is clicked it should get the information from the corect XML list item. I hope this makes sense?
View 2 Replies
Sep 16, 2010
I am working on our new website and have purchased an animated flash template. I have very limited experience of Flash and use Dreamweaver as my every day web tool.
I have modified most of the template but have a frustration with some animated buttons pointing to the same page even though I think i have programmed CS5 to point it to different pages. In the middle of each page is 3 boxes which have 3 Read me buttons... each should point to a different page.
[URL]
It has absolutely got me beaten. I have copied the buttons and their animations, renamed all elements of the button but something is clearly linking them together.
View 3 Replies
Feb 22, 2011
I have my Stage. On this I have an empty MovieClip (MC). To begin with I do:
MCContent = new TestMC();
MC.addChild(MCContent);
This works. But in my TestMC, I have another MovieClip Button01, which is named Button01, where I have the code:
Button01.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
function handleMouseUp(event:MouseEvent):void {
trace('Hello World);
}
But when I click on Button01 nothing happens... What am I doing wrong?
View 10 Replies
Sep 15, 2011
I want to make a two buttons one addChild and other removeChild. Here is the example script which my friend gave to me. In other words I want to make a button that attached hair and the other that removes. Should I make a separete custom class for Hair?
[Code]....
View 0 Replies
Mar 26, 2012
I had this problem (Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.) and I followed the recommended solution:
// container ( IVisualElement ) for DisplayObjects
var container:UIComponent = new UIComponent();
addElement( container );
[Code].....
What I need to be able to do, is get the string Locale to be read by the Child swf.
View 1 Replies
Dec 8, 2009
buddy im new in flash as3 im suffering some problem for 1 week i fatch data from xml and addChild of totel nodes of xml i want dynamic scroll bar im triyng.
View 2 Replies
Oct 21, 2010
Does anyone know how I would load up a flex application and on load the application would open on a different tab within the application. The only thing I can think of is sending a parameter into the application to tell it where to go, but how does the app load that tab then?
View 1 Replies
Apr 7, 2008
I've developed a quick video player that pre-loads, auto-plays and then finishes with a frame at the end that allows the user to play the video again, but a recent discovery is that the video reloads as a user browses through a few fields on the site (represent via string at the end of the URL).
What I'd like is that if you arive at index.aspx it starts the video at the preloader, but if you then move onto index.aspx?ID=1234 it goes straight to the scene with the replay function. The AS I'm using at the moment in the first scene is:
if (_url == "http://www.mydomain.com/index.aspx") {
gotoAndPlay("Preloader", 1)
} else {
gotoAndPlay("Replay", 1)
}
but I'm getting nothing from it.
View 3 Replies
May 13, 2008
I have two domains pointing to the same swf. So I have domain "A" and "B" where my swf (site) is hosted at "A". Domain "B" loads site "A".
The swf loads some vars from a DB, when seeing site directly at domain "A" I have no problems, but when seeing with domain "B", my site just freezes....giving an error at the Browser and I have to close. This is for FF and IE.
At first I thought this was cross domain policies, so I have put at my swf the following code:
Code:
System.security.allowDomain("B")
View 7 Replies
Jun 15, 2011
I'm trying to have a class file which can add objects to the stage via addChild; however, when I call addChild from within the class file, I get the error "1180: Call to a possibly undefined method addChild." I've tried importing flash.display.* and that doesn't fix the problem. Does the class file have to extend Sprite or MovieClip to be able to add objects to the stage?
View 8 Replies
Oct 29, 2009
I have a quick newbie question (I just switched to AS3) : I have two clips in the library that are exactly the same in structure, just that the design changes. Two different characters lets say. Now, I'd like to apply a class to them, and that class is going to be 100% the same for both, how can i do to have the two clips pointing to the same class...? For the moment what I did is save my class with another name, but I guess it's a bit lame...
View 5 Replies
Aug 2, 2010
i have an mp3 player that works well but when i click on the loader bar, plays from that clicked part, time is also updated, but the scrubber is way to far from the that clicked part of the loader.how can i make the scrubber points exaclty to part when a user seek from the loader bar?
View 6 Replies
Aug 30, 2004
if you are loading an external swf to a target or container or what have you, can point it to a particuar frame or scene in that swf?
View 5 Replies
Feb 25, 2012
Code:
button.addEventListener(MouseEvent.CLICK, myButtonAction1);
function myButtonAction1(e:MouseEvent):void {
for (var i:uint = 0; i < 9; i++){
var ray:RaySpark = new RaySpark(i*15)
addChild(ray);
[Code] .....
The blue lines should each be pointing at a circle, what did i do wrong?
View 1 Replies
Aug 30, 2004
i was curious, (cause this would help me a lot) > if you are loading an external swf to a target or container or what have you, can point it to a particuar frame or scene in that swf?
View 5 Replies
May 16, 2005
I have a dropdown menu that I'm learning to use from a tutorial. It's just a little over my head and am wondering if someone could help me. Here's my situation:
1) The menu has the title, DESTINATIONS. Submenu dropdown are a list of CONTINENTS. Rolling over CONTINENTS show COUNTRIES. This works.
2) Clicking on a Country should:
A) load an external swf into an empty movie clip :: Works!
B) go to the COUNTRY specific frame within that loaded movie clip. :: Doesn't work!
Here is a sample code from this menu, where it defines the fields that populate the menu:
var menu_0 = ['Destinations',['Africa#destinations1.swf|Rwanda#destinations1.swf |Uganda#destinations1.swf|Kenya#destinations1.swf| Madagascar#destinations1.swf|Botswana#destinations 1.swf',
'Asia#destinations1.swf|Japan#destinations1.swf|In diat#destinations1.swf']]
Could someone help me figure out how to direct the link in the menu in a specific frame in an externally loaded swf? I can do this on a 'normal' button using placeFrame, but because I'm unfamiliar with how this particular menu is made, I don't know how to implement what I know.
View 5 Replies
Jan 16, 2012
I have downloaded Box2d ([URL]) and created a project that looks like this: [URL]. catalyst is the green cube and it has the base class "shapes.box", it is inside "world" which has the base class "wck.World". What i want to do is to add another "catalyst" from the library inside "world" when i click on add_btn. I tried to accomplish this by this code:
[Code]...
Symbol 'buttons', Layer 'Actions', Frame 1, Line 41061: Call to a possibly undefined method addChild through a reference with static type Class.
View 9 Replies
Dec 30, 2009
I have used the simple script below on several Flash animations to restart the movie by clicking on the last frame. It works fine, but does not show the interactive cursor (the pointing hand). How can I alter the code below so that the browser shows the hand when the visitor moves the cursor over the paused movie?
stage.addEventListener(MouseEvent.CLICK, function(){ gotoAndPlay(1); });
View 5 Replies
Sep 12, 2007
I'm trying to make a real simple flash menu, and I am using the "Squirrel Finder"-tutorial as a base. Problem is, when I trace my variables desc and swfURL they are correct, and the numbers on the buttons work fine as well, only when I click on the buttons all of them point to the last post in my XML, i.e., buttons 1,2,3,4,5 all point to swf 5.
Code:
function skapaMeny(menu_xml) {
var proj:Array = menu_xml.firstChild.firstChild.childNodes;
for (var i=0; i<proj.length; i++) {
var desc = proj[i].firstChild.childNodes;
var swfURL = proj[i].firstChild.nextSibling.childNodes;
[Code] .....
View 2 Replies
Jan 20, 2011
I have the followings:
_p:Player (which is a MC)
a1:Animation1 (which is a MC)
_p.addChild(a1); //doesn't display anything
_p.stage.addChild(a1); //displays a1
Why won't the MC display a child without using his stage?
View 1 Replies
Aug 11, 2009
I'm trying to resolve an issue that reared it's ugly head yesterday.Frame one of main timeline I have the following code:
Code:
import flash.display.MovieClip;
import flash.events.MouseEvent;
[code]....
The newMC doesn't show up.If I add 'parent.' in front of the addChild then it appears.mc_LibItem has a base class of "flash.display.MovieClip" and is exporting for ActionScript and on frame one.For grins I created a new .fla and began messing around with the same addChild idea and it worked.
View 14 Replies
May 1, 2002
Way to stop the pointing hand cursor from appearing when the mouse rolls over a Flash button?
View 13 Replies
Oct 30, 2005
somewhat understood the basics of adding and removing children, however, I am facing another problem. After using the removeChild Function, I can't seem to add another child.For example:
ActionScript Code:
var attachedMC = new (getDefinitionByName("Content1") as Class)()
Page.addChild(attachedMC);
[code].....
View 3 Replies
Jul 29, 2009
I have a main "shell" swf which, by clicking several buttons, will load/unload various external swfs into a Placeholder_mc which resides on the main timeline in Shell.swf In the documentation and tutorials I've seen a couple different methods, and I'm not sure I quite understand the difference, or at least the reason you would use one over the other...In the 1st method, you can just add the Loader object using the addChild() method:
Code:
var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);
Placeholder_mc.addChild(myLoader);
This will apparently add myLoader to the display list once it has completely loaded.The 2nd method, you supposedly can add the Loader.content; however, it appears you can only do this once the content has completed loading, so you need to incorporate an event handler with the contentLoaderInfo object:
Code:
var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);
[code]....
What are the pros/cons of adding the entire Loader object, as opposed to the Loader.content and vice versa?
View 7 Replies
Jan 2, 2004
If I have a movie clip that has an onRollOver event, how do I turn the back into a pointing cursor from the gloved button cursor?
View 2 Replies
Mar 9, 2009
I suspect I'm doing something silly here. Keep getting a #1009 error pointing towards the fadeOut function on frame 2. Here's the scoup, TIA! Frame 1: Clickable Logo that sends the playhead to frame 2
[Code]...
View 3 Replies
May 25, 2004
normally the mouse pointer is the arrow.When it's over something with an on(press) event or some such, it turns into a "pointing finger."
Is there any way to force it to change to some other icon?Specifically, I have a draggable movieclip that I'd like to control with a "grabbing hand" pointer, but Flash insists on making it a "pointing finger,"
View 12 Replies
Sep 24, 2011
i have a orgin server and 2 edge servers and a load balancer
first off im confused in each edge server i set them to be remote, rtmp and changed the routeentry to <RouteEntry>*:*;96.44.***.***:1935</RouteEntry> on both servers
orgin server is just local
what my question is im streaming to orgin and its getting sent to 1 edge and other edge is doing nothing no traffic the stream i set it this way url:
'rtmp://173.254.***.***/live/live_test',
which is the 1 edge thats working if i setup another channel pointing to the other edge server ip adresss it doesnt work.. what am i doing wrong isnt all this supposed to be load balanced or am i missing steps...or did i do it wrong on the flash player config.
View 10 Replies
Jun 12, 2007
I have built a flash movie, ASP page to declare the variables, ASP page to show the flash movie and connected to a database. In the ASP page I have the following code.
[Code]...
View 1 Replies