Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Sending Multiple Types Of Variables To A Function


Hello Community!

I know that it is possible to feed more than one variable to a function -- even if the variables are of different types (the attached code works if I take away all references to the MouseEvent; that is, if I only pass the a, b, and c variables to the function). My question is, can I make this work when I also want to pass a MouseEvent variable to the function as well? In other words, is it possible to place something in the spot where I have the "???" that satisfies the functions demand for an answer to the MouseEvent? I have tried "null", "void", and "undefined" but these do not work.

Any input would be appreciated.

-john







Attach Code

var a:String = "a";
var b:uint = 3;
var c:Array = new Array("apples", "oranges", "kiwi");
function moreThanOneVar(a:String, b:uint, c:Array, me:MouseEvent):void {
trace(a);
trace(b);
trace(c);
trace(me.currentTarget.name);
};
moreThanOneVar(a, b, c, ???);
this.myButton.addEventListener(MouseEvent.CLICK, moreThanOneVar);




Adobe > ActionScript 3
Posted on: 08/15/2008 02:29:14 AM


View Complete Forum Thread with Replies

Sponsored Links:

SendAndLoad(); - Sending Multiple Variables
Hey there,

Currently I am sending XML Data to a PHP Script that writes this data to an XML File.

What I would like to do is to be able to send a 'User ID' with the XML sendAndLoad Data so that the PHP Script will write the XML File into a folder based on the User ID.

How can I achieve this?

ActionScript Code:
xmlData.sendAndLoad("php/delete.php",xmlData,"POST");




PHP Code:



<?php    $xmlFileName = "../simple_edit.xml";    $xmlDataFromFlash = file_get_contents("php://input");         print $xmlDataFromFlash;         $fp = fopen($xmlFileName, "w");    fwrite($fp, $xmlDataFromFlash);    fclose($fp);?>

View Replies !    View Related
Tweener - Sending In Multiple Options Through A Function
I'm trying to send in a set of options to tween from one function to another. For example:

Say I have an array or object called 'options' which should contain: x:10, y:42, alpha:0

and then I want to send the set of options to this function:


Code:
public static function DestroySprite(obj:Sprite, options):void {
Tweener.addTween( obj, { options, time:1, transition:"easeOutQuint", onComplete:DestroySpriteAfter, onCompleteParams:[obj]} );
}
I want to be able to send different options in other circumstances, such as only sending alpha, or only sending x & y. How would I do this?

View Replies !    View Related
Sending Variables To Multiple Attached Clips, Help? :)
Hi, got a question for you guys and girls : )

I have a flash website im making and its set up like so:

Main.fla has a bunch of attached movie which are a series of other .fla files.

Say one of those files gets data from a database via ASP. I can manipulate the loaded variables in that file so thats all good.

Heres the issue, How do my other attached movie clips (files) get the loaded variables with out requesting the data from the database again. I have been doing it thus far by sending the number of the record i want to retrieve from the database to the other files/attached clips and then loading the data again from the server. Which is not how i want to do it.

I would like to do something like this: Go through all of the database, or some section of it.. whatever, and load each record into a unique corresponding LoadVars object or some object, and then i guess make those objects global or reachable to all movieclips attached to _root.

The simplified operation i want to do is: You click on a button that has a title thats grabed from the database. Once you click, it loads up info about that "item" or whathave you, and then loads a image to go with it. The image url is in one of the variables of the items record on the database.

Sorry if this is obvious, i just wanted to explain what i want to do. Anyone know how to do these things? Im having trouble sorting it out and figuring out what commands can do what.
Thank you so very much, anything you got : )

View Replies !    View Related
Sending Function Variables To Root
I have some variables that i have loaded through a text field for defining colors in my site. My problem is that I do not know how to get the variables out of the function to the root. Here is my code


Code:
headerData = new LoadVars();
headerData.onLoad = function() {
title_txt.text = this.header;
bodyColor = this.colorPrimaryFill;
secondaryColor = this.colorSecondaryFill;
_root.secondaryColor = secondaryColor;
var colorPrimaryTrans:ColorTransform = new ColorTransform();
var transPrimary:Transform = new Transform(contentBody_mc);
transPrimary.colorTransform = colorPrimaryTrans;
colorPrimaryTrans.rgb = bodyColor;
transPrimary.colorTransform = colorPrimaryTrans;
};
trace(secondaryColor)// returns undefined

View Replies !    View Related
Sending Variables From Multiple Movie Clips To A Single Php Script
I have 3 movie clips each containing it's own variables. I want them all to be sent to PHP. The problem is that with the script I'm using it will only send variables contained in a specified movie clip. With the code placed on the submit button this is how I send each mc variable to php:

on (release) {
mc_name.loadVariables("analysis.php", "POST");
mc_name.onData = function() {
nextFrame();
};

}

Is there any way to consolidate all 3 mc variables into 1 action script to be sent to PHP?

View Replies !    View Related
Sending Variables From Multiple Movie Clips To A Single Php Script
I have 3 movie clips each containing it's own variables. I want them all to be sent to PHP. The problem is that with the script I'm using it will only send variables contained in a specified movie clip. With the code placed on the submit button this is how I send each mc variable to php:

on (release) {
mc_name.loadVariables("analysis.php", "POST");
mc_name.onData = function() {
nextFrame();
};

}

Is there any way to consolidate all 3 mc variables into 1 action script to be sent to PHP?

View Replies !    View Related
Sending Complex Data Types To Amfphp With As3
Hello,

Has any one figured out a good way to send complex data types to amfphp yet? It seems like the functionality to send Arrays, Objects, and custom classes up stream has become a little tricky in AS3.

The problem, as I understand it, is that the basic complex data types in AS3, like Array and Object, have become "looser" and now behave more like a custom class then a true data type.

My first thought was to treat like a custom class in amfphp, but according to the instructions here: http://amfphp.org/docs/classmapping.html , It requires the use of Object.registerClass which is not in the standard Actionscript library any more.

I could probably get an array up there by serializing it w/ .toString() then explode() it in php, but this not an ideal solution due to the processing overhead and added development time to create custom serializers for my Objects.

Have any of you crafty fellows out there come up with anything yet? If so, I would appreciate greatly any and all suggestions. Even if its just a hunch.

Thanks for your time!
...aaron

PS: Here is some code I've been playing with that will demonstrate the issue.

AMFPHP Service

PHP Code:



<?php
//AMFPHP VERSION 1.2
class TestService {

    function TestService()  {
            // Define the methodTable for this class in the constructor
            $this->methodTable = array(
                "testMethod" => array(
                    "description" => "This is a description",
                    "access" => "remote"
                )
            );
        }
    
    function testMethod ($data) {
    
        ob_start();
        var_dump($data);
        $buffer = ob_get_contents();
        ob_end_flush();
            
        return $buffer;
    }
    
}
?>




Flex 2 Sample App

Code:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[

public function callRemoteMethod():void {
var gateway:NetConnection = new NetConnection( );
var responder:Responder = new Responder(handleResponse, handleError);

gateway.connect('http://localhost/amfphp/gateway.php');

var temp:Object = {var1:"Hello", var2:"World"};
gateway.call( "TestService.testMethod", responder, temp );
}

private function handleResponse( result:Object ): void {
idText.text = result.toString();
}

private function handleError( result:Object ): void {
idText.text = result.toString();
}


]]></mx:Script>
<mx:VBox width="100%" height="100%">
<mx:Button label="GO" click="callRemoteMethod()"/>
<mx:TextArea id="idText" width="100%" height="100%" />
</mx:VBox>
</mx:Application>
A few examples:

Object:
var temp:Object = {var1:"Hello", var2:"World"};

Response:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion

Array:
var temp:Array = [1, 2, 3];

Response:
Same

But if I do this:
var temp:Array = [1, 2, 3];
gateway.call( "TestService.testMethod", responder, temp.toString() );

Response:
string(5) "1,2,3"


---
Thanks for taking the time to read all this. I'm looking forward to your ideas!
=D

View Replies !    View Related
"In(Object){...}" Function? Data Types For Object Variables?
I can create an object and use dot syntax to create, or reference, variables inside of it.

But how can I specify the data types of these variables?

Also, is there some way I can enter the namespace of the object over a number of lines via {}s instead of using repetitive dot syntax?

Thanks in advance.

View Replies !    View Related
How To Return Multiple Variables From A Function?
Newbie question, I'm sorry.

I want to do this:

function myfunction () {
//do stuff here
return lmp, mwA, mwB;
}
and use lmp back in my script where the function was called from.

I've tried it, and I'm not sure I'm doing it right, because it doesn't work.

Help please?

Thanks!

View Replies !    View Related
AS2 - How To Deal With Multiple Argument Types
Last edited by Codemonkey : 2008-06-13 at 00:18.
























Hey all,

I would like some input on the best way to enable a function to handle multiple input types. In other words, if you have an event subscription system with the function "subscribeTo" and you want to be able to pass any of the following paramters:

A) A String representing the name of the event, a target, and a callback function

ActionScript Code:
button.subscribeTo("hover",buttonController, showHover);



B) A String indicating you want to subscribe to "all" events and a target and callback

ActionScript Code:
button.subscribeTo("all", buttonController, update);



C) An array of events ( as either A or B above) and a target and callback
e.g.
ActionScript Code:
button.subscribeTo(["onRollOver",onPress], buttonController, update);


D) A String and an associative array of callback functions indexed by target

ActionScript Code:
button.subscribeTo(onRollOver, rollOverGroup);
where rollOverGroup was {target1:ShowColor, target2:showAngle, target3:makeBeep};


E) A String and an array of targets and a single callback function

ActionScript Code:
button.subscribeTo("onRollOver", [reactora, reactorb], doRollOver);


F) a string and a target

ActionScript Code:
button.subscribeTo("onRollover", this);



I have a dozen different ways that I have done it, but I was hoping to get some input on the best way to handle it.

Thanks in advance for any input,

jase

View Replies !    View Related
Function With Different Input Types
Hi,

I am writing a function that positions an object on the screen according to some rules. The inputs of the function are different objects that I'm working with, and then the function addChilds those objects according to the set of rules. Each time an object of a different class (different classes that extend sprite) is the input.

Example:

ActionScript Code:
public function SyncFix(inputObject):void {
    //some code
    _BtnObj.addChild(inputObject);
}

The inputObject could be different types.
How should I solve this?
Is it llegal to leave the inputObject without any type decleration?
I get a warning sign but basicly it works.

Thanks in advance,
Guy

View Replies !    View Related
Multiple Font Types In A Text Area?
I have a text area that I put a style on, but I would like to have part of the text in there be in italics. I am populating the textarea with actionscript.

View Replies !    View Related
Can An Argument Accept Multiple Cass Types?
OOP Question: I have a function argument that accepts multiple types, so long as they all share the same common ancestor.

Is there a way to write this so the argument is typed, other than by using the wildcard "*"???

What I have now: function foo(myTarget:*)

What I want to do:

eg: function foo(myTarget:MovieClip|Sprite|DisplayObject)
or function foo(myTargetsomehing)DisplayObject)

View Replies !    View Related
Listing Variables And Their Types
OK Sure I'll get some grief for this.. but..

Is there anyway for AS3 to list all the variables used and their types (and possibly current values) at runtime? like in a trace?

View Replies !    View Related
Function Accepting Two Data Types
Hey all,
I want to have a function that can accept either a string or a movie clip and executes slightly differently depending on which is passed to it, but not really different enough to warrant a whole 'nother function. I have tried two functions called the same but with different parameters and it didn't work. Thanks

--Surgery

View Replies !    View Related
Importing Multiple Data Types From A Text File
I have a text file where I want to pull out multiple variables of different types.

Take for example the following

GalleryActive = true;
ImageDirectory = "Interior";

subGallery[1] = Before;
subGallery[2] = Construction;
subGallery[3] = After;

Images[1] = 15; // number of images in sub gallery "Before"
Images[2] = 10; // number of images in sub gallery "Contruction"
Images[3] = 17; // number of images in sub gallery "After"

MainHeader = "The Gradow Estate";
SubHeader = "Exploring the Interior";

I have pulled arrays out of a file before with parsing, but this was only an array and not multiple variables including arrays. Can anyone help me with this? I'm not even sure if this is a good listing convention. Basically I need to import this data from a text file and I was wondering if anyone could show me some sample code for this?

Thank you in advance.

View Replies !    View Related
Playing, With Looping, Multiple File Types (FLVs And SWFs)
I need to play FLVs and SWFs in the same window as well as have all the videos play one after another and continue the loop. I will have 7 slots for video. The user will activate the playing of the videos and be able to select any of the 7 and the loop will continue on from there. I have found a pretty slick component using FLVplayback behaviors. It does everything for you, but works with FLVs only, I need to plug in SWFs as well. The reason behind this is that I want to show video and also vector animations created in flash. Compressing the swf to flv is a huge pain. I have spent the better part of today searching and searching for someone who has done this with no luck. I was hopeing one of you guys could help me out or point me in the right direction?

here is a link to the FLVplayback behavior i refered to earlier.
http://www.adobe.com/devnet/flash/artic ... viors.html

thanks a million!
__pg

View Replies !    View Related
Match Variables In A Drop Down Box As User Types?
I have created a drop down with the variables and would like the user to be able to choose from that list or type in the text field. But as the user types in the text field the drop down menu would jump to the nearest matching variable.

Thanks!!!!!!!!!!

View Replies !    View Related
Load Variables From What The User Types In Address Bar
Hi,

I was just surfing and suddenly I found this site... www.youaremyfriend.com

How this site function really surprised me and I really want to learn how I can do the same thing myself. I hope some of you help me

What the site does is that you can put your first and last name before the domain name in the address bar and the flash file will use your enterd first and last name in the playing animation! Try this... www.Jack.Smith.youaremyfriend.com

Have any idea how it works?
Hadi

View Replies !    View Related
Sending Variables To PHP, Checking, And Then Sending Back
ok heres the deal:

Im making this email form in flash 2004, and I can get it to send emails and all and great so now im going back and making it error check... so basically it sends out my variables to the PHP file, checks to see if the email is from a real domain among other things, and then depending on what it sends back it will do a certain action... I can get it to send my variables but not sure how to load the variables back in to flash after the calculations are done...this is like my first flash that uses all this so im quite a n00b at it.. thanks

View Replies !    View Related
External Content Loader With Multiple Content Types (trouble Loading Graphics)
Hey all!

I am yet another new project. Our flash designer here isn't a big AS guy, and asked me to write a reusable class so that he can load a variety of content types using minimal amount of code on his part. It's also going to be the main component piece in a larger external content player once I'm done with the class itself, so I am making the loading functions into public methods of the loader object than can be called from a button, etc.

I have the code for the text and html parts working (although I can't get stage.width and stage.height to work in the class or from the frame).

The problem I have is that I can't get the graphics content to load (the swf/pic content). Could you please check my code and tell me what I'm missing? I'm sure it's something simple, like it always is.

thanks a million!

-Fish


-----------------------------


ActionScript Code:
package
{
   
    /**
    * External Multimedia Loader Class
    * @author $(DefaultUser)
    * Add new MultiLoader object and insert media type (all lowercase) and object path to control initial loaded object
    * To load a new object, call the MultiLoader.load* methods (loadText, loadPic, loadSwf, or loadHtml as appropriate), passing the path to the external file.
    */
   
    import flash.display.*;
    import flash.events.*;
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.text.TextField;
   
    public class MultiLoader extends MovieClip
    {
        private var media:String;
        private var path:String;
        public var textObj:TextField = new TextField;
        public var picObj:MovieClip = new MovieClip;
        public var swfObj:MovieClip = new MovieClip;
        public var htmlObj:TextField = new TextField;
        private var objLoader:Loader = new Loader();
        private var objType:String;
        private var textLoader:URLLoader = new URLLoader();
       
       
       
        public function MultiLoader(mediaType:String,objPath:String)
        {
            media = mediaType;
            path = objPath;
           
            if (media == "text" || media == "TEXT" || media == "Text")
            {
                loadText(objPath);
            }
            else if (media == "pic" || media == "PIC" || media == "Pic")
            {
                loadPic(objPath);
            }
            else if (media == "swf" || media == "SWF" || media == "Swf")
            {
                loadSwf(objPath);
            }
            else if (media == "html" || media == "HTML" || media == "Html")
            {
                loadHtml(objPath);
            }
            else
            {
                trace("ERROR: Media type not supported. Media type must be 'text', 'pic', 'swf', or 'html'.");
            }
        }
       
        public function loadText(txtPath):void
        {
            objType = "text";
           
            if (this.numChildren > 0)
            {
                this.removeAllChildren();
            }
           
            this.addChild(textObj);
            this.textLoader.load(new URLRequest(txtPath));
            this.textObj.wordWrap = true;
            this.textObj.multiline = true;
            this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
            //this.textObj.width = this.width;
            //this.textObj.height = this.height;
        }
       
        public function loadPic(picPath):void
        {
            trace("loadPic started");
           
            objType = "pic";
           
            if (this.numChildren > 0)
            {
                this.removeAllChildren();
            }
           
            this.addChild(picObj);
            this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
            this.objLoader.load(new URLRequest(picPath));
           
            trace("loadPic completed");
        }
       
        public function loadSwf(swfPath):void
        {
            trace("loadSwf started");
            objType = "swf";
           
            if (this.numChildren > 0)
            {
                this.removeAllChildren();
            }
           
            this.addChild(swfObj);
            this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
            this.objLoader.load(new URLRequest(swfPath));
           
            trace("loadSwf completed");
        }
       
        public function loadHtml(htmlPath):void
        {
            objType = "html";
           
            if (this.numChildren > 0)
            {
                this.removeAllChildren();
            }
           
            this.addChild(htmlObj);
            this.textLoader.load(new URLRequest(htmlPath));
            this.htmlObj.wordWrap = true;
            this.htmlObj.multiline = true;
            this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
        }
       
        private function removeAllChildren():void
        {
            if (objType == "pic")
            {
                this.picObj.removeChild(objLoader);
            }
            else if (objType== "swf")
            {
                this.swfObj.removeChild(objLoader);
            }
            else
            {
                trace("objType != 'pic' or 'swf.' objType = '" + objType + "'.");
            }
           
            while ( this.numChildren > 0 )
            {
                this.removeChildAt(0);
            }
        }
       
        private function addObjLoader(event:Event):void
        {
            trace("addObjLoader started");
           
            if (objType == "pic")
            {
                trace("trying to load pic");
                this.picObj.addChild(this.objLoader);
                this.picObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
            }
            else if (objType== "swf")
            {
                trace("trying to load swf");
                this.swfObj.addChild(this.objLoader);
                this.swfObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
            }
            else
            {
                trace("ERROR: Cannot add object loader. The 'objType' variable does not contain correct media type. The function 'addObjLoader' should only be called when objType is 'pic' or 'swf'. In this case, objType is '" + objType + "' .");
            }
           
            trace("addObjLoader completed");
        }
       
        private function addTextContent(event:Event):void
        {
            if (objType == "text")
            {
                this.textObj.text = event.target.data as String;
                this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
            }
            else if (objType == "html")
            {
                this.htmlObj.htmlText = event.target.data as String;
                this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
            }
            else
            {
                trace("ERROR: Cannot add text content. The 'objType' variable does not contain correct media type. The function 'addTextContent' should only be called when objType is 'text' or 'html'. In this case, objType is '" + objType + "' .");
            }
        }

    }
   
}

View Replies !    View Related
Sending A Function Name
I am sending a name of a function via parameters to another function. This allows more usage of a single function. However, the button commands work every-so-often. Why? I know it's not a scoping issue. The message appears everytime with no problem.




Code:
_root.msgReveal("This is just a random message. Click the ok button to close.", false, true, false, false, _level0.msgHide(), false);

Code:
function msgReveal(msgString:String, btn1B:Boolean, btn2B:Boolean, btn3B:Boolean, command1:Function, command2:Function, command3:Function) {
msg.messageBox._visible = true;
msg.messageBox.textF.htmlText = msgString;
msg.messageBox.btn1._visible = false;
msg.messageBox.btn2._visible = false;
msg.messageBox.btn3._visible = false;
if (btn1B) {
msg.messageBox.btn1._visible = true;
}
if (btn2B) {
msg.messageBox.btn2._visible = true;
}
if (btn3B) {
msg.messageBox.btn3._visible = true;
}
msg.messageBox.btn1.onRelease = function() {
command1();
};
msg.messageBox.btn2.onRelease = function() {
command2();
};
msg.messageBox.btn3.onRelease = function() {
command3();
};
}
function msgHide() {
msg.messageBox._visible = false;
msg.messageBox.textF.htmlText = "";
msg.messageBox.btn1._visible = false;
msg.messageBox.btn2._visible = false;
msg.messageBox.btn3._visible = false;
}

Answered: http://www.kirupa.com/forum/showthre...4&goto=newpost

Thanks Nathan

View Replies !    View Related
[F8] Sending And Updating Multiple XML Elements
Hey, I'm about to give this little application a bash at the minute but am struggling to grasp what needs to be achieved.

Basically I have an XML which looks like (for example):

<player>
<uid>1</uid>
<name>Bob</name>
<positionx> </positionx>
<positiony> </positiony>
</player>

<player>
<uid>1</uid>
<name>Bob</name>
<positionx> </positionx>
<positiony></positiony>
</player>

Now positionx and y are going to be the elements co-ords on the stage, I've currently got them appearing but I want to be able to effectively save their new x / y co-ords to the XML file without having to re-write the XML from scratch.

Effectively a logic of
-Drag movieclip(uid =1 (name=bob)) to a new position.
-press a button
-Flash sends the new X and Y location of the movie clip to a coldfusion script which then finds the <player> element with the uid of 1, and inserts the x location into the <positionx> part and the y location into <positiony>.

Does this make sense? I'm just currently researching the best method to do this as there are going to be multiple elements (wont just have to update uid=1/name=bob but also about another 10 movie clips on the stage).

Anyone offer any advice?

View Replies !    View Related
Sending Multiple Items In Paypal
I have tried to figure out a solution but i could just set it up for one item till now. Here is a code which works for one item:





Code:
var a:Number = 0;
//var paypal_lv = new LoadVars();
addcart.addEventListener(MouseEvent.CLICK, googo);
var i:Number = 0;

function googo(e:Event):void{

var url:String = "https://www.paypal.com/cgi-bin/webscr";
var request:URLRequest = new URLRequest(url);
var paypal_lv:URLVariables = new URLVariables();





paypal_lv.add = "22" + i;
paypal_lv.cmd = "_cart";
paypal_lv.business = "a@test.com";
paypal_lv.item_name = "mamma" + i;
paypal_lv.amount = "200";
paypal_lv.no_shipping = "2";
paypal_lv.no_note = "1";
paypal_lv.currency_code = "USD";
paypal_lv.bn = "PP-ShopCartBF";

request.data = paypal_lv;


request.method = URLRequestMethod.POST;

navigateToURL(request, "_blank");





}
If i add a timer like - on first second send first item and after 12 seconds execute the same code again with variable "i" incremented then it does show me 2nd item also like mamma12. But this is not a right way to go.

So is there any way to set it up?

Thanks!

View Replies !    View Related
AS3: Load Multiple Variables Into Multiple Dynamic Text Fields
I have a php file that makes this list


Code:
Cid1=3
&Lid1=22
&Title1=amazing
&Date1=1212128413
&Ext1=jpg
&Hits1=129
&Rate1=9.5000
&Cid2=1
&Lid2=22
&Title2=cool
&Date2=1212128413
&Ext2=jpg
&Hits2=129
&Rate2=8.5000
Now, I want to load the 7 bits of data into 7 dynamic text boxes.

I have to code to load a movieclip as a button onto the stage.

When I click that button I want the data to load.

I can kind of load all the data as a string into one dynamic field but don't know how to get each variable into a different text box. Any help would be great.

Regards,

Glen Charles Rowell

This is some working code for loading one variable but I need help with the rest please.


Code:
var url:String = "http://www.secretcanttellsorry.php?cid=3&orderby=ratingD&guid=on";
var Cid1:URLLoader = new URLLoader();
Cid1.addEventListener(Event.COMPLETE, completeHandler);
Cid1.load(new URLRequest(url));

function completeHandler(event:Event):void {
poptext.text = event.target.data as String;
}

View Replies !    View Related
Different Swf's Sending Variables To Each Other
Hi,

I have several pages main, one, two, three. Main is the first page that loads and reads data from a database via an asp script in an array var "STATUS". When i click a button in main i want to load an other page via "getURL" or "loadMovie", doesnt matter, but i want the STATUS variable of main also in the pages one, two and three. How can i have the variables in main also in the other pages?
I tried it with "getURL" to load the other pages but i cant give the variables of main to the other pages. I guess that i should do it with "loadMovie" but i used the "POST" method to send the variable and then the page won't load.

Who knows the solution?

Regards, Arnold

View Replies !    View Related
SENDING VARIABLES
I don't reach to pass variables from a swf to an other swf that is embedded in an other HTML frame. I mean: I have 2 HTML frames and a swf in each frame. I just want to pass variables between them. How can I do that? Thanks for advance.

View Replies !    View Related
Sending Variables
hey, if I want to receive variables using "post" method, how do I do it? (from one flash page to another) -- I can send the variables fine, but I don't know how to make them appear in the next page...

View Replies !    View Related
Sending Variables
How do I send variables from one .swf file to another .swf file on another level? On Release of a button in one.swf I need it to send a variable to two.swf on another level and then have it check the variable to determine what frame it goes to.

Does anyone know how to do this?

Thanks.

View Replies !    View Related
Sending Variables
What i want to do is have a input text box in one frame/scene and then in another frame call the variable that was entered. I can only manage it with in the same frame.
can anyone help me?

View Replies !    View Related
Sending Variables
Currently I send variables from Flash to Java Servlets using the following command however since the number of words I am going to send is going to increase and is not predetermined I was wondering if there was any way of splitting this command to incase a for loop to send a words array - without putting the for loop around the whole thing or naming every variable in the statement.

Current command which just passes one
loadVariablesNum ("/servlet/hi?nocache=" add random(9999) add "&fname=" add file add "&w1=" add word, 0);

Or is there a way of passing all variables declared within a certain, level , movieclip ?


Any help appreciated

View Replies !    View Related
Sending Variables To Jsp Or Asp
when we want to send variables to jsp or asp file we go like this :

getURL ("name.asp", "", "GET");

but this will send all the variables in that swf.
Does any one know a way to send just one variable or a specific variable to a jsp or asp ????

and i will be thankfull

View Replies !    View Related
Sending Variables
How can I send and load textfield variables from flash4 game to flash5 highscore file.

Example: My score in game made with fl4 is "12345" points and it is textfield name result. I want to sen this variable to higscore-file (FL5-file) and rename it in the HS-file to "score" to be send to server.....

I have never used loadvariables-script, so please help me like a newbie!

thanks!

View Replies !    View Related
Sending Variables
Hi there

I'm trying to do the folowing:

i'm using loadmovienum to replace an existing .swf in level 0 by a new one.

like so:
loadmovienum ("othermovie.swf" ,0)

but here's the problem: there's one variable from the first movie that i need in the second one. (a variable that can be 1,2,3 or 4)

How do I use the "GET" method to send this variable?
can i use only actionscript to do this, or do i need something else?

View Replies !    View Related
Sending Variables
Hi,

I have 6 input textboxes with variable names. When people fill in the textboxes and press the send button their has to be send a form to me whith all the needed info that they tiped, but I don't know how to do it.
Can anybody help me?

Thanks in advance
Greetings
Camme

View Replies !    View Related
Sending Variables From One .swf To An Other
hi,
i have a question about flash mx and i hope you'll be able to help me.
i have a .swf flash file with a variable and another .swf file.
i need to send the var from one .swf file to the other.
i tried using [ loadVars.send ] to send it to the other .swf file but it didn't work.
i also tried sending it to a .txt file and load it with the [ loadVars.load ] from it
but no success there...
when i wrote the name of the var i wanted to load, in the .txt file and equaled it
to somethnig (for example: 1), and then used [ loadVars.load ] in the .swf file
it worked, the value "1" was in that var in the .swf file.
the only problem i have is to send a ver from one .swf file to the other .swf file
if it's not possible is there an other way to do so?
anyway that's what i did:

file1.swf (the sender):
----------------------

a button on the main TimeLine:
on (release) {
zzz = new LoadVars();
zzz.dan = "works";
zzz.send("c:/file2.swf");
}
i also tried the same with [zzz.send("c:/file2.swf", "POST");] and with [zzz.send("c:/file2.swf", "GET");]
didn't work...

file2.swf:
----------

the first frame of the movie on the main TimeLine:
zzz = new LoadVars();
zzz.dan = "not loaded";

zzz.onLoad = function(success) {
dann=zzz.dan;
};

"dann" is the var of an input text field on the main TimeLine.

where I went wrong?
hope you can help me.
thanks in advanced

dan

View Replies !    View Related
Sending Variables From One .swf To An Other
hi,
i have a question about flash mx and i hope you'll be able to help me.
i have a .swf flash file with a variable and another .swf file.
i need to send the var from one .swf file to the other.
i tried using [ loadVars.send ] to send it to the other .swf file but it didn't work.
i also tried sending it to a .txt file and load it with the [ loadVars.load ] from it
but no success there...
when i wrote the name of the var i wanted to load, in the .txt file and equaled it
to somethnig (for example: 1), and then used [ loadVars.load ] in the .swf file and it worked, the value "1" was in that var in the .swf file.
the only problem i have is to send a ver from one .swf file to the other .swf file
if it's not possible is there an other way to do so?
anyway that's what i did:

file1.swf (the sender):
----------------------

a button on the main TimeLine:
on (release) {
zzz = new LoadVars();
zzz.dan = "works";
zzz.send("c:/file2.swf");
}
i also tried the same with [zzz.send("c:/file2.swf", "POST");] and with [zzz.send("c:/file2.swf", "GET");]
didn't work...

file2.swf:
----------

the first frame of the movie on the main TimeLine:
zzz = new LoadVars();
zzz.dan = "not loaded";

zzz.onLoad = function(success) {
dann=zzz.dan;
};

"dann" is the var of an input text field on the main TimeLine.

where i went wrong?
hope you can help me.
thanks in advanced

dan

View Replies !    View Related
Sending Variables From One .swf To An Other
hi,
i have a question about flash mx and i hope you'll be able to help me.
i have a .swf flash file with a variable and another .swf file.
i need to send the var from one .swf file to the other.
i tried using [ loadVars.send ] to send it to the other .swf file but it didn't work.
i also tried sending it to a .txt file and load it with the [ loadVars.load ] from it
but no success there...
when i wrote the name of the var i wanted to load, in the .txt file and equaled it
to somethnig (for example: 1), and then used [ loadVars.load ] in the .swf file
it worked, the value "1" was in that var in the .swf file.
the only problem i have is to send a ver from one .swf file to the other .swf file
if it's not possible is there an other way to do so?
anyway that's what i did:

file1.swf (the sender):
----------------------

a button on the main TimeLine:
on (release) {
zzz = new LoadVars();
zzz.dan = "works";
zzz.send("c:/file2.swf");
}
i also tried the same with [zzz.send("c:/file2.swf", "POST");] and with [zzz.send("c:/file2.swf", "GET");]
didn't work...

file2.swf:
----------

the first frame of the movie on the main TimeLine:
zzz = new LoadVars();
zzz.dan = "not loaded";

zzz.onLoad = function(success) {
dann=zzz.dan;
};

"dann" is the var of an input text field on the main TimeLine.
where i went wrong?
hope you can help me.
thanks in advanced

dan

View Replies !    View Related
Sending Variables To Asp On Iis 5.1
here's the deal;
flash doesn't appears to be able to send variables to my asp script, even though, the same script is working perfectly with a normal html form. Here's the code I use:

//on the first frame
_global.oVarsASP = new LoadVars();

//on the submit button
on(release) {
oVarsASP.name = _root.name.text;
oVarsASP.email = _root.email.text;
oVarsASP.send("asp/emailBack.asp", oVarsASP, "POST");
}

asp code now:

<% @language="VBSCRIPT" %>
<%option explicit%>

<%



dim fso, tso, oMail, oConf, oConfFields
dim myMail, myBody
dim myFile
dim var

Const append = 8
Const cdoSendUsingPickup = 1

set oMail = createObject("CDO.message")
set oConf = createObject("CDO.configuration")
set oConfFields = oConf.fields

for each var in request.form
response.write(var & ":&nbsp;" & request.form(var) & "<br>" & vbcrlf)
next

if request.form("okList") <> "" then
myFile = Server.MapPath("log/mailingList.txt")

Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set TSO = FSO.OpenTextFile(myFile, append, true)

TSO.write(request.form("email") & vbcrlf)

TSO.close
Set TSO = Nothing
Set FSO = Nothing
end if

with oConfFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")= "c:Inetpubmailrootpickup"
.update
end with

myBody = "Name: "& request.form("name") & vbcrlf
myBody = myBody & "Email: "& request.form("email") & vbcrlf
myBody = myBody & "Message: "& vbcrlf & request.form("msg")

oMail.configuration = oConf
oMail.from = request.form("email")
oMail.to = "dorobo88@digitalmilitia.net"
oMail.subject = "Flash MX Basic Email"
oMail.textBody = myBody
oMail.Send

set oMail = nothing

dim var1
var1 = "&var1=wwere" & Request.ServerVariables("Content_Length")
response.write(var1)

%>

and the asp error I get is:
CDO.Message.1 error '8004020d'

At least one of the From or Sender fields is required, and neither was found.

/lacasse_ca/asp/emailBack.asp, line 56

proving that no data was sent to the asp script.

server side: IIS 5.1 on windows xp
client side: Mozilla 1.1 on windows xp ( but the error still occur with IE6 )

any help/suggestions/teasing would be appreciated

nicolas
[Edited by dorobo88 on 09-10-2002 at 08:50 PM]

View Replies !    View Related
Sending Variables
How do I send variables to a cgi-bin outside of flash? Where do I declare the variables?
thanks!

View Replies !    View Related
Sending Variables To PHP
Using Flash 5:

I am wanting to send only specific variables to an external source (PHP). So far I have only been able to send ALL of my in the entire movie.

Is there a way to specify which variables you want to send? (name them specifically)

Thanks!

David Taylor

View Replies !    View Related
Sending Variables Is This Possible?
I have a mc that has two input txt boxes in it. the first one is named h1 the second one is named h2. I have a button in this mc that sends the variables to a cgi script. What I need to do thoe is have them go to two diffrent cgi scripts useing
LoadVariabe ("http://www.mysite.com/cgi-bin/h1.pl")
have that one send h1 to a scripts called h1

and in the same button have another load variable that sends h2 to a diffrent script.

I don't know how to set the variable for each load variable would it just be
h1=""
Loadvaraible ("http://www.mysite.com/cgi-bin/h1.pl")

this does not seam like it would work because I think it would pick up the h2 variables also??

View Replies !    View Related
Sending Variables To C++?
I recently discovered how to save variables to a file using the sharedobjects command but unfortunately, I don't think this will work for my application. I am creating a standalone application, which needs to send data to c++ program to do calculations, then once the c++ program has saved the data to a text file, the standalone application will read it back in. With sharedobjects, the file location can change depending on the persons username and version of windows. So now, im looking for a different way to pass variables to a c++ program through maybe the use of a batch program? I was wondering if maybe I could call a batch program, with some added parameters that would create a file with all of my variables in it. Any ideas on ways to create a file that I will know the definite location of will be greatly appreciated. I would do the calculations in flash mx, but in trial runs it has seemed to be too slow. Anyone know exactly how fast flash mx is compared to c++ anyhow? Thanks.

View Replies !    View Related
Sending Variables To C++?
I recently discovered how to save variables to a file using the sharedobjects command but unfortunately, I don't think this will work for my application. I am creating a standalone application, which needs to send data to c++ program to do calculations, then once the c++ program has saved the data to a text file, the standalone application will read it back in. With sharedobjects, the file location can change depending on the persons username and version of windows. So now, im looking for a different way to pass variables to a c++ program through maybe the use of a batch program? I was wondering if maybe I could call a batch program, with some added parameters that would create a file with all of my variables in it. Any ideas on ways to create a file that I will know the definite location of will be greatly appreciated. I would do the calculations in flash mx, but in trial runs it has seemed to be too slow. Anyone know exactly how fast flash mx is compared to c++ anyhow? Thanks.

View Replies !    View Related
Sending Variables To C++?
I recently discovered how to save variables to a file using the sharedobjects command but unfortunately, I don't think this will work for my application. I am creating a standalone application, which needs to send data to c++ program to do calculations, then once the c++ program has saved the data to a text file, the standalone application will read it back in. With sharedobjects, the file location can change depending on the persons username and version of windows. So now, im looking for a different way to pass variables to a c++ program through maybe the use of a batch program? I was wondering if maybe I could call a batch program, with some added parameters that would create a file with all of my variables in it. Any ideas on ways to create a file that I will know the definite location of will be greatly appreciated. I would do the calculations in flash mx, but in trial runs it has seemed to be too slow. Anyone know exactly how fast flash mx is compared to c++ anyhow? Thanks.

View Replies !    View Related
Sending In Variables Through Url
My site is set up like this. I have my main menu that is entirely flash, certain sections of that menu goto another part of the same flash movie, and other sections goto a dynamically generated web page. Now, on the dynamic page, i have links that are supposed to go to the individual other sections of the menu flash file. I'm wondering how I can pass in variables or parameters to the flash movie, so that I can do a test such as
if(gotoSection1 == true) {
gotoAndPlay("section1",1);
}

Can anyone help me out with this? Thanks for your time.

View Replies !    View Related
Sending Variables To Cgi
How can I send the contents of flash input text fields to a cgi script on my web server?

In the flash help files I read that sending variables is possible (of course), but Macromedia´s descriptions and examples always sound more like "downloading data from external scripts or applications" so now I want to know how to do it the other way round.
What I basically have is a movie clip with three fields for input text and a submit button. Now I tried to send the data to the server by using a loadVariable command triggered by a click on the button:

on (release) {
loadVariables("www.mydomain.de/
cgi-bin/guestbook.cgi", "_root.mc", "POST");
}

Is this complete bs or should it work at least theoretically? I used "POST" because in html it worked this way... I´m not sure, perhaps I have to exchange the URL and the movie clip target in the code for an upload operation? I read that all variables contained in the movie clip are automatically sent even if I cannot really imagine how this goes. So I thought about whether I had to address each text field individually by its variable name? Or shouldn´t I use loadVariables at all?
Thanks for your help and hope to get this running soon,
Toby.

View Replies !    View Related
Sending Variables
I am using the following code to send a bunch of varibles to an asp script...


function submitForm() {
startAction();
Sender = new LoadVars();
Receiver = new LoadVars();
Sender.CacheBuster = random(9999999);
Sender.sendAndLoad("add_students.asp", Receiver, "GET");
Receiver.onLoad = loadedForm;
}

My variables are in the _root, so they aren't being sent unless I use something like

Sender.FirstName = FirstName;
Sender.LastName = LastName;
etc etc..

Which isn't a big deal, but when I have a lot of variables, it just gets kinda annoying. Is there anyway around this?

View Replies !    View Related
Sending Variables
i would like to know the easiest way to send variables to a .txt file on your own computer. please note that i do not know any php or such, so an explanation of any php code used would help.

View Replies !    View Related
Sending Variables?
How could I send a user input value of a variable text box to a form field on another html page? For instance, I'd like to have an input text box in flash where users can enter an email address, then hit a submit button that would send the email address to the email address field of a more detailed html form. Any help would be greatly appreciated! Thanks.

View Replies !    View Related
Sending Variables To ASP
Hi,

I may have asked this question below in a previous post, but my problem has shifted slightly.

I have a form that I have written in flash MX, it uses components.

I have attached the asp file and flash file.

The problem is the form sends, but the email that I receive as a result of the form, doesn't show the variables from the flash file.

Please help me,

I'm going out of mind

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved