Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,516 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,742 people online right now. Registration is fast and FREE... Join Now!




How to pass variables between multiple swf files?

 
Reply to this topicStart new topic

How to pass variables between multiple swf files?

Jonson
5 Aug, 2008 - 07:55 PM
Post #1

New D.I.C Head
*

Joined: 17 Apr, 2008
Posts: 40

Hi guys, here is my code:

CODE

import be.wellconsidered.services.WebService;
import be.wellconsidered.services.Operation;
import be.wellconsidered.services.events.OperationEvent;

var ws2 = new WebService("http://mcccu-pc12/ChineseCheckerWebsite/WebService.asmx?WSDL");
var userName : Operation = new Operation(ws2);

var timer1 : Timer = new Timer(1000,0);
timer1.addEventListener(TimerEvent.TIMER, theTimer1);
timer.start();

userName.addEventListener(OperationEvent.COMPLETE, getUserName);
userName.getUserName2();

function getUserName(e :OperationEvent):void
{
    var tf3 : TextFormat = new TextFormat();
    tf3.size = 20;
    tf3.color =  0xFF0000;
    loginName_txt.setStyle("textFormat" , tf3)
    loginName_txt.text = e.data.toString();
}

create_Button.addEventListener(MouseEvent.CLICK, onCreate);
var loader:Loader = new Loader();

function onCreate(evt:Event):void
{
    timer1.stop();
    create_Button.enabled = false;
    var swf:URLRequest =new URLRequest("GameCreate.swf");
    loader.load(swf);
    addChild(loader);
    loader.x = 255;
    loader.y = 200;    
}



How do i pass my variable timer1 and e.data.toString() to another SWF file after after i pressed create_Button in 1st SWF?




User is offlineProfile CardPM
+Quote Post

BetaWar
RE: How To Pass Variables Between Multiple Swf Files?
6 Aug, 2008 - 03:02 PM
Post #2

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 2,026



Thanked: 82 times
Dream Kudos: 1175
My Contributions
Is the second SWF being imported to the first? Or is it just being displayed on the same webpage?
User is offlineProfile CardPM
+Quote Post

Jonson
RE: How To Pass Variables Between Multiple Swf Files?
6 Aug, 2008 - 05:07 PM
Post #3

New D.I.C Head
*

Joined: 17 Apr, 2008
Posts: 40

same window.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 09:10PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month