Trouble Passing Variables With Relative URL's
Just wondering if anybody's run into the same problem I have and if there's a fix. This is the code I am using: on (release) { getURL ("bframe2.html?csection=2&fname=../text_files/support_bframe.txt", "_self"); } I run the flash off my machine (not web server) and it only ever shows c:frame2.html in the address bar of my browser.
Yet when I use the following code: on (release) { getURL ("http://www.anysite.com/bframe2.html?csection=2&fname=../text_files/support_bframe.txt", "_self"); } I can run the flash movie on my machine and it will show the following in the address bar: http://www.anysite.com/bframe2.html?...ort_bframe.txt
Naturally the question I want to know is why wont it pass the variables to the browser when I reference a relative URL but work fine using an absolute URL? I have also tried using: on (release) { getURL ("c:frame2.html?csection=2&fname=../text_files/support_bframe.txt", "_self"); } But the variables don't pass to the web browser(sorry about the slightly misleading title). I've also tried using the "POST" and "GET" options for getUrl but no luck there either.
The flash will be running of a web server, but it's a lot easier and nicer to test when running off of your own machine.
Any help will be greatly appreciated. I've searched the forumns and macromedia's site for an answer but if I missed please point me in the correct direction.
Thanks, Johannes
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-26-2001, 09:13 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Trouble Passing Variables From PHP To AS3
I'm trying to learn how to do server interaction with AS3 (I'm very new to AS3) and am having trouble passing variables.
I wrote a very simple PHP script:
<?
for($i = 0; $i <= 4; $i++){
$returnString .= 'answer' . $i . '=5&';
}
echo $returnString
?>
...and a very simple AS3 script:
import flash.events.*
import flash.net.*
var request:URLRequest = new URLRequest("http//...thescript.php");
request.method = URLRequestMethod.GET;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.load(request);
function completeHandler(evt:Event){
var answer = evt.target.data.answer1;
trace(answer);
}
but when I run the Flash, I get an "Error #2101: The String passed to URLVariables.decode() must be a URL encoded query string containing name/value pairs."
The output looks fine when I open the PHP in a browser.
Any help would be appreciated.
Thanks
John
Still Having Trouble Passing Variables
So, I read some on the MVC as my problem in my previous post was trying to pass variables between classes in the same package. I've got three classes, ListLoader, SectionPanel and TagWidget... MVC respectively. Or at least I think I've set them up that way. ListLoader is responsible for querying the db via PHP when TagWidget asks it to and then supplies a string variable. I'm trying to get TagWidget to pass that variable to the viewer/SectionPanel to display in a textfield but can't seem to get ListLoader to reflect that. Now, the problem is in how I've formatted ListLoader, I believe so I'll only show that class and just know that TagWidget is calling the variable using "trace(loadFTPList.fulllist);" where loadFTPList is the instance name of ListLoader. What am I doing wrong?
Here is my class in question:
Attach Code
class ListLoader {
public var isLoaded:Boolean=false;
public var record:String;
public var fulllist:String;
public function ListLoader() {
//trace("ListLoader instantiated");
}
public function getList(listURL:String):void {
var urlVars:URLVariables=new URLVariables;
var urlReq:URLRequest=new URLRequest(listURL);
var loader:URLLoader=new URLLoader;
loader.addEventListener(Event.COMPLETE,completeHandler);
function completeHandler(event:Event) {
trace("XML loaded");
isLoaded=true;
XML.ignoreWhitespace=true;
var loadedXML:XML=new XML(event.target.data);
loader.close();
loader.removeEventListener(Event.COMPLETE,completeHandler);
if (listURL == "http://somescript.php") {
//trace("is ftp");
processFtpXML();
} else if (listURL == "http://someOtherscript.php") {
//trace("is phones");
processPhoneXML();
} else {
//trace("is clients");
processClientXML();
}
function processFtpXML() {
for each (var item in loadedXML.record) {
record+= item.company + " ";
record+= item.un + " ";
record+= item.pw + "
";
}
fulllist = record;
}
function processPhoneXML() {
for each (var item in loadedXML.record) {
record+= item.fname + " ";
record+= item.lname + " ";
//record+= item.title + " ";
record+= item.cell + " ";
record+= item.ext + " ";
record+= "<a href='mailto:" + item.email + "@somesite.com'>" + item.email + "@somesite.com </a>
";
}
}
function processClientXML() {
for each (var item in loadedXML.record) {
record+= "Client: " + item.client + "
";
record+= "Subclient: " + item.subclient;
}
}
}
urlReq.method=URLRequestMethod.POST;
urlReq.data=urlVars;
urlVars.action="listAll";
loader.load(urlReq);
}
}
Trouble Passing Variables
What Am I doing wrong??? Here is a section of code I've used to pass a variable to a php file
Code:
genreType = "Classic Rock";
this.bands_xml.URL = "genre.php?category="+genreType;
this.bands_xml.trigger();
and here is the section of code in the recieving the variable
PHP Code:
$key = $HTTP_GET_VARS[category]; //this line selects all fields from the table band_directory$resultActive = mysql_query("SELECT * FROM band_directory WHERE (primaryID = ".$key." OR secondaryID = ".$key.") AND status = 'Active'");
when I did not pass the variable and set primaryID and secondaryID to Classic Rock The flash file worked. now it doesn't. Any imput would be appreciated. I would be happy to explain further what I am doing if neccesary
Trouble Passing Variables
I’m having trouble passing variables.
I’d paste some code, but don’t know if that’s really the best way to explain the problem since I’m using multiple packages.
…so instead here’s the hierarchy:
DocClass > Game > moveX
DocClass > Stars > Star > varX
How can I pass the value of moveX to varX?
I the old way would simply be varX = _parent._parent.Game.moveX
…but now that throws up a “1119: Access of possibly undefined property Game though a reference with a static type flash.displayIsplayObjectContainer” error.
Don’t get it…yet
Please help!
Trouble Passing Variables From Js To Swf From Another Page
Hi,
I'm using ExternalInterface to pass javascript variables to my swf file, when the javascript and the swf are in the same html page, everything works perfectly. The trouble comes when I try to send this variable through the URL to control a swf located in another page.
Here's my as3 code :
Code:
if(ExternalInterface.available)
{
try
{
ExternalInterface.addCallback("next", goNext);
}
catch(e:Error){}
}
function goNext(value:String)
{
//traceTextField.text=value;
gotoAndPlay(value);
}
and in the page 1 (from which I want to send the variable) :
an html link :
<a id="link1" onclick="javascript:window.location='page2.html?pa ge2';">
the page2 is the parameter I want to send to the swf of the second page so this one goes directly to the "page2" label in the timeline.
In my "receiver" page2 here's the js code that allows me to catch the parameter from the URL:
Code:
<script>
function getParams()
{
var idx = document.URL.indexOf('?');
var pairs;
if (idx != -1)
{
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
pairs=pairs.toString();
alert(pairs);
gotoNext(pairs);
}
return pairs;
}
pairs = getParams();
function thisMovie(movieName)
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
return window[movieName];
}
else
{
return document[movieName];
}
}
function gotoNext(value)
{
thisMovie("myFlash").next(value);
}
function gotoPrev(value) {
thisMovie("myFlash").previous(value);
}
</script>
the 'page2' parameter is caught (I've checked with the alert),
the problem is that it isn't sent to the swf, that's where I'm something wrong...
Thanks in advance for your help
Trouble Passing Variables From Js To Swf From Another Page
Hi,
I'm using ExternalInterface to pass javascript variables to my swf file, when the javascript and the swf are in the same html page, everything works perfectly. The trouble comes when I try to send this variable through the URL to control a swf located in another page.
Here's my as3 code :
Code:
if(ExternalInterface.available)
{
try
{
ExternalInterface.addCallback("next", goNext);
}
catch(e:Error){}
}
function goNext(value:String)
{
//traceTextField.text=value;
gotoAndPlay(value);
}
and in the page 1 (from which I want to send the variable) :
an html link :
<a id="link1" onclick="javascript:window.location='page2.html?pa ge2';">
the page2 is the parameter I want to send to the swf of the second page so this one goes directly to the "page2" label in the timeline.
In my "receiver" page2 here's the js code that allows me to catch the parameter from the URL:
Code:
<script>
function getParams()
{
var idx = document.URL.indexOf('?');
var pairs;
if (idx != -1)
{
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
pairs=pairs.toString();
alert(pairs);
gotoNext(pairs);
}
return pairs;
}
pairs = getParams();
function thisMovie(movieName)
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
return window[movieName];
}
else
{
return document[movieName];
}
}
function gotoNext(value)
{
thisMovie("myFlash").next(value);
}
function gotoPrev(value) {
thisMovie("myFlash").previous(value);
}
</script>
the 'page2' parameter is caught (I've checked with the alert),
the problem is that it isn't sent to the swf, that's where I'm something wrong...
Thanks in advance for your help
Trouble Passing Variables From Js To Swf From Another Page
Hi,
I'm using ExternalInterface to pass javascript variables to my swf file, when the javascript and the swf are in the same html page, everything works perfectly. The trouble comes when I try to send this variable through the URL to control a swf located in another page.
Here's my as3 code :
Code:
if(ExternalInterface.available)
{
try
{
ExternalInterface.addCallback("next", goNext);
}
catch(e:Error){}
}
function goNext(value:String)
{
//traceTextField.text=value;
gotoAndPlay(value);
}
and in the page 1 (from which I want to send the variable) :
an html link :
<a id="link1" onclick="javascript:window.location='page2.html?page2';">
the page2 is the parameter I want to send to the swf of the second page so this one goes directly to the "page2" label in the timeline.
In my "receiver" page2 here's the js code that allows me to catch the parameter from the URL:
Code:
<script>
function getParams()
{
var idx = document.URL.indexOf('?');
var pairs;
if (idx != -1)
{
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
pairs=pairs.toString();
alert(pairs);
gotoNext(pairs);
}
return pairs;
}
pairs = getParams();
function thisMovie(movieName)
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
return window[movieName];
}
else
{
return document[movieName];
}
}
function gotoNext(value)
{
thisMovie("myFlash").next(value);
}
function gotoPrev(value) {
thisMovie("myFlash").previous(value);
}
</script>
the 'page2' parameter is caught (I've checked with the alert),
the problem is that it isn't sent to the swf, that's where I'm something wrong...
Thanks in advance for your help
Trouble With Passing Variables Into Movie Clips
Hi there,
I know there's a wealth of information about loading variables on Flashkit, but I'm still stumped here. Ok from the top :
I'm using Flash 5. I'm loading some variables from a text file into the root of my movie. The user then fills out a form which processes the external variables, hence creating a new set. There is also a separate one-field form on the same page, which the user may fill in if he wishes to email the results to himself, with a button to send to an external ASP file.
The problem lies here - I want the email form to be a separate movie clip, as it behaves on a different timeline from the initial form. However, I'm having a nightmare trying to pass the processed variables into this Movie Clip. I could, of course, adapt the root timeline and have all operations at the root; but that's wimping out. And, of course, you never learn anything unless you persevere.
And I imagine the answer is simple, and I'll take no pleasure in kicking myself when it is presented. Oh well.
Love Osca xxx
Trouble With Loading A Relative Link In An Other Frame
i created a full menu with 7 buttons,
each button should open a new html page in the frame UNDER the frame where the flash menu is loaded.
i thought the command should be:
on (release) {
getURL("pages/home.htm", "kirupa");
}
but nothing happens
if i change the url name into a http://blablabla/pages/home.htm
it works fine, but if i use this relative link it won't work,
anybody an idea?
Trouble With Loading A Relative Link In An Other Frame
i created a full menu with 7 buttons,
each button should open a new html page in the frame UNDER the frame where the flash menu is loaded.
i thought the command should be:
on (release) {
getURL("pages/home.htm", "kirupa");
}
but nothing happens
if i change the url name into a http://blablabla/pages/home.htm
it works fine, but if i use this relative link it won't work,
anybody an idea?
Loading Variables With A Relative Path
Hi!
I´d like to know how do I have to write the relative path to get a .txt that is placed in another folder. This is, inside my project folder there's another one called "texts" that includes several .txts
If I write:
loadVariablesNum ("\texts\mytext.txt", 0);
it works when publishing if I open it with Netscape , but it doesn´t when using IExplorer
How can I solve this??
Any good idea?
Trouble Passing Variable
Okay Here is what I am trying to do. I have an HTML form that i would like to recreate in flash. Here is a link to my HTML version
http://www.beyondthetv.com/reno_search_form/index.html
this form passing some hidden fields and variables to a php search function. The search from returns the results of what you entered into the text fields.
I would like to do the same thing in flash. Here is what i got so far in my action script.
I am also adding this line of code to my param with in my embed code and object code
<param name="movie" value="sandeigosearch.swf?<?php echo(urlencode($keywords));?>" />
I am not sure exactly what i need to do or if i am going about it in the wrong way.
Attach Code
var link:URLRequest = new URLRequest("http://localsearchpartners.com/locallookup/search.php");
var keywords:String;
var city:String;
var keyword_txt: TextField = new TextField();
keyword_txt.x = 304;
keyword_txt.y = 61;
keyword_txt.autoSize = TextFieldAutoSize.LEFT;
var location_txt: TextField = new TextField();
location_txt.x = 496;
location_txt.y = 61;
location_txt.autoSize = TextFieldAutoSize.LEFT;
search_btn.addEventListener(MouseEvent.CLICK,onClick);
function onClick(event:MouseEvent):void
{
addChild(keyword_txt);
keywords = keyword_txt.text;
addChild(location_txt);
city = location_txt.text;
navigateToURL(link);
}
search_btn.buttonMode = true;
sendVars = new LoadVars();
sendVars.keyword_txt = "keywords";
sendVars.location_txt = "location";
sendVars.send("http://localsearchpartners.com/locallookup/search.php", "POST");
Passing Variable Trouble
I have created a few arrays in a frame and am trying to pass a variable from the main array to choose a second array by passing a variable using a function after a button is clicked. I use this code to select the name of the new array:
_root.m1[name].menuTwoID = homeMenu[0];
from this array
var homeMenu:Array = [["residential", "resMenu"], ["commercial", "comSubMenu"],.....
That should produce a passed variable "resMenu" correct?
It doesn't work later later in a new function when I put it into:
_root.m2[name].main_text.text = menuTwoID[count-1][0];
to get the names from the second array.
If I put "resMenu" directly in the code (below) it works fine.
_root.m1[name].menuTwoID = resMenu;
Any ideas of what I'm doing wrong?
Thanks
Passing Variable Trouble
I have created a few arrays in a frame and am trying to pass a variable from the main array to choose a second array by passing a variable using a function after a button is clicked. I use this code to select the name of the new array:
_root.m1[name].menuTwoID = homeMenu[0];
from this array
var homeMenu:Array = [["residential", "resMenu"], ["commercial", "comSubMenu"],.....
That should produce a passed variable "resMenu" correct?
It doesn't work later later in a new function when I put it into:
_root.m2[name].main_text.text = menuTwoID[count-1][0];
to get the names from the second array.
If I put "resMenu" directly in the code (below) it works fine.
_root.m1[name].menuTwoID = resMenu;
Any ideas of what I'm doing wrong?
Thanks
Passing Variable Trouble
I have created a few arrays in a frame and am trying to pass a variable from the main array to choose a second array by passing a variable using a function after a button is clicked. I use this code to select the name of the new array:
_root.m1[name].menuTwoID = homeMenu[0];
from this array
var homeMenu:Array = [["residential", "resMenu"], ["commercial", "comSubMenu"],.....
That should produce a passed variable "resMenu" correct?
It doesn't work later later in a new function when I put it into:
_root.m2[name].main_text.text = menuTwoID[count-1][0];
to get the names from the second array.
If I put "resMenu" directly in the code (below) it works fine.
_root.m1[name].menuTwoID = resMenu;
Any ideas of what I'm doing wrong?
Thanks
Trouble Passing Variable To Netscape
I am having trouble passing a variable into netscape can anyone help me out? This works fine in IE:
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=6,0,29,0" width="295" height="450">
<param name="movie" value="/InnerPageMenu.swf?sectionID=caseStudy">
<param name="quality" value="high">
<param name="swLiveConnect" value="true">
<embed SRC="/InnerPageMenu.swf"
QUALITY="high"
SWLIVECONNECT="true"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"
TYPE="application/x-shockwave-flash"
WIDTH="295"
HEIGHT="450"></embed></object>
I am simply trying to pass the sectionID variable into flash and it wont work in Netscape. It appears everything is right. It works in IE.
Thanks!
Trouble Passing Variable To Swf From Html
I thought I had this problem figured out, but I don't. I'm using FlashMX. I have the following code in my html..
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="150" height="500">
<param name="movie" value="flash/nav.swf?pagename=refs">
<param name="quality" value="high"><br>
<embed src="flash/nav.swf?pagename=refs" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="500"></embed></object>
I have a frame label called "refs" in my main movie timeline.
in frame one I have an action gotoandstop(pagename)
THe action is completely ignored by the swf. Am I supposed to first declare the variable in the swf as well? or somehow "get" the variable? should I consider the variable "pagename" in the swf a "label" or an "expression" I just don't get what I'm missing. THanks for helping.
Trouble Passing String Var Into Function
im making a function that limmits text to a specified number...
only problem is i cant seem to pass in the text var that contains the text
any help would be awesome.
thanks in advance
ActionScript Code:
var textF1:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam neque purus, aliquam sed, sagittis tincidunt, adipiscing ac, urna. Ut libero urna, nonummy sodalesxxx";function TrimText(limmit:Number, area, textVar) { var lengthF1:Number = [textVar].length; trace(lengthF1); var charLimmit:Number = limmit; for (var i:Number = 0; i<=charLimmit; i++) { trace(i); if (i == 0) { textcut = [textVar].charAt(i); } else { textcut += [textVar].charAt(i); trace(textcut); if (i == charLimmit && lengthF1>=charLimmit) { textcut += "..."; _root[area].text = textcut; trace(area); } else { _root[area].text = textcut; } } }}TrimText(160,"texttest",textF1);
[F8] Passing An Object Datatype To Class, Trouble
I wrote this class yesterday and today I'm trying to add a little more to it. What it does it takes an array of movie clip instance names and it will make them invisible and then, in random order, reveal them on stage. At first I only had 1 transition, it either faded in or it didn't. But, I've imported the transitionManager and I'm using it to add some different transitions for the clips. The problem is I'm trying to clean up the class and I can't figure out a way to pass the name of the transition to the class and have it picked up as an object but not converted to a string. When I call my class:
var images:randomlyShowImages = new randomlyShowImages(thumbs, 1, true, 'Wipe');
I pass the las param as the transition type. If I put quotes around it like above it becomes a string inside the class. If I don't put quotes then it shows up undefined even if I change the datatype inside the class to an Object. You'll see in the class that I've got a switch to figure out what transition it is and then run a function. I'd like to be able to move that switch inside of my get _nTransitionType function then only have one transition function that knows what transition to play. Any suggestions?
PHP Code:
import mx.transitions.*;
import mx.transitions.easing.Strong;
class com.mneil.menu.randomlyShowImages {
private var _sObj:Array;
private var _nDuration:Number;
private var _nTransition:Boolean;
private var _nIntervalId:Number;
private var _whichImage:Number;
private var _nTranType:String;
private var i:Number;
private var d:Object;
function get object():Array{
return _sObj;
}
function get duration():Number{
return _nDuration;
}
function set duration(nDuration:Number):Void{
_nDuration = (nDuration != undefined)? nDuration*1000 : 1000;
}
function get transition():Boolean{
return _nTransition;
}
function set transition(nTransition:Boolean):Void{
_nTransition = (nTransition)? nTransition : false;
}
function get tranType():String{
return _nTranType;
}
//If I could run the switch up here and then either give _nTranType a transition property or set another property that would tell me which transition they want.
function set tranType(nTranType:String):Void{
_nTranType = (nTranType != undefined)? nTranType : 'Fade';
}
///////////////////////////////////////////////////////////////////
/* Constructor for randomlyShowImages Class
sObj: Array - The movie clips that are to be randomly shown
nDuration: Number - A number specifying how many seconds to wait between showing each image
nTransition: Boolean - optional - Determines which type of transition to use to bring the images in
nTranType: String - optional - If set will determine type of tranition to use available from the TransitionManager
*/
function randomlyShowImages(sObj, nDuration, nTransition, nTranType){
_sObj = sObj;
duration = nDuration;
transition = nTransition;
tranType = nTranType;
hideImages();
start();
}
function hideImages():Void{
for(i=0; i<=_sObj.length; i++){
_sObj[i]._visible = false;
}
}
function start():Void{
this._nIntervalId = setInterval(this, "showImages" , _nDuration );
}
function showImages():Void{
_whichImage = Math.floor(Math.random()*_sObj.length);
(_nTransition)? doTransition():dontTransition();
if(_sObj.length == 0){
end();
}
}
//Here's the switch I'd like to move.
function doTransition(){
switch(_nTranType){
case 'Fade': fade(); break;
case 'PixelDissolve': pixelDissolve(); break;
case 'Wipe': wipe(); break;
case 'Rotate': rotate(); break;
case 'Blinds': blinds(); break;
case 'Fly': fly(); break;
case 'Photo': photo(); break;
case 'Squeeze':squeeze(); break;
case 'Zoom': zoom(); break;
case 'Iris': iris(); break;
default: fade(); break;
}
_sObj.splice(_whichImage,1);
}
function dontTransition(){
_sObj[_whichImage]._visible = true;
_sObj.splice(_whichImage,1);
}
function end():Void{
clearInterval(_nIntervalId);
}
// I want to get rid of all these functions and only start 1 transition manager and put a variable in the type: property field.
function fade(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Fade , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function pixelDissolve(){
d = new TransitionManager.start(_sObj[_whichImage], {type:PixelDissolve , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function wipe(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Wipe , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function rotate(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Rotate , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function blinds(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Blinds , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function fly(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Fly , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function photo(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Photo , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function squeeze(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Squeeze , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function zoom(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Zoom , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
function iris(){
d = new TransitionManager.start(_sObj[_whichImage], {type:Iris , direction:0, duration:_nDuration/150, easing:Strong.easeOut, xSections:20, ySections:20});
}
}
I know this is a lot to go through but I'd greatly appreciate any help.
Trouble Passing Form Field Data To Asp Email
Hello all,
I am building an form in an AS3 swf which I'd like to validate and send form feild data to an asp server side file (order.asp) which will send the info via email. The swf will validate the data, but not send the data to asp.
I have a test form working in html to validate the asp, but I need to have it work from the AS3 swf. The code that I am using is posted below. Any help would be greatly appreciated!
stop();
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
// ----------------------------------------------------------------
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("order.asp");
var varLoader:URLLoader = new URLLoader;
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
status_txt.text = "";
submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
function ValidateAndSend(event:MouseEvent):void{
//validate form fields
if(!yn1.length) {
status_txt.text= "Please answer .1";
} else if(!yn2.length) {
status_txt.text = "Please answer .2";
} else if(!yn3.length) {
status_txt.text = "Please answer .3";
} else if(!yn4.length) {
status_txt.htmlText = "Please answer .4";
} else if(!yn5.length) {
status_txt.text = "Please answer .5";
} else if(!yn6.length) {
status_txt.text = "Please answer .6";
} else if(!yn7.length) {
status_txt.text = "Please answer .7";
} else if(!yn8.length) {
status_txt.text = "Please answer .8";
} else if(!dm.length) {
status_txt.text = "Please enter the month of your birth";
} else if(!dd.length) {
status_txt.text = "Please enter the day of your birth";
} else if(!dy.length) {
status_txt.text = "Please enter the year of your birth";
} else if(!acc_name.length) {
status_txt.text = "Please enter the name as it appears on your account.";
} else if(!phone.length) {
status_txt.text = "Please enter your phone number";
} else if(!address1.length) {
status_txt.text = "Please enter your mailing address";
} else if(!state1.length) {
status_txt.text = "Please enter your state";
} else if(!zip.length) {
status_txt.text = "Please enter your zip code";
} else if(!validateEmail(email.text)) {
status_txt.text = "Please enter a VALID email address";
} else if(!bank_name.length) {
status_txt.text = "Please enter the name of your bank.";
} else if(!bank_address.length) {
status_txt.text = "Please enter the address of your bank";
} else if(!check_number.length) {
status_txt.text = "Please enter a number";
} else if(!bank_state.length) {
status_txt.text = "Please enter in what state your bank is located";
} else if(!bank_zip.length) {
status_txt.text = "Please enter the zip code for your bank";
} else if(!routing_number.length) {
status_txt.text = "Please enter your routing number (located in the bottom left of your check)";
} else if(!account_number.length) {
status_txt.text = "Please enter your bank account number";
} else {
status_txt.text = "Your Order has been processed, you will be contacted for vailidation purposes... " + acc_name.text + ", your order has been sent!";
gotoAndStop(2);
}
}
function validateEmail(str:String):Boolean {
var pattern:RegExp = /(w|[_.-])+@((w|-)+.)+w{2,4}+/;
var result:Object = pattern.exec(str);
if(result == null) {
return false;
}
return true;
}
Help: Passing Variables (180 Variables) To Function
hi
if i have call function like this
Math.findMax(app1, app2, app3, app4, app5, app6, app7, app8, app9, app10, app11);
but the values i have to app180
i don't want to write all this
Math.findMax(app1, ... , app180); //!!??
how i can to called the function from app1 to app180
Math.findMax(FROMapp1, ... , TOapp180);
thanx
Trouble Loading A Text File When Passing The Variable In The URL String
I am trying to load variables into Flash from a text file. I pass the name of the text file as a variable in the URL string and then use that variable in the loadVariables command to pull in the text file. It works fine locally but is unreliable up on the server.
I seem to have got past this problem by moving the action to frame 2 from frame 1.
Has anyone else experienced problems with this and has found a better resolution?
Trouble Passing Argument Values To GetURL For A Java Popup. Help Please
wassaaaaap!
Hey I'm trying to write a function where I pass argument values to a getURL for a javaScript popUp. The argument values are making it to the function okay but then when I try to put some valuables into the getURL for the popUp it's not working. Here is what I got:
Code:
function popUpURL(name1,name2)
{
trace("popUpURL has been called "+[name1]+", "+[name2]);
var url_a = ["a"+name1+".html"];
var url_b = ["b"+name2+".html"];
trace("this is url_a = "+url_a);
trace("this is url_b = "+url_b);
var alphaA = _root[name1]._alpha;
var alphaB = _root[name2]._alpha;
if(alphaA > alphaB)
{
trace("alphaA > alphaB");
getURL("javascript:NewWindow=window.open(url_a,'myWindow','width=750,height=560,left=100,to p=100,toolbar=No,location=No,scrollbars=No,status= No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
}else{
trace("alphaB > alphaA");
getURL("javascript:NewWindow=window.open(url_a,'width=750,height=560,left=100,to p=100,toolbar=No,location=No,scrollbars=No,status= No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
}
}
thanks so much for any help with this. it seems like everything is working except the popUp part. imma try some more stuff. if i figure it out i'll post back here too
Flash 8 - Trouble Passing Info In Array To Dynamic Text Field On Rollover
Hello,
I am trying to pass information to a many dynamic text fields when rolling over various movieclips that are generated using a loop. I have tried everything I know but can not get pahting to work prpoerly. The rollover works in that the curser changes by does not execute the lines of code within the in line function. Any help is greatly appreciated (see red, bolded text (towards bottom) for problem). the Attached zipped swf is what it looks like as is.
Code:
//how many floors are there in the building?
var floors:Number = 25;
//on each floor starting with the 1st, how many tenants to a floor (0-6)? - all entries must have quotes around them
var tenantAmt:Array = ["1", "1", "1", "6", "6", "6", "5", "5", "5", "5", "5", "5", "4", "4", "4", "4", "4", "3", "3", "3", "3", "2", "2", "2", "1", "1", "1", "1", "1", "1", "1", "2", "2", "1", "1", "1", "1", "1", "1", "1"];
// on each floor starting with the first, how many spaces are vacant (0-6)? - all entries must have quotes around them
var spaces:Array = ["1", "0", "1", "3", "2", "1", "5", "4", "3", "2", "1", "0", "4", "3", "2", "1", "0", "3", "2", "1", "0", "2", "1", "0", "1", "0", "0", "0", "0", "0", "0", "1", "0", "1", "0", "0", "0", "0", "0", "0"];
//change initial x or y coordinate to compensate for more or less floors
var ypos:Number = 550;
var xpos:Number = 50;
// change divider to space floors closer(increase value) or farther apart (decrease value)
var divider:Number = 1.75;
// change the height or width of the floors to compensate for more or less floors
var Xscale:Number = 100;
var Yscale:Number = 100;
var txtypos:Number = ypos;
var txtxpos:Number = xpos - 40;
var sftxtxpos:Number = xpos + 200;
//enter in SF by floor number
var floorTXT:Array = [
["201,265", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2", "5", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"],
["2,405", "5,896", "0", "8,888", "508", "10,891"]];
trace(floorTXT[0][0]);
var sfTextArray:Array = new Array();
for (var i:Number = 0; i < floors; i++)
{
if (tenantAmt[i] == "1")
{
this.attachMovie("single", "nFloor" + [i], i, {_xpos, _y:ypos});
ypos -= this["nFloor" + i]._height / divider;
this["nFloor" + i]._yscale = Yscale;
this["nFloor" + i]._xscale = Xscale;
this.attachMovie("dtext", "dtext" + [i], i + 100, {_x:txtxpos, _y:this["nFloor" + i]._y - 5});
this["dtext" + i].textformatting.text = i + 1;
this.attachMovie("sfText", "sfText" + [i], i + 1000, {_x:sftxtxpos, _y:this["nFloor" + i]._y+20 });
//trace(["dtext" +i]);
}
if (tenantAmt[i] == "2")
{
this.attachMovie("double", "nFloor" + [i], i, {_xpos, _y:ypos});
ypos -= this["nFloor" + i]._height / divider;
this["nFloor" + i]._yscale = Yscale;
this["nFloor" + i]._xscale = Xscale;
this.attachMovie("dtext", "dtext" + [i], i + 100, {_x:txtxpos, _y:this["nFloor" + i]._y - 5});
this["dtext" + i].textformatting.text = i + 1;
this.attachMovie("sfText", "sfText" + [i], i + 1000, {_x:sftxtxpos, _y:this["nFloor" + i]._y +20});
//trace(["dtext" +i]);
}
if (tenantAmt[i] == "3")
{
this.attachMovie("tri", "nFloor" + [i], i, {_xpos, _y:ypos});
ypos -= this["nFloor" + i]._height / divider;
this["nFloor" + i]._yscale = Yscale;
this["nFloor" + i]._xscale = Xscale;
this.attachMovie("dtext", "dtext" + [i], i + 100, {_x:txtxpos, _y:this["nFloor" + i]._y - 5});
this["dtext" + i].textformatting.text = i + 1;
this.attachMovie("sfText", "sfText" + [i], i + 1000, {_x:sftxtxpos, _y:this["nFloor" + i]._y+20});
//trace(["dtext" +i]);
}
if (tenantAmt[i] == "4")
{
this.attachMovie("quad", "nFloor" + [i], i, {_xpos, _y:ypos});
ypos -= this["nFloor" + i]._height / divider;
this["nFloor" + i]._yscale = Yscale;
this["nFloor" + i]._xscale = Xscale;
this.attachMovie("dtext", "dtext" + [i], i + 100, {_x:txtxpos, _y:this["nFloor" + i]._y - 5});
this["dtext" + i].textformatting.text = i + 1;
this.attachMovie("sfText", "sfText" + [i], i + 1000, {_x:sftxtxpos, _y:this["nFloor" + i]._y+20});
}
if (tenantAmt[i] == "5")
{
this.attachMovie("quint", "nFloor" + [i], i, {_xpos, _y:ypos});
ypos -= this["nFloor" + i]._height / divider;
this["nFloor" + i]._yscale = Yscale;
this["nFloor" + i]._xscale = Xscale;
this.attachMovie("dtext", "dtext" + [i], i + 100, {_x:txtxpos, _y:this["nFloor" + i]._y - 5});
this["dtext" + i].textformatting.text = i + 1;
this.attachMovie("sfText", "sfText" + [i], i + 1000, {_x:sftxtxpos, _y:this["nFloor" + i]._y+20});
//trace(["dtext" +i]);
}
if (tenantAmt[i] == "6")
{
this.attachMovie("sex", "nFloor" + [i], i, {_xpos, _y:ypos});
ypos -= this["nFloor" + i]._height / divider;
this["nFloor" + i]._yscale = Yscale;
this["nFloor" + i]._xscale = Xscale;
this.attachMovie("dtext", "dtext" + [i], i + 100, {_x:txtxpos, _y:this["nFloor" + i]._y - 5});
this["dtext" + i].textformatting.text = i + 1;
this.attachMovie("sfText", "sfText" + [i], i + 1000, {_x:sftxtxpos, _y:this["nFloor" + i]._y+20});
//trace(["dtext" +i]);
}
sfTextArray.push("sfText" + i);
if (spaces[i] == "1")
{
this["nFloor" + i].gotoAndStop("one");
}
if (spaces[i] == "2")
{
this["nFloor" + i].gotoAndStop("two");
}
if (spaces[i] == "3")
{
this["nFloor" + i].gotoAndStop("three");
}
if (spaces[i] == "4")
{
this["nFloor" + i].gotoAndStop("four");
}
if (spaces[i] == "5")
{
this["nFloor" + i].gotoAndStop("five");
}
if (spaces[i] == "6")
{
this["nFloor" + i].gotoAndStop("six");
}
}
// how do I write the below code w/o coping/pasting thousands of lines of code and to get the initial alpha properties to work correctly ?
nFloor[i].first1. _alpha = 0;
nFloor[i].second1._alpha = 0;
nFloor[i].third1._alpha = 0;
nFloor[i].fourth1._alpha = 0;
nFloor[i].fifth1._alpha = 0;
nFloor[i].sixth1._alpha = 0;
nFloor0.first1.onRollOver=function(){
this["nFloor"+[i]].first1._alpha = 100;
sfText0.gotoAndPlay("go")
sfText0.mtclip.text=floorTXT[0][0];
trace(_parent.sfTextArray);
}
first1.onRollOut = function()
{
sfText0.gotoAndStop("hold")
first1._alpha = 0;
trace("rollout");
};
second1.onRollOver = function()
{
second1._alpha = 100;
trace("rolled");
};
second1.onRollOut = function()
{
second1._alpha = 0;
trace("rollout");
};
third1.onRollOver = function()
{
third1._alpha = 100;
trace("rolled");
};
third1.onRollOut = function()
{
third1._alpha = 0;
trace("rollout");
};
fourth1.onRollOver = function()
{
fourth1._alpha = 100;
trace("rolled");
};
fourth1.onRollOut = function()
{
fourth1._alpha = 0;
trace("rollout");
};
fifth1.onRollOver = function()
{
fifth1._alpha = 100;
trace("rolled");
};
fifth1.onRollOut = function()
{
fifth1._alpha = 0;
trace("rollout");
};
sixth1.onRollOver = function()
{
sixth1._alpha = 100;
trace("rolled");
};
sixth1.onRollOut = function()
{
sixth1._alpha = 0;
trace("rollout");
};
Passing Variables To Swf
hi !
go here :
http://www.guistuff.com/tools/flashdrop/flashmenu.swf
then go here :
http://www.guistuff.com/tools/flashd...5&makenavurl4=
now can any body tell me what i have to do to the fla in order to send varibale to swf and make menu feilds dyanmically- also i want the variable comming from a db .
any help ?
suhailkaleem
Passing Variables
Owkee, me again
Hmm I have created a preloader with a movie that loops inside it. In that movie i calculate the percentage loaded and bytes loaded. These calculated values are stored in a variable called 'var4'.
Now is it possible to pass that variable 'var4' to the main movie ? And how do I fix this ?
Passing Variables
Is it possible to pass a variable from a buttonpush that is in an MC that needs to control the _root movie? In other words: rootmovie/MC/button -->variable assigned to control main (root) movie. For some reason I cannot get flash to recognize my requests....here is the code that I am using in the button:
on (release) {
var x = 5;
_root.gotoAndPlay ("monnonego");
}
Here is the code that asks the question, assigned to a keyframe (later down the root movie):
if (x == 3) {
gotoAndPlay ("profile", 34);
} else {
if (x == 4) {
gotoAndPlay ("portfolio", 34);
} else {
if (x == 5) {
gotoAndPlay ("contact", 34);
}
}
}
Any ideas?? Thanks in advanced!!
- Sigma
Passing Variables
I have some actionscript that doesn't work. I don't see what's wrong. Can anybody help me? It's about the towers of Hanoi. Here is my script:
var intaantal = AantalSchijven;
var intstart = 1;
var inteinde = 3;
function hanoi (n,intstartstaaf,inteindstaaf) {
if (n == 1) {
van = intstartstaaf;
naar = inteindstaaf;
trace(van);
trace(naar);
} else {
inttussenstaaf = ((6 - intstartstaaf) - inteindstaaf);
hanoi(n-1,intstartstaaf,inttussenstaaf);
van = intstartstaaf;
naar = inteindstaaf;
trace(van);
trace(naar);
//trace(inttussenstaaf);
hanoi(n-1,inttussenstaaf,inteindstaaf);
}
}
hanoi(intaantal,intstart,inteinde);
stop ();
I made a program in VB in the same way and the program works. In the program I use byval for the variable n. Maybe that's the reason why it doesn't work but what can I do?
Greetings,
Geerty.
PASSING VARIABLES TO CGI
I know this may have been answered before, but I cant seem to find it.
I need to know if anyone knows how to get Flash to pass variable info WITHOUT shifting the characters to their ASCII code... (i.e. a comma becomes %2C)
I have a cgi script (free, of course) that is looking for this:
data_order = "news,newscontent,tips"
whereas when i submit it from a flash form, it becomes this:
data%5Forder=news%2Cnewscontent%2Ctips
I'm sure someone out there has gotten this also.
Thanks in advance for any help or pointing me in the right direction.
KEEP FLASHING!
Passing Variables
Is there a way to pass a variable from one flash movie to another via a URL?
Kind of like http://www.website.com/page.html?score=30 … or something like that?
- FLASHmac
Passing Variables Instead Of Gas. Is This Possible?
I have a single frame movie as my start movie that I want to use to establish a variable. It's pretty much just saying
var exno = 2;
and then I load a movie.
When I trace it in the first movie, it's fine. It works. Great. But now I want the newly loaded swf movie to recognize this variable as well. How can I do that?
Any help would be appreciated.
Peter
Passing Variables
Movie1 (_level0) loads Movie2 to the same level. How can I pass a variable from Movie1 to Movie2? I know that it can be done by loading to a different level but is it possible when loading to the same level?
John
Passing Variables
is it possible to pass variables from movie to movie? If so, how would I go about it? thanks.
Passing Variables
i really want to pass variables to my flash movie via the url.
someone told me that if i do something like
asdfoi.swf?name=dog
then the name variable text field will show "dog"
this doesnt work.
can someone help me please
Passing Variables
I need to know how you pass variables to a swf, I know there is a way then you just have to add the variables name and it's value following the *.swf of the embed tag. But i forgot the syntax...
Can someone help please!!
Passing Variables
Hello all there!
I have created a countdown flashmovie, it counts from x seconds to zero. But the x differs from time to time, it depends on how many time is left.
What I would like to know: How can I pass a variable from my website to the flashmovie?? Propably simple but I need to know how!
Please help!
VinzZ
Passing Around Variables?
Ok so here is my question. I need to take an html form and pass the variables to a file and then have flash load those variables. I am looking for a tutorial or explanation so I can learn how to do this. Do I need a perl or php script to set and save these variables? I dont know? Anyway any help would be appreciated.
thanks
Carter
Passing Around Variables?
Ok so here is my question. I need to take an html form and pass the variables to a file and then have flash load those variables. I am looking for a tutorial or explanation so I can learn how to do this. Do I need a perl or php script to set and save these variables? I dont know? Anyway any help would be appreciated.
thanks
Carter
Passing Variables ((HELP))
I'm having trouble passing a variable from one text field to another. I have a password protected site where the user must put in his/her userName and password. If the password is correct, I want it to read "Welcome, userName.
userName is the variable name for my input text field in frame 1.
user is the variable name for my dynamic text field name in frame 3.
frame1:
var userName = "";
var user = "";
user = "userName";
stop ();
//this is my latest attempt to pass the name the user puts in to an empty text field called user in frame 3. Needless to say, its not working.
Anyone have any suggestions????
HELP - Passing Variables
Can anyone tell me how to pass a variable from the main limeline (level0) to a variable in a movie?
I've tried targetting the movie directly, but that isn't working.
Here's the code I have:
In my text file i have the following:
url=movies/slow.swf
On the main time line:
loadvariables("url.txt", 0)
In the movie:
x = level0.url
It keeps telling me that x is undefined.
Passing Variables?
I need to do something like this:
1st Screen of the Movie, asks user to input name in a form field.
2nd Screen says Welcome (*user) To My Website..etc.
how do I do this?
Passing Variables From Swf To Swf
I am designing a page with multiple .swf files on it. The main reason that I have decided to compose them outside of Flash (in html) is to still be able to use the right-click zoom feature of the flash player. I have a map in the upper left hand corner of my html page (it is a separate .swf file). I have a panel of buttons, also in a separate .swf file, on the right side of the screen. I also have a descriptive panel below the map. Here is the problem. I need to be able to have buttons in one of the .swf files communicate to another .swf, the map. I want the buttons to be able to send the map .swf to a certain frame. I also need to communicate from the map to the descriptive .swf. How can one .swf file tell another what to do when they are both contained separately in an html file?
Thanks for the help.
Passing Variables
Well, Well. Sitting here trying to create a Quiz game, but its not easy as a beginner.
Since I want to have quite alot of pictures in my game, I have tried to use LoadMovie. But how do you do to make the variables "move" to the next .swf file. I have tried the "send with GET" but can't get it working.
I made a variable score=5; for example, and in the next .swf movie I want to increase it by putting score=score+10;, How should I do?
By the way, do anyone know if you can export and import scenes?
Passing Variables HELP
I know this question probably has been posted a thousand times and all the ones I've read haven't helped me.
I have 2 swf files...
the first one has an input textbox with a variable "name"
I also have a button that links to another frame. On that frame has a loadMovieNum ("test.swf", 10);
Passing Variables From An ASP To A SWF
I have a ASP that checks for the Username and password. If the password is correct it writes a new page and calls a function from another ASP which opens a control pannel on the new page. I have a button in a flash menu that is called from the 1st asp. There is a button that I want to have open a new page with the control panel. I don't want to make the user login twice. How can I grab the output data (Name, Login or Unumber) and pass the variable thru a flash Button?
I know this sounds confusing, but there must be an easy way. If you need more info for you to help me, please feel free to e-mail me at quince@quincewyss.com
Thank you,
Quince Wyss
Passing Variables On?
I am putting together a CD-ROM that contains several 'Quick-tests'. These have been provided to me by thew client as seperate FLA files. What they want me do do for a section of the CD is have the user run through all the test and then in the final one generate results based on the variables right/wrong given by each test (which is a separate SWF)
Is there a way of gathering these variables and then displaying them at the end???
Or could I load the SWF's intom a host movie and somehow have the host movie store the variables for me?!
Or is the only way to combine the FLA's all into one????
Suggestions welcome?!
|