ActionScript 3.0 :: Load Different Swf Files Depending On Button?
Apr 13, 2009
im starting to get the hang of 3.0 now.. but i have a little problem loading different swf files related to witch button i click..
everything works just fine. when clicking on a button the movie plays and its listening for the end of each video playing.. but i cant get it to load different swfs depending on witch button is clicked. is it possible to do this using the same loader as i do now?
heres my code:
var compact:String = "axesse_mc.swf";var compactreq:URLRequest = new URLRequest("axesse_mc.swf");
var loader:Loader = new Loader();loader.load(compactreq);
I also have two different simple XML files, each would only be a single column of data, lets say they're called file1.xml & file2.xml I have 2 buttons, and I want to be able to click button 1 and load the data from file1.xml into the datagrid and have its column of data displayed, same for button 2 and file2.xml.
I want to load 2 swf files with a single button click. I'm currently using 2 different functions with different loaders and I call both functions with the same button, but I get error 2025.
I'm making my own site, and want to have all text available in four languages,interchanged by clicking on a flag button (English as 'Home' language). The main navigation tool to move between the site's pages is Lee Brimelow's carousel (3) from this site with a couple of minor changes. I was hoping to load the text for the tooltips and dynamic text field associated with each selection from the carousel from different XML files - one for each language.the only issue is that this solution only allows for two XML files to be loaded, and I can't figure how to allow for four different languages (XML files) using the same method. Can anybody please advise me how to change the AS code below, or should I look at a different way to load multiple XML files?[code]
I need to load 2 swf files with a single button click. I'm currently using 2 functions, but I get: ArgumentError: Error #2025: The supplied Display Object must be a child of the caller.[code]because I tried to load everything into a single function and when I used two functions I got error 2025.What code should I use in order to load two swf files at the same time, with a single button click?
I have created a button in flash 8 to act as a play button for mp3 files on a website in drupal. I however am having trouble, since am new to ActionScript, to make the button load an external mp3 file without hardcoding it in the flash.
I need to load a SWF depending on a parameter in the URL ... how do I do in order to make flash recognize the RUL parameters? For example, I want that: [URL] load the index.php with an animation for utah, [URL] load the index.php with an animation for texas, and so on... how do i achieve this?
i want to have an swf loaded between 8am and 6pm and another one between 6pm and 8am. How can i do that? i guess it's not very hard but i don't get it. i suppose i need a variable with the hours. then do a if statment that check if the current hours is between 8am and 6pm. then if it's between this time do this if not do that..
I have a MC which when user presses a button slides onto the screen. Within this MC is a number of buttons, with names like 'btn1', 'btn2' etc.I have already searched around and found a tutorial which shows me how to load images from an XML file.What I'd like to do is for each button in the MC, find the corresponding XML element and then load those images, then move onto the next button, until they are all done.So I'd imagine the XML would be something like:
Preloader hanging / freezing with "hiccups"I'm trying to do the following. I have a menu with 11 buttons and a xml. The user can select multiple buttons and depending on which buttons are selected it will be loaded images of the xml corresponding to the selected buttons.
The menu have to works as follows, for example, if I select the button 1, will be loaded X images, if I select the button 1 and 5, will be loaded X + Y images, if I select the button 1, 5 and 9 it will be loaded X + Y + Z images.
I'm trying to do the following. I have a menu with 11 buttons and a xml. The user can select multiple buttons and depending on which buttons are selected it will be loaded images of the xml corresponding to the selected buttons.
The menu have to works as follows, for example, if I select the button 1, will be loaded X images, if I select the button 1 and 5, will be loaded X + Y images, if I select the button 1, 5 and 9 it will be loaded X + Y + Z images.
I have a small gallery that loads thumbnails and the links they represent from an xml file. When I test it gallery on my computer everything works fine. However, when I simulate a download or when I upload to an actual site things start going wrong.[URL]I modified what i needed too and reused the rest. Everything works fine except for that the load order of the thumbnails is reversed. I haven't really changed any part of the code that would cause this, or at least I don't think I have.
The real problem, however, is that when i simulate a downloaded version or when upload them to my test site, the position of the thumbnails are swapped. A thumbnail i expected to load in a certain place and order has now taken the place of another one. When clicking a thumbnail it displays the picture of the thumbnail that should actually have been there, so the links still load in the correct order.When i change the simulated bandwidth while testing the movie, the position alter. At one bandwidth they show up in a certain order and when then trying out another bandwidth the order changes.
The XML load function:
Code: function loadXML(loaded) { if (loaded) { var xnRootNode:XMLNode = this; //trace( xnRootNode );
Im having some trouble with this code. I have a button that will pop in and out depending on the rollover and rollout. but then i want it to get and external swf when released. this is all done with smartclips if that matters.
I am like a new-born-newbie when it comes to Action Script 3.0 (or any other version for that matter). I've been trying to learn it by myself for the past week and a half using manuals and other sources but it's not so easy as there are many concepts that take some getting used to (I've never done programming before). So I ask of anyone who is kind enough to give me a hint or point me in the right direction. I am sure this will seem like a very easy and probably stupid question for the well-informed but it has been eluding me for the past 4 days.
I am making a website (I should say it's pretty much finished except for this one detail) it's simple and short. Nothing very fancy. There are 8 buttons in total for the main navigation (4 buttons in English and 4 in Chinese, each language group in their own set of frames)
the button that serves as a link to the Chinese translated version of the site is supposed to go to a particular page, depending on which page the user is in at the moment (example: if it is in the portfolio page in English, when clicking on the Chinese button it should go to the portfolio page in Chinese and so on). Likewise with the English button in the Chinese version pages.[code]...
I have a fully functioning scrollbar (MOUSE_DOWN and MOUSE_MOVE) and a fully functioning mouse wheel scroll. But I would like some code to move the scroll button according to my contents y position, when using the mouse wheel scroll.My scroll bar code:
how to use attachMovie to load a movieclip in to my main stage, drag it around and include a close button. I then added a variable (x) that would control which clip would on top depending on which was clicked last.
The question bit... I've managed to do this (...sort of), but was wondering if anyone could hint me with the code to disable the button if the clip is loaded, and enable it as soon as the clip has been closed so that it may be opened once again?
I'm using this to load the clip where x is the variable;
Code:
on (release) { attachMovie("new", "newname1", x); newname1._x=200;
The first prob I had was when i used the load movie command the swf file was loading in the wrong position, it kept loading down and across the page. I had
PHP Code:
_root.myemp.loadMovie("banner.swf", 0);
I dont know why this is happening but I just fixed this by doing:
_root.myemp._x = 0 _root.myemp._y = 0
The next problem Im having is that I want to change the frame depending on which button was pressed. If button two was pressed I wanted to load "banner.swf" and gotoAndStop("pg2"), If button three is pressed gotoAndStop("pg3")Ive tried some things but cant get this part right such as:
In the library, I have a movie clip - DraggableButton that has OnPress with StartDrag with parameters and OnRelase with StopDrag. I have a slider with this Draggable button and a bar to slide the button on. I also have two movie clips Clip1 and Clip2. In my main movie I have two instances MC1 and MC2 of Clip1 an Clip2. I have an instance of the Slider. I want to set the _alpha property of MC1 and MC2 depending on the location of the button on the slider.
I think I need to save the location (_x) of the button on the slider in a variable in the OnRelease even of DraggableButton and use this variable in the SetProperty method. I need to know in which event and which object's event should I use the SetProperty method. Or if what I am thinking is not correct what do I need to do?
How would I do this in AS3? I want to call a function and run it with specific properties depending on which button is clicked.So how do the "_this" statement work in as3? in as2 I would write something like this and "this" would stand for the instance name:
Is there a way for flash to detect a user's bandwidth, and depending the size of bandwidth, stop loading, or continue with the load? Now that I'm thinking about it, this would probably be a javascript detection script and if the bandwidth is high, load .swf, if not load a .jpg?
I have a fully functioning scrollbar (MOUSE_DOWN and MOUSE_MOVE) and a fully functioning mouse wheel scroll. But I would like some code to move the scroll button according to my contents y position, when using the mouse wheel scroll.
I'm doing my final year uni project (1 week left) and having trouble with some actionscripting and xml.Basically I have all the usual AS coding sorted out for my XML data and it's working fine but what I want to do is replace the xml file with another xml file depending on what button (I have 25 different files/buttons to do) is pressed.
So button 1 will put in: xmlFile.load("button1.xml")Button 2 will replace the above scripting with: xmlFile.load("button2.xml")
Is this possible? I don't want to create 25 instances/frames of the full xml text as the xml datat is displayed on an animation and it would significantly increase the file size.
I have a question about loading external data. When I had all my actionscript export to frame one, it would slow down the preloader and not show up until it was far into the progress bar animation. So I moved everything to frame 2. The problem with that is now my menus which are populated from an xml file are not there when the site starts to play. How can I get my xml data to load on frame one, but leave the .as fils to load in frame 2?
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]...........