ActionScript 3.0 :: Getting Values Of Vars From A External Swf
May 19, 2010I have a main.swf that load a external.swf. How can I get values of vars from the external swf calling from the main??
View 1 RepliesI have a main.swf that load a external.swf. How can I get values of vars from the external swf calling from the main??
View 1 RepliesI have a flash file which loads in vars from director. It then adds the values to a graph. The amounts from the string are inputed into text fields. the fields are named energy, waste etc. I want a textfield to output whichever sections that are over 5 saying "well done, you have excelled in water, energy...... I have got this working but am stuck on this bit: I am wanting to add an "and" before the last item, so it outputs as "well done you have excelled in water, waste and energy". Also if only one item is over 5 it wont add the "and". This probably doesnt make any sense, heres my code anyhow:
Code:
var summary_results = "2000,6,3,10,8,6";
var txtFields:Array = [Total,Energy,Waste,Water,Food,Transport];
var excelledItems:Array = [];
var theValues:Array = summary_results.split(",");
for(var i=1;i<theValues.length;i++){
[Code] .....
In first frame of my movie I've got this:
PHP Code:
loadVariablesNum("produkter.txt", 0);
import TextField.StyleSheet;
var myCSS:StyleSheet = new StyleSheet();
[Code]....
and a dynamic textbox called "myHTML". If I name 'var' on this textbox everything works fine, but I want to write it in actionsscript instead. Where do I write that? (I have 3 different vars in the text-file)
I am developing an air application where I have to drop an image and save the Image path, width, height to variables and pass those variables to external swf. I load the swf like this:
var myLoader:SWFLoader = new SWFLoader();
var url:URLRequest = new URLRequest("myExternalMovie.swf");
myLoader.load(url);
I am getting this error: the way I am passing the URL of the swf is incorrect and not supported in AIR.
I'd like to set two seperate variables from two external .txt files, while I'm not new to AS 2 this is something I've never had to do and after searching for examples I've found that most apply to dynamic text fields. I simply want to populate some variables
View 0 RepliesI'm importing a SWF by URLRequest, and I need to read from a var that is in there (actually, is a textfield).
Code:
//loading my local swf file (wich is a keyboard) and placing it where it goes
var request:URLRequest = new URLRequest("keyboard.swf");
var loader:Loader = new Loader();
[Code]....
as I'm trying to cast my displayobjet to a movieclip I though I would be able, but im not
I've loaded a movie into a movie.the loaded movie is loading dynamicly some pics and text. when a movie is loaded, does everey movie got it's own _root?
View 2 Repliesso i've got a swf that opens a new window with a swf . (AS3) i want to send these 4 :
[Code]...
how can i send these 4 to the clients.swf and how do i check on the other side if they exist or not ? i searched and got all sort of details about flash -> php , as2 to as3 , swf loaded in the same swf as child etc. But i couldn t not find something spefici to my problem . Also i want to use something like POST so the url looks clean as it is .
I've loaded a movie into a movie.the loaded movie is loading dynamically some pics and text. when a movie is loaded, does everey movie got it's own _root?
View 2 RepliesMy problem is i had 2 swfs parent.swf and child .swf and i loaded the child.swf file in parent.swf using Loader class there is a textbox and a button in child.swf when we enter text in the textbox(say,notepanel_txt) and click on the button(say, mySubmit) the text present in textbox(notepanel_txt.text) is saved in the database using URLLoader and an variable called success(which is String type) must be available to parent. the code is as follows:
parent.fla
----------------
--------------blah... blah...
[code].....
On my html page I have two frames, one for navigation and the other for content. The navigation menu is an swf. Most of the content is html, except for the 'gallery' page.
The thumbnails for the gallery appear within the navigation. I can get the pictures to load from the thumbnails into the 'content' frame using LoadVars sendAndLoad.
However, doing this means that the flash gallery refreshes itself each time a thumbnail is clicked (thereby losing the transition effect).
So, how do I load the images in the other frame without reloading the flash??
Could I do it using external interface? ..
I'm importing external vars using loadVariablesNum() from .txt files. I know that each variable must be surrounded by amperstands (&) in order define the start and end of each variable.
ie:
Code:
&var_1=abc&
&var_2=xyz&
And then I want to use something like:
[AS]mc.gotoAndPlay(_level#.var_1);[/AS]
But my question is (for simplicity), is there a way to do this if the amperstand at the end is not included, such as:
ie:
Code:
&var_1=abc
&var_2=xyz
Flash returns the first variable above as var_01="abc " which is understandable since it was not closed properly. However, I want to be able to use the gotoAndPlay(); with var_01="abc ". I have tried labelling the frame with abc , but that didn't work.
I also tried using frame_array = new Array(_level#.var_1.split("")); and then said gotoAndPlay(frame_array[0]); but for some reason I couldn't get this to work either....
i am trying to load vars from a text file into a load vars object.
var kitchentext = new LoadVars();
kitchentext.load('moccastext.txt');
Once in the object, i thought i could reference them like so
kitchentext.name
kitchentext.style
but i am having trouble doing this.
i have a textbox called displytext.
_root.displaytext.text = kitchentext.name;
doesnt work
I use an external txt to load some vars... works fine... But when I change the values of vars in the txt, and reload the txt in my swf, the old values are still displayed. Only when I take a new browser I can see the changed values. Does enybody know how to make sure I can load my changed vars from the txt without refreshing the internetbrowser?
View 2 Repliesneed to show the vaules on mouseover as well as at the bottom of each node in the charts. In case of pie chart, the chart data should be visible on each of the pie. On mouse over tool tip display for values should be optional.
View 1 RepliesNow i have one more doubt in Array.. i want to store some values into an Array from a external txt file.. I want to draw a line graph between two variable(X) and (Y) but i want to read that variable values from a external file.. I try use loadVars() class, but in that i have to assign a varable name to each and every value.. but i want to create a generalised class that will store any number of data into an array..
View 9 RepliesI have just started using external AS3 files to try wean myself off using code in the main time line.I am importing an XML file using an external as3 file, but cant return the values to the main timelineIt worked when I used the trace option, but I need these values to dynamicly populate a movieclip on stage (another problem I cant add movie clip to stage even though I have the linkage etc)AS3 Code ----------------------------------
package com.teamSelection
{
import flash.display.DisplayObjectContainer;
[code].....
I've gotten these sliders to work but can't get the output values to add up. For instance, depending on the values for slider 1, 2 and 3, I need the total to show up in a separate text box. I keep getting a NaN message in the text box.Here's the code I have so far:
//item 1
sliderOne.width = 600;
sliderOne.value = 0;[code].....
I need to save email-id in my login form through the cookies. if I use shared object I am able to save but my requirement is need to save in cookies. How can I save? I got sample code from net. Attaching that code `package com {
import flash.external.ExternalInterface;
/**
* The Cookie class provides a simple way to create or access
* cookies in the embedding HTML document of the application.
[Code].....
I need to be able to compare the number of whole days between two dates in ActionScript, is this possible? I'd like to test if one date is 7 days or less after today, and if so is it one day or less (if it's before today this also counts).The workaround I have in place is using the .time part of the date field:
// Get the diffence between the current date and the due date
var dateDiff:Date = new Date();
dateDiff.setTime (dueDate.time - currentDate.time);[code].....
As I say - this is only a workaround, I'd like a permanent solution to allow me to check the number of whole days between 2 dates. Is this possible?
I'm building a little application in AS3 but I need to get variables from PHP. I searched on the internet on how I should do that. It makes the connection, but it doesn't get the variables. It just prints whole my php script.
[Code]...
I think this should not be a big deal, but I do not get it to work. I got a "MainFlash" witch loades an XML with about 60 variables (Settings), in base of a paramater then this "MainFlash" loades another "FlashMovie" and this one needs, all, the same Variables too.
How do I properly pass all the Vars in the new/other "FlashMovie"?
U need to know I use LoadMovieNum to Level 0 I do replace the "MainFlash", cause the new loaded "FlashMovie" can have a completly different height and width ( ...I don't think it's possible to change the Document-Setting in a compiled swf, or is it? If this is possible I would not need to load a separate swf to Level 0. the main SWF usually ist about 320x180, the following can be 2x, 3x bigger...
var navChildXml:XML = <subpoint>
<text>XML(_nodes[prop].childNodes[inc].title)</text>
<link>XML(_nodes[prop].childNodes[inc].title)</link>
</subpoint>;
how to in this instance
the vars are not being declared
I've created a Flash interface that sends variables to PHP to place in MySQL.In Flash I have the following AS2 (abbreviated) ..
myVars=new LoadVars();
submit_btn.onRelease=function() {
myVars.username=_root.username;[code]..........
Invariably the else statement is deployed and a new record is inserted into the database even when the username and passwords (md5 encrypted) are identical. I've been on PHP forums and nobody has a solution, so I'm wondering if this is a Flash issue. Perhaps even though the username and password in MySQL 'appear' identical to what's submitted by Flash and md5 encrypted they're really not for some reason. I tried trim() and stripslashes() to no avail.
I have set something up for my flashvars. I have a form in html which accepts two inputs. This is then sent to this php page
[Code]...
how can I do this trick and keep different vars for each mc?
for(var i=0; i<arr.length; i++) {
var mc[i] = _root.createEmptyMovieClip('mc'+i, _root.getNextHighestDepth());}
i have two swf files, a preloader witch loads main.swf
in preloader on the maintimeline i set this var
var lang:String = "de";
but i cant trace it in my main.swf
trace(root.lang);
how do i get this var?
this should be simple as nothing but i just need to get a clearer picture here my PHP has this as final line
[Code]...
where $newPics is a number what do I insert in AS code to to retrieve that variable and store it as an AS variable?
I've surfed for days to find a solution to this. There are a jillion out there, but I haven't found one that works. Suppose I have the following
<?php
header('location:http://www.sleepydad.com?firstName=s...ame=dad');
// the above URL will house my Flash movie
?>
I need to get the values of firstName and lastName into my Flash movie to save as variables (ultimately LoadVars()) and pass as an ID for some MySQL tasks performed in my Flash movie. NOTE the value of the names are not constant (ie sleepy dad). They will change with login - each user having a unique name. I've tried modifying the javascript in my HTML - some.swf?firstName=firstName (in both Object & Embed Tags)
[Code]....
I am working on a project that uses PHP , as3, and possibly some AMFPHP.
The project allows users to upload and download images among other things. I have been trying to gather as much info about making things as secure as possible. I've got some good advise about using .htaccess files, and a few other tricks.
My main question at the moment is how to hide the "path" info from and to the PHP / assets / and to and from the AMFPHP sevices ...
Currently I have all the paths hard-coded in one .as that returns an object with the paths to any of the other classes that need/request it. I found this method to work well since I only need to change this one .AS , and it will branch out to the other classes that need it.
I'm not super worried about others decompiling my code, and they could probably "sniff" out the paths if they really wanted. I'm mostly concerned with allowing others easy access to all of my AMFPHP services or being allowed to parts of the site I do not wish them to be. basically I realize that things aren't gonna be 100% secure regardless, but would like to take precautions.
So to cut to the chase ... Whats the best- simplest way to obscure / hide the paths being used in a PHP - AS3 project ? ... I entertained the possibly of PHP includes or even a SQL database if need be. I rather not spend a bunch of time and money on questionable obfuscator software, unless there's a tried and true one for flash (not flex). .. and I currently do not have a SSL but don't know how critical - common this is.