ActionScript 3.0 :: Loading Buttons URL From XML?
May 5, 2010
i would like to load external URL to my flash buttons from XML but no idea how to do it. There is 100 buttons. Buttons have unique names and i need to load url from xml to each button by the name of it and on click action go to this url. Any idea ?
button is s01, s02, p01, p02...... then i need address from xml with this name to load
<nodetop>
<address s01="some url here"></address>
<address s02="some url here"></address>
</nodetop>
my AS3 for now is this but dont know what to do next :
addEventListener(MouseEvent.MOUSE_OVER, loadname);
function loadname(evtObj:MouseEvent){
var btnname:String = evtObj.target.name;
[code]....
View 1 Replies
Similar Posts:
Oct 28, 2008
I am pretty new to Flash and AS3. I built a Flash site that loads external XML data that auto loads with each page containing it.url...On the second page "Wines", as you can see, the white wine list auto loads just fine. But I cannot get my actionscript to load the XMLs from the buttons on the right (ie: whites, reds, dessert, champagne) [code] Also, as of right now, in the script I have the wines (fom said XML list) pop up in a new window (go click one to see). But it pops up in a new browser instead of a "popup". This is because I could not find a way to combine the java script with the XML in the actionscript to specify the new window(parent). I would rather it just load into the box (movieclip) dynamically, but I could not get that to work either.[code] Not even my intro Flash teacher can help me nor is there a tutor around either. Im kind of in a bad
position. Its just a matter of finding a person that knows Actionscript! No one knows it well enough in my class to help. If you know of a tutor who has an hour of time, I would be forever in debt. We can chat via AIM & send the raw files even.
View 1 Replies
Sep 6, 2009
I just spent 3 days making a drop-down-button-menu. It looks great.I added it to the HTML of my website, but everytime you load the page, you have to download the ActiveX control...How is it that people have drop-down-button-menus that are flash-based, yet they don't make you download the ActiveX control? Should I just scrap my buttons and try to use CSS, or HTML, or Javascript?
View 1 Replies
Oct 18, 2011
I was wondering if anyone could help me solve a problem im having with loading swf's into a swf with buttons. this is the code i have so far:
ActionScript Code:
import flash.ui.Mouse;
var _swfLoader:Loader;
var _swfRequest:URLRequest;
var _swfPathArr:Array = new Array("00.swf","01.swf","02.swf");
var _swfClipsArr:Array = new Array();
[Code]...
This code all works but when it loads the swf you can still press the other buttons which then load in the appropriate swf's. My problem is that i want the user to press the button, lets say "portfolio_btn" which loads in an swf called "01.swf" and for the user to not be able to press any of the other buttons until the "01.swf" has loaded and the same for all the other buttons loading in swf's.
View 7 Replies
May 24, 2009
On the stage I have buttons that should load different swf. Usually I should put all the code on a single "action" layer. But, it is not what I want to do I have a movie clip that I want to play before the loading ( button click - movie clip - loading the swf).
So I put this code at the en of the movieclip:
var mLoader:Loader = new Loader();
var swf;
var mRequest:URLRequest = new URLRequest(swf);
function startLoad() {
mLoader = new Loader();
[Code] .....
View 1 Replies
Sep 18, 2009
I wanted to make each button load an swf.How do I connect a button to loading a swf?
contentButton1.addEventListener(MouseEvent.CLICK, N);
function N(e:MouseEvent){
var request:URLRequest = new URLRequest("N-Infant.swf");var loader:Loader = new Loader()loader.load(request);addChild(loader);
View 2 Replies
Jul 25, 2011
I animated 4 flash buttons in one .fla file. When you rollover each button, an animation should play. However, when I preview the .swf in Dreamweaver, the rollover buttons only work HALF the time. I tried putting a preloader on the .fla file as well as toggling the quality to low in the original .fla, but it still only works half the time?
View 1 Replies
Mar 27, 2009
I'm learning AS3. There are two buttons converted to MC inthe library. Their class linkage names are: next_bt1 and back-bt1.I have a PesticideEducation.fla and PesticideEducation.as onthe same folder.Here is my code, which doesn't report any error but thebuttons don't show on stage.me find the error on myscript.
package {
import flash.display.MovieClip;
public class PesticideEducation extends MovieClip
[code].......
View 3 Replies
Sep 17, 2011
create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked.What I don't understand is how to pull the swf or image file from the file like I have with the text. Truth be told, I'm completely lost and could really use some help fixing this. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
ActionScript Code:
var pageXML:XML;
//Load the XML file.
var pageXMLLoader = new URLLoader();
[code]...
View 0 Replies
Dec 12, 2011
loading a SWF file and then removing it with the use of buttons. It's a fairly simple situation, but I just can't seem to get it to work.
Here is the code:
function newvid(event:MouseEvent){
var tv_loader:Loader = new Loader();
tv_loader.load(new URLRequest("tv.swf"));
addChild(tv_loader);
[Code]....
The scene basically says click on button and tv turns on...but I can't seem to get the off button to work. I think I am missing a step some where in the code.
View 5 Replies
Sep 17, 2011
What I'm trying to do is create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked.
What I don't understand is how to pull the swf or image file from the file like I have with the text. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
Code: Select allvar pageXML:XML;
//Load the XML file.
var pageXMLLoader = new URLLoader();
pageXMLLoader.load(new URLRequest("scripts/xml/content.xml"));
pageXMLLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlIOErrorHandler);
[Code].....
View 2 Replies
Sep 5, 2006
I am working on a dynamic menu for a client. This is my first time creating a menu loaded from an xml file. I have the basics down, but am hitting a brick wall. I will have six buttons that are attached at run time, and will be labeled according to the button names in the xml file. Eventually these buttons will be rotating in a circle, but I'm just testing the functionality at the moment. I tried searching through the forum, and didn't find anything that resembled what I am trying to do. To start off here is the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<button buttonName="Home">
<content contentTitle="Home">[code].............
I have been able to trace the attribute names from the xml file, but textbox's from the dynamic buttons are not being labeled. They are coming up undefined.
P.S. This is the flow of how this project will take place: Load external xml file into Flash.Loop through elements to define the button label names.Create a loop to attach a movieClip at run time into a holder clip named "mcCircle".Label the dynamic text field in each new movieClip with the label names from the xml file.Arrange the movieClips on the stage in a circle movieClip.Rotate the circle movieClip clockwise using trig: sine and cosine. Set a speed and velocity variable to the circle movieClipWhen the mouse moves Over a button, have the circle movieClip slow down it's speed to a stop.When the mouse moves Out of a button, have the circle movieClip speed up to it's normal rotation speed.When the mouse clicks on a button, have the circle movieClip shrink down and move to the lower right corner of the stage.Tell Flash to load the content from the xml file (of the button label clicked) to a dynamic textfield on the stage. When the user is done reading the content they will click on a button to clear the text field, and bring the menu back to center, and original size.
View 4 Replies
Nov 5, 2009
I got this tutorial about external movie loading. It works but it seems that their is a little problem with it. How do you keep the button from loading an external movie once it's loaded already?
[URL]
Let's BUTTON-1 loaded MOVIE-1, now when you click on BUTTON-1 again it will load the movie even if it's loaded. How do you do it like only when another button is clicked will it load the movie for that button.
View 2 Replies
Sep 26, 2003
OK on my main timeline i have 2 buttons each one loading 2 seperate SWF's. When I load the first SWF it works perfect. Now when I load the other SWF. on the same level it replaces the 1st SWF. Now comes the problem, when i go to reload the first SWF the error accurs. "256 levels of recursion were exceeded in one action list. This is probably an infinite loop. Further execution of actions has been disabled in this movie."
I understand the concept of the error. I just can not fix it. Is it a matter of having everthing on one SWF. file. Or is there an unloadMovie script I can use.I found this script from Actionscript.org. Posted it there...but didn't get ther help i needed.
[Code]...
View 4 Replies
Mar 8, 2004
There is a button in my library say mybutton_btn.I want to dynamically create an instance of it add it on stage something like insName=new myButton_btn();. How can this be achived?
View 7 Replies
Jun 30, 2010
I have 7 buttons on my main page, on the left side of the screen. I want the buttons to load the external swf on the right, and then unload when a different button is pressed. Do I need to make an array? Do I need an empty movie clip to load each swf into?
[Code]...
View 20 Replies
Aug 17, 2009
Flash CS4 Actionscript 2.0 internal training project Main movie is a single frame project, containing just the interface. This includes a menu listing 80+ individual "chapters" for the training series. Each "chapter" that loads is its own project/swf of varying lengths. Once the main interface loads, it should automatically begin to play the chapters sequentially without the user selecting anything from the menu. When one chapter finishes, the next should load. If the user DOES select a chapter in the menu, it should load that SWF, and continue auto-playing from that selection forward.
- Each chapter swf has a built-in play/rewind/ff bar, various movie clips with animations, dialogue audio track and a fairly lengthy embedded FLV movie, and therefore a preloader before each chapter is mandatory.What I have so far works, but it's embarrassingly crafted my lack of AS skills:- First frame of main interface movie (let's call this main.fla) contains the following code:
var slideName = "modules/00.swf";
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
[code]....
View 0 Replies
Nov 30, 2009
Basically I have a site that will load an external .swf for each menu button to display the content for each page. I have found tried several methods to do this and all at least create a loader and display the default .swf without problem.
Heres the code...
***start code***
stop();
var xPos:Number = 0;
var yPos:Number = 125;
[code]....
My problem is I am getting the following error:
"1120: Access of undefined property event. var newSWFRequest:URLRequest = new URLRequest(event.target.name + ".swf");"
Now the buttons I have set up are text converted to a button. Not sure that matters as I have seen other instances where people create an object (retangle) covert that to a button and put the text inside of that as an instance of the retangle. I have even created a new .fla with just a single button creates with a retangle and the text as an instance of that and still get the same problem.
View 2 Replies
Sep 2, 2010
I would like to play out a movie that has been loaded (if it has been loaded) when another button is clicked.
It is my understanding, I can do this by adding AS to the SWF file at the point I want to play it out (labeled "init_out") and variables to my base file.
Summary:
btn_GD
btn_IL
btn_CN
btn_CN plays a transitional animation ("init_in") which changes the base of the scene.
Once btn_GD or btn_IL has been clicked btn_CN needs to play ("init_out") in an external swf to return the scene so they can play their movies, which are also external.
My second problem is (on a different button), I have a loaded Movie Clip which unloads itself, but once it is unloaded I would like it to show another (internal) and/or a static page.
This is a transitional animation which plays and it does not go to another scene, but shows a different "flat" of the file which contains buttons returning one back to the main scene.
Though it's exeternal I'm not opposed to having that movieclip remain up as long as I'd be able to have it click and return back to the main menu section.
Summary: btn_CT needs to both load an external SWF, unload said SWF, and arrive at mc_CT.
View 7 Replies
Jun 21, 2011
So I want to do saving and loading for variables. I.E. I want to save a variable by pressing the save button. When you use the "load" button, the variable is what it was when it was saved. I've tried this but it didn't work...
Code:
//Code on the frame
var saveState = SharedObject.getLocal("Cookie");
//Code on the save button
on (release) {
_root.save.gotoAndPlay(2);
savefile.data.blah = _root.blah;
savefile.flush();
}
//Code on the load button
on (release) {
gotoAndStop(3);
_root.blah = savefile.data.blah;
}
View 3 Replies
Feb 27, 2006
I am using the tutorial about dynamically loading images, that then fade when a button is pressed and change to the next image, however I want to load the images and have them fade in and out without pressing anything i.e. an mc that rotates the images, fading them in and out.
The script I have been using is this:
[Code].....
View 6 Replies
Jun 23, 2007
I encountered a strange thing when experimenting with attachMovie. So, here's the deal: 2 button, 1 mc_colder. Each button onPress loads a different MC into the holder ( mc1 and mc2 ). Beside those 2 buttons that load the 2 MCs i have 2 more buttons that should remove the loaded MC. Nothing bad until now, loading, removing works fine, but a problem occurs if I click one of the 2 loading buttons twice.. Example: I pess the first buttons once, and loads mc1, i press button 2, loads mc2, i remove both mcs, now, i press button 1 again, loads mc1, i press buton 1 again ( and it should load the mc again or do nothing ? ) but when i want to remove this MC it won't. How can I fix this? Or how can I tell flash not to attach the MC again, once it has already been loaded? I tried a few tricks but nothing yet. I'll keep experimenting with it.
View 3 Replies
Mar 20, 2008
I have been racking my brain with trying to convert [URL]../blog/distortimage into as3 im am very unfamilier with flex so I have become somewhat stuck can anyone I have set the buttons for transform and loading the image but its just not working at all.
[Code]...
View 7 Replies
Mar 18, 2009
I'm trying to do a site with multiple videos, and I figured that instead of adding frames with new instances of the Playback component, it would be nice if I could get it working by just passing some actionscript to the component on the click of a button.
Here's what doesn't work:
Code:
on (release) {
_root.videoPlayer.loadMovie("Videos/theVideo.flv");
}
videoPlayer is the name of my Playback component. This does cause an interruption, as the video that's currently playing disappears, so it appears it's at least trying to load it, but it certainly won't play that video.
View 1 Replies
Jan 21, 2012
started programming the menus for the game im working on. Everything shows up ok so far but when i select the buttons rather than it loading the next part, its going to a black screen? Does anyone have any suggestions? My code for the MainMenu is as follows:
package
{
import flash.display.MovieClip;[code]....
Then the "game" is another class which is loaded when you select to play the game.
EDIT: Forgot to mention, i have images loaded that are converted to movieclips and named the same as the class so that they display as the background. The main menu image works fine, just not the game background.
View 2 Replies
Sep 3, 2004
whats up with the scrollpane.Ive got it loading my swf files into it but for sum reason u can press the buttons even if theyre not showing. see below see the button on the top left how it is darkened, this is the over state, but the mouse isnt actualy on the button, its above the scrollpane area, but its still being selected and is able to be clicked.
View 3 Replies
Jun 27, 2009
I am working on a website, its a project, I built custom buttons and used there own AS3 to make them play on hover. There is one problem thou, in my main scene or timeline I created this function:
about_but.addEventListener(MouseEvent.CLICK, function(){
var aboutURL:URLRequest = new URLRequest("about.swf");
})
contact_but.addEventListener(MouseEvent.CLICK, function(){
var contactURL:URLRequest = new URLRequest("contact.swf");
})
cat_but.addEventListener(MouseEvent.CLICK, function(){
var galleryURL:URLRequest = new URLRequest("catalogue.swf");
})
port_but.addEventListener(MouseEvent.CLICK, function(){
var portURL:URLRequest = new URLRequest("port.swf");
})
Ok but it had the navigatetoURL function but I took it out. Reason is because I want these buttons to load in a movieclip (mc_loader) as external swf files. I am not sure as is to linking these buttons to the loader movieclip.
View 9 Replies
Aug 17, 2009
- Flash CS4 Actionscript 2.0 internal training project- Main movie is a single frame project, containing just the interface. This includes a menu listing 80+ individual "chapters" for the training series.- Each "chapter" is its own project/swf. Once the main interface loads, it should begin to play the chapters sequentially without the user selecting anything from the menu. When one chapter finishes, the next should load. If the user DOES select a chapter in the menu, it should load that SWF, and continue auto-playing from that selection forward.- Each chapter has a built-in play/rewind/ff bar, various movie clips with animations, dialogue audio track and a fairly lengthy embedded FLV movie, and therefore a preloader before each chapter is mandatory.What I have so far works, but it's embarrassingly crafted:- First frame of main movie (let's call this main.fla) contains the following code (most of this code was taken from an online tutorial):
var slideName = "modules/intro.swf";
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
[code].....
View 1 Replies
Aug 14, 2010
I am going out of my mind trying to get this to work. I can do it in AS2 without a hitch - but not AS3. I just need to load an external swf file into an empty movieclip. Then I have 2 buttons play and pause that need to be on the top layer of the new movie and they need to play and pause the loaded swf file. I have tried a number of things and nothing is working.
View 1 Replies
Sep 17, 2011
Okay, here goes: What I'm trying to do is create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked. What I don't understand is how to pull the swf or image file from the file like I have with the text. Truth be told, I'm completely lost and could really use some help fixing this. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
[Code]...
View 1 Replies