ActionScript 2.0 :: Images Files Matching Variables?
Mar 5, 2008
although I've been reading it for some time now and I have found it very useful. However, I've encountered a problem with Flash that I dont seem to find here and I thought it would be just about time to The thing is this, I dont know if its even possible, but can a variable obtained from an input text be used to search an image in the _root directory with the same name and load it in a new browser window?Heres an example of the AS Im using:
on (release)
{
if (ticket == null)
[code].....
View 4 Replies
Similar Posts:
Jul 23, 2011
trying to make a yahtzee game but cant get it to score the 3 and 4 of a kind. I have dynamic text boxes that convert the dice to a number for scoring called result1, result2, ... How do I test to see if 3 of them match or 4 for the 4 of a kind and add the text boxes if 3 numbers match. I have a button that will start the function called score_3kind.
View 9 Replies
Apr 7, 2009
I have created a flash file that allows you to click on a thumbnail image and larger image appears ontop of a tshirt. The same way as a gallery would work. The images and thumbnails are pulled in through xml. However I have a problem, I need the images that appear on the tshirts to be .png files or gif files as the tshirt colour can be changed. At the moment my flash file will only display jpegs! I dont knwo why. The jpegs leave me with a white background, so I need the transparency of a png/gif. My actionscript is:
[Code]...
View 2 Replies
Aug 19, 2009
I am making a site that is in Hebrew and English. It contains two .swf files. The 1st .swf file allows the user to choose whether he wants the site in Hebrew or English. When he goes to the 2nd .swf file via a link I would like the 2nd .swf file to already know what language the user chose. How would I do this? using getURL and variables?
View 2 Replies
Sep 9, 2009
I am loading images into a movie clip dynamically from an XML file. Based on what image the user clicks, I would like to be able to open a separate window, displaying a different image. Ideally, I'd pass the variable of which image was selected to the new open window.I've done some research online, and am thinking I'm making this harder than it needs to be.
Actionscript from main movie
Code:
chosenImage.onPress = function() {[code]......
I've also seen where I could possibly pass a variable through ASP.NET, but am experiencing the same errors when trying to pass the variable. I suppose I could embed the popup.swf file in a new .aspx page, that would probably be acceptable.
View 1 Replies
May 21, 2009
I have a flash file that I made that displays a scrolling newsfeed (I'll call it newsfeed.swf)... I published it to an SWF. Now, I created a new flash file that I would like to use to show many instances of newsfeed.swf. In my new flash file, I have the following code:
this.onLoad=function(){
mcNewsfeed.loadMovie(http://www.whatever.com/newsfeed.swf?s=MSFT);
}
In theory, when newsfeed.swf starts up, the ?s=MSFT variable should be passed in at the _root level such that I should be able to reference it and build the newsfeed to be displayed dynamically. I've tried several different things, but no matter what I do, the following code (the _root.s part) in newsfeed.swf returns "undefined":
newsfeedURL = "http://finance.yahoo.com/rss/headline?s=" + _root.s
I would prefer to not have to pass XML files between the swf files or use system objects as that would add a level of complexity I'm not ready to deal with (I'm a total noob at this stuff)...
View 2 Replies
Mar 14, 2009
Lemme explain, I got 2 SWFs loading of the same page.On SWF2 I'm trying to receive a var from SWF1, and I'm trying to make it only by flash/as without any javascript help nor LocalConnection(will explain later on why it doesn't fit).A sample of what I've made so far can be found here:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[code].....
View 10 Replies
Dec 18, 2010
I made a drawing in Illustrator and exported it as FXG file to be used in my Flex App which is working fine. But now I want to change some settings inside FXG programatically, namely changing color inside the FXG file. How do I do that?
View 1 Replies
Apr 14, 2008
I'm trying to create an object/variable in my .fla file which will be accessible to functions located in my .as files. How do I do this?
Example:
Code:
// code in timeline of sample.fla
var player = new myObject();
[code]...
Normally, I would get an error from the second code block, saying that it doesn't know what "player" is. So how is this done correctly?
View 9 Replies
May 1, 2003
The external TxT file is loaded into _root!In the text file I have these variables:
-&ro1=122
-&ro2=112
They work fine but when I want to divide ro1 by ro2 it returns NaN!It was workin' a minute ago! I've been messin' if it for days now!
View 12 Replies
Mar 22, 2009
how do I passing variables between two swf (html) files For instance how can I request the variable "var_1" in the file blikvanger.swf (or blikvanger.html).Here is my code of one as file (contact.as):
Code:
...
homelink.addEventListener(TextEvent.LINK, linkHandler);
homelink.htmlText = "<a href="event:../blikvanger.html">THUIS</a><br>";
homelink.styleSheet = myCSS;
[code]....
View 5 Replies
Apr 8, 2010
Here is my code:
var vi3585 = 0;
var loader:URLLoader = new URLLoader();
//telling the loader that we are dealing with variables here.
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
//This is an eventlistener
loader.addEventListener(Event.COMPLETE, loading);
[Code] .....
I have dynamic number of files inside a folder. Every file has 2 variables in it vt11 and vt11s. I need a script that checks if the variables in the files have certain values and if it has this value than it counts this file. Basically what this script does is that it counts how many files in the folder have the same 2 variables in it and than displays this number in the text box. The above script always shows 1, no mater how many files with the same 2 variables are in folder.
View 1 Replies
Jun 18, 2008
Is it possible to make such a thing: When Button_btn is clicked (onRelease), var( var Name:String = new String("Flash MX|) ) is send to file (File.txt) and saved there.
View 1 Replies
Sep 19, 2011
How to pass or get variables through AS3 and Batch files?
Actually My main app is in Flash CS5. I want to search root folder (Which is not possible only with AS3 alone) for number of directories and pass them to a batch file.
View 1 Replies
Jul 6, 2010
I want to pass variables between 2 flash files.
pblm:
Src file: a.swf
Theres a variable called var1=Manisha;
Also, this swf calls b.swf
Target file: b.swf
How to access var1 here?
View 4 Replies
Apr 14, 2011
I am loading an external child swf file into a MovieClip container in my main swf.I have a button in my child swf that when clicked, needs to be able to access a movieclip or variable that is in my main parent swf. How would I do this??
View 1 Replies
Dec 1, 2010
I am trying to display in 'Reciever.swf' the value a shared object updated in 'TextSO.swf'. The following is my code for the Reciever
Reciever.as-----------------
package {
import flash.events.SyncEvent; import flash.events.NetStatusEvent; import flash.events.MouseEvent; import flash.net.SharedObject; import
[Code]....
I am getting an error that says that 'text_so' is an undefined property and that I can't access it. Yes, I have not declared 'text_so' in 'Reciever.as'. However it is the shared object instance from the 'Text_SO.as' file. How do I reference it from the 'Reciever.as' so that I won't get this error anymore?
View 1 Replies
Dec 1, 2010
I am trying to display in 'Reciever.swf' the value a shared object updated in 'TextSO.swf' . The following is my code for the Reciever[code].,...
I am getting an error that says that 'text_so' is an undefined property and that I can't access it. Yes, I have not declared 'text_so' in 'Reciever.as'. However it is the shared object instance from the 'Text_SO.as' file. How do I reference it from the 'Reciever.as' so that I won't get this error anymore?
View 4 Replies
Jun 2, 2004
I want to make a small flash animation in which the user can specify what text and what font/color will be used throughout the animation, by typing in the text file.On with the code which is of interest:
Code:
//Mouse.hide();
since1_txt = "";
since2_txt = "";
thename = "";
[code]...
Of course, the movie clips contain this text and all works fine if I specify it this way.So I have this in my "actions" layer on the first frame and apart from the fact that it works if I specify the formatting within the actions, it's all good. But now comes the fact that I want to specify my textformat options within the text (.txt) file. So I'd specify two color sets (in RGB hexa sets, 0xFF0000 for example), the font (in this case, tahoma) and the three sizes, and have them assigned to myTextFormat's dynamically through loading, using, for example,
Code:
myTextFormat = new TextFormat();
myTextFormat.align = left;
myTextFormat.color = theColor1;
[code]...
Which doesn't work because i can't seem to get the myTextFormat.font = Tahoma; to work if i use myTextFormat.font = theFont; because it is, perhaps, searching for a font called "theFont" instead of taking the reference to the variable within the text file.
View 6 Replies
Jun 2, 2004
I have just recently joined and am enjoying the multiple forum q&a's and the tutorials around here. I want to make a small flash animation in which the user can specify what text and what font/color will be used throughout the animation, by typing in the text file.On with the code which is of interest:
Code:
//Mouse.hide();
since1_txt = "";
[code].....
View 6 Replies
May 2, 2009
I have a quick question about using an XML file to contain the path to something I want to load in Flash. Right now, I have:
this.loadMovie("Images/1.jpg");
I'd like for the word "Images/" to be read from the XML file and I was wondering how I would go about loading the variable that contains "Images/" into the path line in Flash.
View 1 Replies
Sep 24, 2010
I want to lik the images and swf to local files but I'm not able to do so. I took the code from an accordian menu tutorial
[Code]...
View 1 Replies
Jul 13, 2010
How can use stage variables and function from external loaded swf files.& Can Possible without using parent.parent fromat, can possible root.format if possible how .
View 1 Replies
Jul 13, 2010
How can use stage variables and function from external loaded swf files.& Can Possible without using parent.parent fromat, can possible root.format
View 1 Replies
Mar 13, 2006
use loadVars to read variables from .txt files on a different server with flash, do any of you know because I'm getting really annoyed?
View 14 Replies
Feb 2, 2009
How can I send multiple variables (images + text) from AS3 to PHP?
In other terms, how to mix these 2 pieces of code:
Code:
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
var header:URLRequestHeader = new URLRequestHeader("Content-type",
[Code].....
View 2 Replies
Jul 18, 2011
I'm having some trouble with loading images for my tiles in a small game I'm making. It's isometric and tile based. I have two questions: I have a class called MapTile which is for each tile in the map. Each tile is made up of 1-9 blocks stacked on top of each other (like Final Fantasy Tactics). For example, let's say there are 4 different kinds of blocks: grass, dirt, stone, and water and they all have different images. I was considering embedding only the images needed (so if a tile is just grass on dirt then it would only embed the dirt and grass images). Will this actually make the game faster and smaller or is it worthless? If it's worthless then just ignore my next question.I'm trying to embed my images dynamically as stated above. So I have an array called loadedTiles that contains the class names of the tiles that have been loaded so that I don't embed the same thing twice. And I try something like this for embedding new images:
Code:
var sourceT:String = "../../../lib/tiles/" + tilesList[data[i]]["image"];
var nameT:String = "block" + tilesList[data[i]]["id"];
[Embed(source = this[sourceT])] var this[nameT]:Class;
[Code]....
View 1 Replies
Feb 1, 2010
Lets say I'm downloading multiple files like this:
Quote:
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Progre ssEvent.PROGRESS, onProgressStatus);
[code].....
View 5 Replies
Jan 19, 2011
I need to protect images embedded in a swf file. I've noticed Swf Encrypt scrambles the images, like so:
How is something like this achieved ? How does image scrambling work ? I've noticed the image is stored a bitmap. Not sure how information is stored.I imagine it would be possible to use something like AS3SWF to access the content of a swf, but what would I need to change for the image swf tags ? I don't know much about security/obfuscation/encryption, so any tips will be handy. The programming language for this shouldn't matter much.
View 1 Replies
Jun 27, 2011
I am searching all over google for an easy way to resize images but the problem I am having is that .x does not work .width does not work ._width does not work. ._x does not work. How can I do something as easy as changing the width height of a picture? I am loading the photo into a movie clip using the Loader class
var i = new Loader();
i.load(new URLRequest("a.jpg"));
// here I try to write a code that will change the size of the image.
photon.addChild(i); //photon is the name of the movie clip instance
And have tried. all of the codes mentioned above on both the actual movie clip instance and the loaded image on variable (i).
View 2 Replies