ActionScript 2.0 :: Exchange A Filename/url (like "XMLtoLoad") By A More General Variable?
Jun 25, 2003
I have the following question: How can i load a dynamic xml, i.e. the .xml file that will be generated automatically and thus gets different names.I want flash to "listen" to a variable "file", that is "file" represents the name of the xml-file to load. Like showXml.swf?file=abcd1234.xml. btw i don't exactly use the xml extension so it becomes showXml.swf?file=abcd1234
I using a general name = "XMLtoLoad" to load my xml.My AS right now is somthing like:
file = XMLtoLoad;
_root.xmlDocument.load("XMLtoLoad");
how can i exchange a filename/url (like "XMLtoLoad") by a more general variable? Or maybe i should ask how can i convert the name after "?file=" to a URL within AS
View 2 Replies
Similar Posts:
Jan 26, 2006
I'm trying to save an XML file on a remote server via an php file, and so far this works fine by following the tutorial on this site - exept one thing...I would like to define the filename of my XML file to be saved via php in flash dynamically, eg. so I can create several XML's from flash. But how is this possible ?- can an entry in the passed XML file be read in an easy way in PHP4 - or can I send a variable along with the XML object with some wrapping (maybee an advanced object).
View 1 Replies
Apr 21, 2006
it's possible to have AS take the filename of itself and make it a variable. I need it to be done by AS only. I know it's possible in PHP, but I'm not sure about AS. I'm guessing if it's possible it's one line of code. I'm using Flash 8 but publishing at Flash 6, AS 2.
View 2 Replies
Jun 26, 2010
I try to embed images in a mx:tree:
<mx:Tree labelField="name" id="tree"
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')">
</mx:Tree>
This works fine, but I will embed the images with a String variable.
[Code]...
View 3 Replies
Aug 23, 2011
I would like to select a specific xml file to load from a local directory. The file name is composed of "Title" + "number sequence". I know the Title (in this case its XLink07), but I need to select the latest number sequence or the latest by date stamp.
For example, the local directory has the following files:
XLink01[36735298100].xml
XLink02[36735298100].xml
XLink02[36735298101].xml
XLink07[36735298100].xml
XLink07[36735298101].xml
In this example I need to select file XLink07[XXXXXXXXXXX].xml where XXXXXXXXXXX is the highest number within the XLink07[XXXXXXXXXXX].xml files. Title is Xlink07 and function should return Number sequence [36735298101]. Files with higher number sequence have later date stamps than files with lower number sequences. I need to select the highest number or the latest date stamp for the file that begins with XLink07.
My action script to load the local .xml file without any function to select the correct file is:
Security.allowDomain("*", "*")
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("XLink07[36735298101].xml"));
xmlLoader.addEventListener(Event.COMPLETE, showXML);
function showXML(e:Event):void {
[Code] .....
View 1 Replies
Oct 1, 2009
I would like to pass a value from a text box on stage as the URL or filename to the NetStream.play() argument. example:
var url:String = url_text.text;
var conn:NetConnection = new NetConnection();
conn.connect(null);
[Code].....
The point of the matter is that I'm pulling the values from JavaScript/HTML using the ExternalInterface which changes as the user selects next on a HTML page. The page name (URL) is being parsed and passed back as the video filename. I'm using the text boxes currently just to test/view the values being received and sent to JavaScript. The value send and receive fine, I just can not seem to pass the value into the NetStream.play(JavaScriptValue).
function getTextFromJavaScript(str:String):void {
sending_ti.text = str;
var jsArgument:String = sending_ti.text;
[Code].....
View 1 Replies
Jan 30, 2010
What exactly is the difference between using "this" and 'this' when you do something like set a variable?
View 2 Replies
Sep 29, 2009
I have a flash doc with two MC's and two frames.In frame 1, the user can select one of the MC's, and in frame 2, he can move ONLY that MC.Is there a way to write a general code in frame 2 and not having to write an "IF" depending an extra variable I had to create?Because in the future I will have lots of MC's.Here is the little code I have and the link with the .fla
Frame 1
Quote:
stop();
extra_var = 0;[code].............
View 0 Replies
Nov 20, 2011
I'm sorry if this is the wrong place to post this, but I looked for a place to send general "feedback" and could not find one.I just wanted to let the management at Adobe know a couple things related to recent Public Relations blunders. Ever since the announcment that you were ending Flash Player for Mobile, I have had many conversations with people about this topic and there is SO much misinformation due to your announcement, it's going to tank Flash as a broader platform.
- Some think Flash doesn't work on Macs
- Some think the Flash player is cancelled on ALL platforms (PC included)
- Some think Flash in its entirety is coming to an end.
This perception seems to come from people of various levels of technical knowledge, from basic users where it's understandable they might be confused about the specifics of the recent news (but still not a good thing!) on up to key decision makers who don't know tech but are key to making certain spending decisions with regard to tech platforms (CEOs). This is a horrible place for Flash to be in right now and you need to quickly change the perception with a "Flash is alive and well" type of announcement.Remember, most people only retain sound bites and a few words from headlines. You may have announced "Adobe ends Flash Player for Mobile" originally, but what people retained was "Adobe ends Flash Player". You need to make a new announcement that the short attention span people will come away from with knowledge that all is well. "Flash not dead" for example.Man, whoever plans your PR needs to be fired. You could have killed off the Mobile player back before the MAX conference and then followed up with the news about Flash Player 11 and Stage 3D. That would have a perfect one-two punch, but instead you reversed it and all the excitement from FP11 @ MAX was blown away.
View 3 Replies
Nov 10, 2011
I'm completely new to Java. My task is to set up the client/server architecture for an upcoming Facebook game. On the server-side, I have:
[Code]...
View 1 Replies
Jun 4, 2010
Here I aligned Left Center...
How to generalise?
I have created three movieclips." image","crop","fixedPoint"
I am rotating the image 0,90,180,270,360..
image always align with fixed point.
ActionScript Code:
import flash.geom.Rectangle;
function alignObject()
{
[Code]....
View 4 Replies
Oct 3, 2010
I was just wondering, what is better in general? Having a TextArea component or just use a TextField with a scrollbar component over it? What consumes less memory? What is the implications of using a TextArea? Why use a TextArea over a TextField? I'm currently trying to deal with memory leaks and maintenance over time in my flash application, so every byte I save means a lot
View 1 Replies
Sep 17, 2009
i have a few problems that i have stumbled apon and i'm using Learning Actionsript 3.0 book to help me, but i am using FlashDevelop as my chosen editor for learning rather than Flash IDE editor, is it OK for me to upload my FlashDevelop projects for people to see and help? because like i said i'm using it for my AS 3.0 learning.Do many of you use FlashDevelop for your AS 3.0 code?
View 2 Replies
Feb 4, 2012
I was wondering what's the best way to manage an images depth. Currently I have 2 layers. On the top layer I have a png image of a window. The inside of the window frame is transparent so you can see though it. On the bottom layer I have a png image of a background that you cannot see though. I used addChild(MyMovieClip); to put an image onto the stage. It is in front of the window. I used addChildAt(MyMovieClip, 0); and the image ended up behind the background. I used addChildAt(MyMovieClip, 1); and the image ended up in front of the window again.
[Code]..
View 1 Replies
May 9, 2011
If I have a flex component that is a general popup, it's basically just a white popup that I pass an Array named "modules" to.[code]...
View 2 Replies
Aug 29, 2009
I was looking for data to be transferred from ASP.NET page to Flash CS3 with actionscript 3.0
View 5 Replies
Apr 8, 2010
I need to create an interactive web-based system which takes the user through steps to assemble something. One of the pages will have images of the tools needed. I want the user to be able to 'tick' off each tool, so that when they click on the image of a specific tool it is replaced by the image faded out and a big red tick over it. essentially it is replacing one image for another when it is clicked on.
View 1 Replies
Mar 19, 2012
I want to exchange values between ASP and Flash. I don't want to send it as a querstring like :myswf.swf?var1=value.I don't want my user to see or edit this value.
View 4 Replies
Jan 12, 2009
I've bought a photo gallery flash template. It's easy to change the photos at this template, just need to put them into gallery folder. But what I need is when the user put the mouse over the other photo "before" version of the photo will pop up. I read this is called mouse roll over or something like this. My question is how can I do it and where should I do it?
View 9 Replies
Nov 23, 2011
I got one bitmap with a (almost) one color background. i need to change all of this with pixels at same x,y from another bitmap.
I know i need to run it through a double for loop and then into an if sentence.
like this:
If (color at x,y is > redvalue && color at x,y is > greenvalue && color at x,y is > bluevalue)then exchange with pixel from the other bitmap.
View 1 Replies
Jan 27, 2010
You know how when you load xml you use this code.
Code: Select allxml.load("data.xml");
which is the file path to the xml. I would like to know how I could exchange different xml files from the same component. Their must be a way to do this. Like say-
Code: Select allbutton1.onPress = function(){
xml.load("data.xml");
}
button2.onPress = function(){
xml.load("data2.xml");
}
View 2 Replies
Jan 4, 2011
new to ActionScript 3 and while I'm trying to write as "clean" code as possible (creating various custom classes instead of everything in the document class for example), sometimes I stumble upon behaviors that would not arise if I had put everything in the same place.I have a project which involves fireworks which is working fine, but I'd like to add a smoke trail to the rockets (a custom class rocket object) and so far I can't get it done.
So I will ask my question first: what methodology do you use in general when you want to make a custom class object leave a trail of particles behind it? Do you include the trail generation in the class? in a separate class? on the document class?what I've been doing (and what I feel is the "cleanest" and most reusable way to do it) is to put the trail generation in the custom class rocket object. This object is just composed of some graphics and the function that generates the particles(which are another custom class).The actual handling of the firing and the movement of the rocket is done by the document class.So the problem I'm having is that when I generate a particle on a frame, if I add it to the rocket object, it follows it (local coordinates), and if I add it to the stage then I can't remove it from within the rocket object...
View 4 Replies
Jul 24, 2011
I am currently making a game with Flash CS5 and AS3... namely Tetris I have created my main menu and the objects and so on and have a few questions
1) How do I quit the game should a player press the quit button?
2) How do I get a button (Z and X) to rotate an object whilst the object is moving downwards (it is moving downwards using the timer function)?
3) How do I get the object to stop once it reaches the bottom of the screen? (im thinking something along the line of the hit detect but havent had much luck)
4) Any ideas on how to get flash to detect if a line is complete and therefore delete it? (it needs to segment blocks off the graphic)
5) My final and most important question (the bit im working on at the minute) how do i get flash to call random functions so that random tetrominoes appear on screen so that the game is different everytime and the blocks are random as the player plays)
View 2 Replies
Jan 6, 2010
I have an awkward problem with a carousel I have built. When the images are scaled down to give the 3d 'flipping' effect, they start to flicker and cause the general movement to slow down. Someone mentioned cacheAsBitmap.. .
View 3 Replies
Jun 8, 2010
Is there a way to handle errors and exceptions in AS3 as one would do so using `set_error_handler` and `set_exception_handler` in PHP?
View 4 Replies
Jun 16, 2010
Given the nearly plain-text nature of Flash, from a security standpoint, we must assume that your SWF can be decompiled into human readable format. That said, how can we ensure the validity of any online calls? For example, recording a high score might make a call similar to this:
Code:
var url:String = "http://someserver.com/tracker/scoreTable.aspx?mode=record&score=" + _userScore + "&checksum=" + MD5.hash( /* stuff */);
var loader:URLLoader = new URLLoader( );
loader.load( new URLRequest( url ) );
You can do all the MD5 hash checking to make sure the data received matches what was sent, but how can you verify the validity of the call? For instance, one could decompile the SWF and figure out how to build the query string manually, or they could reverse engineer it from monitoring the internet calls from the SWF itself. They could even use a run-time memory editor to change the figures that store the information while playing the game, so that when the recordHighScore call is made, it sends 1,000,000 instead of 1,000. How does one authoritatively validate data and protect against abuse?
View 3 Replies
Jul 17, 2010
[URL]. You can use it to download and parse into an object the ASE files from sites like Kuler or ColourLovers, for those who want more control than their RSS feeds provide. You get all the group and color info for RGB, CMYK, and Gray color modes (Sorry, didn't do LAB). The object just needs the ByteArray representation of the ASE, so it can be used on embedded or dynamically loaded files.
View 1 Replies
Jan 26, 2009
I have nested functions, I have removed most of the code.
[CODE]....
LOTS and LOTS of code (pages of it) including multiple arrays, series of questions and prompts that run my tutorial and all are initiated by an initial button press and then act on key-press responses provided by the user. These key-presses are stored in arrays. I could not possibly explain it all without getting comments that I was providing too much information ***
[CODE].....
View 4 Replies
Nov 6, 2010
I've been struggling with this for a few weeks, but I still can't get it right, and all the info I found is too ambiguous or uses AS2. What I want to do is to retrieve info from a MySQL database, using PHP, and send it to Flash; and in the other way, input info into the database from a Flash form. I want this to make a series of Flash tests for my website. show me a simple example code (on both PHP and Flash) of how to exchange data? PD: I know how to work with databases on PHP, so the only PHP code i need to see is the php-flash communication part.
View 3 Replies
Dec 4, 2009
I want a Flex UI to send a string of text to Rails which will process and return a string of text. Wash, rinse, repeat. That's all I want. All of the examples I am finding are much more complex and not very informative given my noobiness.
View 1 Replies