ActionScript 2.0 :: Replace The Xml File With Another Xml File Depending On Button Pressed?

May 1, 2008

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.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Change The Frame Depending On Which Button Was Pressed?

May 1, 2003

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:

_root.myemp.gotoAndStop("pg2")
"banner.swf".gotoAndPlay

I just dont know the syntax...

View 2 Replies

ActionScript 3.0 :: Play A Certain Part Of MovieClips Timeline Depending On The Button Pressed

Nov 22, 2010

Right I only want to play a certain part of my MovieClips Timeline depending on the button pressed.

ActionScript Code:
stop();
CircleLineMC.KingsCross.addEventListener(MouseEvent.MOUSE_DOWN, KingsCrossBtn);
function KingsCrossBtn(event:MouseEvent):void {
BigSquare_MC.gotoAndPlay(1);
}

But I want it to play only up to frame 50 and then stop there and then loop instead of playing the whole timeline, does anyone know How to do that.

View 6 Replies

ActionScript 3.0 :: Loading Another SWF File When Particular Button Pressed

Jul 13, 2009

I am using loadMovieNum function to load another SWF file when a particular button is pressed. I have also provided Home button for user to unload movie loaded using button press event. However, when the movie is unloaded the background letter and even the button texts become blur.

View 7 Replies

ActionScript 3.0 :: Replace A Loaded External Swf File From Button Within Itself?

Oct 17, 2011

I've got button events that load swf files into the main movie. Within the loaded swfs are additional buttons. When these buttons are clicked I want the targeted swfs to replace the current swf. I guess I don't understand how to reference the Loader var within the main movie.

Currently, when the links are clicked in the loaded swfs, the movies are loaded on top, rather than replacing them.[code]...

View 0 Replies

ActionScript 3.0 :: OMG - Get A Button When Pressed To Display Text From An External .txt File

Oct 29, 2010

Im trying to get a button when pressed to display text from an external .txt file (which I've done so far), but (1) I want it to only display certain paragraphs (the actual dialogue) of this text and (2) every time I click the button it should replace the old text with the new (like in any RPG). Now I asked a former lecturer for help and he gave me a link to a website and gave me a hint of what to do, but seeing as I was recently voted #48 on Forbes worst 100 programmers of all time (actually I haven used AS for 5 years) so I thought someone could explain it to me in a much clearer fashion? PS: My lecturer said: When you click the button to add text to the textfield but you ewant the previous text to be cleared the first thing you do is empty the box ( myText.text = "") then fill the box again with your new text..

[Code]...

View 3 Replies

Professional :: Replace And Old File With A New File?

Dec 4, 2011

i accidentally replace and old file with a new file... what should i do to get it back?

View 1 Replies

ActionScript 2.0 :: When The "Order" Button Is Pressed The Info Is Send To Php File?

Apr 12, 2010

I am making one flash project for online shopping. When the "Order" button is pressed the info is send to php file which sends info to the owner e-mail address, so he can review the order and confirm it. So he problem comes when the client types something in cyrillic and in the received mail it comes as "?

View 4 Replies

ActionScript 3.0 :: MovieClip Change Animation Depending On Key Pressed

Jul 26, 2009

I have started to make an interactive movie where pushing keys moves a movie clip around the stage! And I can obviously make the movie clip do what I want, so here is the question: I want to make the movie clip change its animation depending on which keys are being pushed i.e. Left key the movie clips moves left, and my stick man changes to a running animation. Push nothing and it changes back to his standing still animation.

View 2 Replies

ActionScript 3.0 :: Loading Txt File Depending On Which Country?

Feb 21, 2010

Question: Is it possible to let flash load different files with an if-statement depending on from where the file is entered?My plan is to publish the swf with an html file. So theoretical as there are many different locations for IP adresses it should be possible to have the if-statement check, from where my file is opened

View 3 Replies

Resize Swf File Depending On Screen Size?

Jun 26, 2010

I have a website with a large .swf file. However when people with smaller screens view the website, I would like the .swf (which takes up the entire screen) to resize to fit on exactly. Just like how on most flash sites when viewed they fit the screen perfectly, however also then when viewed on computers with smaller screens they resize and still fit perfectly again.

View 2 Replies

ActionScript 2.0 :: Rotate To Certain Destinations Depending On Buttons Pressed In The Navigation?

Mar 25, 2007

I have a circle movieclip that needs to rotate to certain destinations depending on buttons pressed in the navigation. Everything works fine, except when you go from green to cyan and vice versa, it does a full 360 rotation instead of just moving to the destination.

View 13 Replies

ActionScript 3.0 :: Resize A Swf File Depending On Any Screen Size?

Jun 14, 2010

I have a website made of swf files. The swf files are contained in an HTML body that I created with Dreamweaver CS4. I want the website or each page of this site or each swf file to resize depending on any screen or window size. I am using Flash CS4 and AS3. You can look at my site www.ealba.net and you will see that the size is too big for a 15 inches screen or smaller. I think there is a code for it... a code that adapt the website to any screen size.

[URL]

View 2 Replies

Xml :: Replace And Edit Values In A File With C#

May 21, 2010

how to replace and edit values in an xml file with c#. The question got a great answer. Now I wonder how to do this in Actionscript and if there is an as simple way as in c#.

The question can be found here: [URL]

View 1 Replies

ActionScript 3.0 :: Error - Swf File Plays Differently Depending On Location?

Sep 16, 2010

I've run into a strange error and I was wondering if anyone had experience with this.I'm working on a flash platforming game and I recently released a demo. I was having a problem with the getting the file to play correctly when I noticed an error:The file plays differently depending on where the file is saved. For example:Platform Explorer (http://jrjellybeans.net/platformExplorer.swf).This file runs fine. Platform Explorer (http://jrjellybeans.net/flashGames/platformExplorer.swf).This file opens up the level editor. Yet, I make no call to the level editor anywhere in this particular file.The thing is that the files are EXACTLY the same. Just saved in different locations.

View 2 Replies

Replace Background Image With Swf File In Html?

May 5, 2009

I want my swf animation to be set as the background in my html page so I can put tables on top of it. I tried to do it but the swf file is not coming up.

View 3 Replies

Professional :: Multiple File Search And Replace?

Apr 17, 2011

it is possible to do search / replaces in script, text etc over multiple files?  If not, is there any 3rd party software available to do it?I have hundreds of files I have to make the same change in and just wanted to find out before I have to do the mind-numbing process of going through them all.

View 3 Replies

Flash :: Replace Image With Video File?

Oct 14, 2010

I have video gallery written in ASP.NET. Each video has an .flv file hosted on FMS and image. I want to replace image with flash file each time use mouseover on video.

View 2 Replies

Flex :: Replace An Existing XML File Using Webservice In It?

Jul 15, 2011

Is it possible to Replace an existing XML file using Webservice in Flex(browser-based application)?

I wanted to replace an existing xml file with new xml file of same name for example 'dashboard.xml'.

How can i replace this file from Flex browser-based application? can this is possible using webservice?

what things should be taken care to implement this?

View 1 Replies

ActionScript 3.0 :: URLLoader Generates Error #2048 Depending On File Contents

Jun 7, 2010

I've developed a preloader for an ActionScript 3 application that uses URLLoader to load an encrypted swf. This has been tested on different OSs, Flash Players and browsers and everything works as expected except for a series of PCs being used by a colleague on a corporate network. The PCs at fault use Flash Player 10.0.22.87 with IE6 on WinXP and get security sandbox error #2048 depending on the contents of the file being loaded! Some of the tests and results include:removing 99% of the contents but keeping first 6k (works)replacing contents with 4 bytes 00 (works)inserting 16 bytes: EF BB BF <html></html> at beginning of file (works)inserting 16 0s at the beginning of the file (fails)xor FF all bytes (fails)I've tried other tests such as different file extensions, Security.allowDomain(¯), crossdomain.xml, Security.loadPolicyFile(¦), dataFormat = URLLoaderData Format.BINARY etc but I think these are all irrelevant due to the fact that the app sometimes works.The code is just the standard new URLLoader(), adding event listeners, then calling load(new URLRequest(¦)). The test app doesn't include the loadBytes() so this isn't the issue either.

The PC at fault could be behind a firewall or using a proxy. At this stage my only theory is that their antivirus, firewall or proxy is examining the contents and sometimes decides to intervene, perhaps with a redirect. This would also explain why (according to the web server logs) the files are being requested even though the security sandbox error is generated. However, this does not explain why Flash generates the error in the first place, depending on the contents.It's not possible for me to visit on site or get them to modify their settings or configuration, but I can ask them to run various Flash Apps for testing.URL...I can come up with a workaround (such as ensuring the file always starts with dummy <html> tags and then strip them before decrypting), but I'd prefer to get to the bottom of this issue if possible to be confident it won't occur again; this is for a Facebook application so it's possible it will be used in a large variety of environment

View 11 Replies

ActionScript 2.0 :: Replace Text Loaded From An External File With Text From Another External File?

Nov 9, 2005

How can I replace text loaded from an external file with text from another external file? Using setInterval and calling the .load from a function or something? In the example below I'm calling an external text file, could this also work with an .xml file with cycling through the children?

[Code]...

View 2 Replies

ActionScript 2.0 :: Make A Box That Fades In When Pressed On The Button And Fade Out When Pressed For The Second Time?

Nov 16, 2004

I have a function on root:

_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();[code]....

This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say

on (press){
_root.fade = true;
}

the mc fades in, but I cant do another on (press) to fade out. Is this too confusing?

View 2 Replies

Data Integration :: VoucherNo Variable From Flash To Replace The Value In GoodVoucher Field In XML File?

Aug 21, 2006

I have the following code in place to move a variable from my Flash app to an XML file for storage [code] how do I go about getting my VoucherNo variable from.Flash to replace the value in the GoodVoucher field in my XML file?

View 3 Replies

ActionScript 2.0 :: A Button In An Swf File That Affects Another Embedded Swf File?

May 15, 2004

Is it possible to let's say, have a button in an swf file that affects another embedded swf file?

View 2 Replies

ActionScript 2.0 :: Button In An Swf File That Affects Another Embedded Swf File?

May 15, 2004

Is it possible to let's say, have a button in an swf file that affects another embedded swf file?

View 2 Replies

ActionScript 3.0 :: Button To Open A Swf File From An Swf File?

Dec 7, 2009

I am new to flash and I don't understand much about action script. I want to open one swf file from another using a button I have called ready_set_go. The project is not going to go into html format I only want to open the file locally. What is the code I need to do this?

View 0 Replies

ActionScript 2.0 :: Download Button - Opening The File Rather Than Giving A Download This File Option?

Jun 13, 2008

I have a few buttons rigged up for downloading word.doc, mp3 etc

Problem is its opening the file rather than giving a download this file option.

View 6 Replies

ActionScript 3.0 :: Remove / Unload External Swf File(s) From The Main Flash File And Load A New Swf File And Garbage Collection From Memory?

Sep 12, 2009

I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?

View 15 Replies

ActionScript 3.0 :: Write A Class File Using A .as File Instead Of Writing Code Into The Script Tab Of A .fla File?

Feb 4, 2010

I am trying to write a class file using a .as file instead of writing code into the script tab of a .fla file.When I write stage.addChild(img); I get an error that stage is null. When I take out stage, and just write addChild(img); the code runs fine, but nothing appears on stage. Do I need to do something to set a stage active?
 
Is this because I don't have a Main class? My class is named after the file and I don't have a file named Main.Here is the code. As it is, it runs and I get the two trace outputs, but no graphic on my screen.
 
package  { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.Loader; import flash.events.*; import flash.net.*;  public class HelloWorldImage extends Sprite {  private var background:DisplayObject, foreground:DisplayObject;  private var url:String = "hw_jpg.jpg";  private var loader:Loader = new Loader( );    public function

[code].....

View 7 Replies

ActionScript 2.0 :: Changing The Function Of A Button Depending On Previous Button Press?

Mar 14, 2007

I'm loading in 5 jpegs from an external file using "loadMovie" and i have 5 corresponding buttons (1-5) to load them with.

I want to change the jpeg the button loads in depending whether a separate navigation button has been pressed -

i.e.

navigation buttons:

-motorbike pics
-car pics
-lorry pics

If a user clicked on "car pics" then the loading buttons 1 to 5 would load "car1.jpg", "car2.jpg" and so on...

similarly if the user clicked on "lorry pics", the same loading buttons 1 to 5 would load "lorry1.jpg" and "lorry2.jpg"

View 1 Replies







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