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




Passing String To Target In LoadVariables



for the loadVariables function, I have a file to be loaded. however as for the target, i have no definate target. but a string of the target will be produced in the code. but it doesnt seems to work when i put the string of the target address to the target parameter of loadVariables. how can i get it work?
thanks



FlashKit > Flash Help > Flash ActionScript
Posted on: 06-12-2004, 08:14 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

LoadVariables Embedded In New String
Hi there everyone,

I'm trying to load a text file from a server into a variable in Flash. I'd like to separate out the string after I get it loaded, but I seem to be getting hung up on the loadVariables command first. Am I wrong in thinking I can nest it within the creation of a new string object?

Here is the code if you like to look:

servinput = new String( loadVariables( "http://www.servername.com/~foldername/flashtext.txt", " ", POST ) );//loads server text file into String variable named "servinput"
btag = servinput.indexOf("<TG>");//sets variable named 'btag' as placement of <TG> in text file (beginning tag)
etag = servinput.indexOf("</TG>");//sets variable named 'etag' as placement of </TG> in text file (ending tag)
if (btag<>-1){//if beginning tag is found
array1 = new Array( servinput.substr(0, btag) );//array1 is the new array made from items in servinput from beginning to 'btag'
array2 = new Array( servinput.substr(etag+1) );//array2 is the new array made from items in servinput from 'etag' to end of string
alga = servinput.substr(btag, etag);//sets new variable 'alga' as items between btag and etag in servinput
}

Thanks for any thoughts or advice!

Loadvariables String To Integer
I tried changing a variable passed through loadvariables to a number.

credit = "1000" is what is being passed.

when I do Number(credit); it gives me 0
when I do int(credit); it gives me 0
when I do ParseInt(credit); it gives me NAN


Anyone have any ideas please????
thanks

LoadVariables - String Or Number?
Hi all,
this problem:
I use movieClip.loadVariables() method. this is th code I have in the ext file:

Code:
b=1
&onLineMax=124
&onLineNow=153
&visited=3546
&end=1
I read somewhere that all the variables will be taken as strings. OK. So I try to use Number() function. But when I use this code:

Code:
onLineMax=Number(onLineMax);
trace(onLineMax);
it returns NaN.

Why?





Thanks for advicing.

LoadMovie - Target String Or Not String?
I'm trying to figure out what the major differences and/or uses for using a target as a string with double quotes or without quotes...

For example whats the difference between the following 2 lines?

1. loadMovie("products.swf",_root.dropZone);
2. loadMovie("products.swf","_root.dropZone");

I know the target in the second line is a string and the target in the first line is a MC object(?). Any other major uses for these 2 variations?

Convert STRING Into NUMERAL From LoadVariables
I have a loadVariablesNum() on frame 1 of the main timeline loading in a text file called "photos.txt" with a variable in it called "pictotal". Here's what the script looks like so far.

Frame 1 on main timeline...

Code:
loadVariablesNum("photos.txt",0);
Text file called photos.txt

Code:
&pictotal=12
Now, everything is working up until this point.
The variable "pictotal" makes it into flash without a
problem, but it comes into flash as a string variable,
and I need for this variable to be an actual number.

How do I convert the string variable into a number?

Any help would be greatly appreciated.
Thanks in advance.

Passing Variable To ASP Page Using LoadVariables
Okay guys, here's another one about passing data to an asp page. I'm trying to pass a variable through a string to an asp page. I cannot understand why this is not working. Here is my code:

this.btn1.onRelease = function (){loadVariables("http://www.mywebsite.com/paragonstats/flashprogress.asp?pagename=introduction","POST");
}

If I paste my url in a browser, it triggers the asp page as it should. But this code is not working from flash. If I use getURL, it works, but it opens another browser window or redirects my movie. I'm just trying to track click through statistics. I've even set up a movie with just one button on the root with this code and it won't work. Can anyone please help, I'm baffled. Thanks!

Justin

LoadVariables Followed By String Function In Netscape? Why Is It Not Working?
hey all,

ok i got these txt files and which get loaded into flash. the txt file consists of one very long string which i then process though a couple of string functions to extract all the data into objects. ok, this works great in IE but for some dumb ass reason it totally crashes Netscape.

Even if the string is relatively small, and i mean real small, (txt file about 90 bytes) it still takes ages to go through and... obviuously stalls the browser for 5 minutes. Naturally, since this is a game i don't want users to have to wait that long to see their name appear.

The reason for the text files is because i hope to put a database and i'm trying to simulate the datastream for the moment. would it be better then to have all the data sent to flash as individual variables or keep it as it is?

thanks

Passing Variables Using The LoadVariables Function On Release
I need some help here in the following:

My bttn12 has a action script attached to the bttn12 button in my flash 8 and this is the following :

on (release){
txt.loadVariables("email.php", "POST");
}


My problem is the PHP file below only sends out the $subject = "Message from Massage Yoga Polarity contact form."; and a email is sent out to the correct email and recpent gets the email just file - but only the subject and no body in the email - what could possable be the problem?

Here is the script for the email.php

<?php
$sendTo = "cleopataura@comcast.net";
$subject = "Message from Massage Yoga Polarity contact form.";

$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-Path: " . $_POST["email"];
$message = $_POST["message"];

mail($sendTo, $subject, $message, $headers);
?>

I need all the information type in sent in the email not just the $subject

Target Prob? LoadVariables Works When Testing Each Swf, But Not When Loaded In Main?
when i test each individual swf file... all the this.loadVariables("home.txt"); etc commands work..... but when i load them into my main movie...the text files don't load but i get no errors in the output panel (usually i would get an Error loading etc etc message...)

Any idea what would be causing this or how i could fix it?

Passing SQL String To PHP
hi...
what im trying to do is: pass a complete sql string to a php script. this works fine for passing numbers for the SQL WHERE conditions (e.g. "SELECT * FROM myTable WHERE YEAR(mydate)=2005").
but as soon as i try sending strings (e.g. "SELECT * FROM myTable WHERE YEAR(mydate)=2005 AND item='myItem'"), php just won't process it.
the same goes if i wrap that statement into escape();
i also tried putting in and leaving out the inverted commas....
I'm using loadVars() and sendAndLoad() for this action...

anyone ever encountered this problem???

Passing XML String
Alright, so I am trying to pass an XML file as a String from a JSP page. I know the JSP code works and it creates a String of XML data that is formatted correctly, however when I try to load into my flash I am getting undefined errors.

This flash code works if I try to load a file locally or off the server, but unfortunately I cannot load it that way, I need to load it from this JSP as a String.

Here is the AS code:


Code:
myXml = new XML();
myXml.load("rssloader.jsp");
news = new XMLSA();
news.load(myXml);


XMLSA just takes a formatted XML() object and returns it as an array, this has all been verified to work as well.

Passing A String
Ok, so Im passing a param (proLabel) from an asfunction to another function (byeByeContent). It traces correctly from byeByeContent function, but will not work as a frame label. If I replace the param with the string "pro1" all works fine. Whats wrong?








Attach Code

// asfunc
function showPro(proLabel:String) {
proHighlightClick = true;
byeByeContent(mNavContent_3_mc,"NA",proLabel);
reset();
mNavbar_mc.mNav_3_btn.enabled = false;
mNavbar_mc.mNav_3_btn.btnAni_mc.gotoAndPlay(11);
//trace(proLabel);
}
// show/hide content
function byeByeContent(viewContent:MovieClip, bannerPos:String, proPos:String) {
//.. cut alot of things out
if (viewContent == mNavContent_1_mc) {
mNavContent_1_mc.gotoAndStop("lastFrame");
//reset2();
viewContent._visible = true;

} else if (proHighlightClick) {
// this ius where proPos traces fine "pro1" but doesnt gotoandPlay the frame labeled pro1
viewContent._visible = true;
viewContent.gotoAndPlay(proPos);
}}

String Passing
I am trying to create a string on the main stage which I will use to load swf's externally into a scroll pane. Say I create a string called name (name = new String()) and when I click the button called home, name is changed to home.swf (name = "Home.swf"). The button home also loads a movie onto the main stage from the library called animation which is a nice little preloader and a couple of things flying around before I want the page to show up. Within the movie I just called onto the main stage, I include the code myScrollPane.loadScrollContent(name). How come it doesnt load Home.swf when I click the home button?

String To Target Path
Hopefully this is an easy one. I just can't seem to figure it out.

I have a string that describes a target path. Ex: "_root.shapes.square". How can I make that string useful so that I can get/set properties with it?

Here's essentially what I'm trying to do:

var myString = "_root.shapes.square";
trace(myString._x);

But that syntax returns nothing. Likewise:

trace([myString]._x);

What am I doing wrong?
Thanks, Justin.

Target Moveclip With String
Basically I want to acheive the following;

currentItem = "subnav.test_mc.item" + miniLoop

currentItem.onRollOver = function () {
currentItem.gotoAndStop(2);
}
currentItem.onRollOut = function () {
currentItem.gotoAndStop(1);
}

I have a subnav movie clip which loads 5 buttons as movie clips and I want to setup the function for a rollover by doing the above. How can I target each item in the loop by using the concatinated "currentItem" above?

Passing A String Into A Variable Name
I have a function, and as a result of the function, I want it to create a value in a variable. The string is passed in a button as this,

on (release) {
this.boxCheck("x1");
}

function boxCheck(letter) {
if (this[letter]._currentframe == 2) {
this[letter].gotoAndStop(1);
} else if (this[letter]._currentframe == 1) {
this[letter].gotoAndStop(2);
}
HERE I WANT TO CREATE A VARIABLE THAT WOULD CONTAIN THE STRING IN IT. SO FOR THIS INSTANCE, I WANT TO CREATE A VARIABLE NAMED: x1selected = 1;

How can I do this passing the string to keep it dynamic?
like this? this[letter] + "selected" = 1;


}



Any ideas?

Passing Vars In AS3 Without Using URL String?
Hello,

I have one AS3 swf (loader.swf) that needs to load a second AS3 file (main.swf).

loader.swf has some variables that I would like to pass to main.swf.

I don't want to append the variables in the URL string, because then main.swf won't be cached properly.

In AS2 I could use FlashVars, which passes the variables without adding them to the URL string.

How can I do this in AS3?

Passing Var:string To New URLRequest
Hi,

I have a main movie on which I have two buttons that each should load a new external movie when clicked.

The code on frame one for each button is:

Code:
function onIntroClick(evt:MouseEvent):void {
var language:String="english.swf"
gotoAndPlay(2);
}
english.addEventListener(MouseEvent.CLICK, onIntroClick);


and


Code:
function onIntroClick2(evt:MouseEvent):void {
var language:String="french.swf"
gotoAndPlay(2);
}
french.addEventListener(MouseEvent.CLICK, onIntroClick2);


on frame 20 I have the following code, which should load the external movie (either the english.swf or the french.swf) in the main movie.

The code is as follows :

Code:
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest(language));

function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(l);
}
stop();


This doesn't work as I get an error 1120: access of undefined property language.

What am I doing wrong or what should I do to do it right ?

Thanks for your assistance.

Smalco

Passing String Into Flash
Hi All,

I was wondering if someone could help me out with some trouble I'm having. I've tried to find tutorials for this but it seems to be missing the what I'm looking for. I want to pass a string into flash from a php page. I know I have to have the string in the object. But I don't know how to write the code so flash can understand. I want to have the string value be entered into a text box. Any help would be great thanks..

Passing A String To A Function
Hi I want to pass a varible (a string) to a function when I roll over a
button. I have tried this but it does not work.

var ross:String('hello');

freshnLogo_mc.addEventListener(MouseEvent.ROLL_OVER, oneRollover, ross);

function oneRollover(event:MouseEvent, ross):void {

trace('you passed' + ross);
}

Passing A String To An External MC
I load my external swf....

var myRequest1:URLRequest = new URLRequest("external.swf");
myLoader1.load(myRequest1);
var _content:MovieClip = MovieClip(myLoader1.content);
stage.addChild(_content);
_content.myname ="Albert";


on the first frame of the external swf

trace("hello you" + myname);

I get an error. How Do I do this?

Thanks

Calling A Variable In A Target String ?
ok.... kinda wierd

currentprojx = pl2.c_project._x;

is there a way to write this so c_project will call up that variable, and use that for the target path ???

Changing A String Into Target Path.
I'm trying to change a string into a usable target path. Does anyone know how this would be done?

[MX] Insert A Variable Into A Target String?
How do I insert a variable into a target path? I have a set of thumbnails, named 201_mc, 202_mc, 203_mc etc. When you click one it sets a global variable, content_v to whatever the corresponding section is. Once you click, the thumbnail moves to a "selected" state, you can no longer click on it and it's hilighted. What I'm trying to do is when you click on a different thumbnail it takes the previously selected thumbail off "selected" and moves it back to it's default state. Follow me? If I hard-coded each button, the action would look like this:

_parent.201_mc.bkg_mc.gotoAndPlay("out");

What's the syntax to replace "201_mc" with the variable "_global.content_v"+_mc?

Thanks --

Target:MovieClip With=converted:String
Hi!

I need to target a mc with a string that is converted. I dont know if I'm actually doing the right thing here. So here it is:

ActionScript Code:
currentobject = new Object();
currentobject.bla = "_level0.mymc";
var mc_ = currentobject.bla;
var mc:MovieClip = mc_;
_root.createEmptyMovieClip("mymc", 100);
mc.lineStyle(2, 0x000000, 100);
mc.lineTo(200, 300);
mc.lineTo(100, 200);
mc.createTextField("tex", this.getNextHighestDepth(), 200, 300, 125, 50);
mc.tex.text = "yeah";

if i put _root.mymc instead of the variable mc, it works. I need this bad! Just dont know why flash doesn't accept my variable in the target!!

PLEASE HELP!!

Passing Parameter Into Target Path
I'm trying to pass a parameter from a function into a target path. I need to replace the item in _root.bike.item to _root.bike.frame but the function won't replace it. Anyone have ideas? Thanks for your time!


PHP Code:



function:

_global.button_hit = function(item)
{
    _root.bike.item.gotoAndStop(2);    
}


movieclip action:

on (release)
{
    _global.button_hit(frame);
}

Passing A Variable From _level0 To A Target.
I have an asp.net page that appends a list of variables to a flash file in the Movie parameter. This all works great and inherently provides those variables to the main timeline without using a loadVariables statement. The problem is when I call a movie clip that has dynamic textboxes, they don't find the variable's values.

I need to pass the vars from the main timeline to a target movie clip.

It seems like it should be a quick task, but I'm stumped.

Thanks for the help.

M.

Passing Data With Query String
I'm trying to 'pass-through' a variable in a flash movie.

Basically I'm using flash to create a form that needs to be posted back to a server side database, using get url this is no problem.

However I want to populate the flash movie with a value that when the get url command is exectued, this value is passed back to the database.

e.g.

I have a variable called "AdvertID" it's value is "100". I know this before I play the movie, so I call the movie thus:

embed src "movie.swf?AdvertID=100" etc.

However when flash posts this data back using get url, it doesn't appear as one of the variables.

I do not want the user to see this value (however if they must I can live with it).

Do I have to declare "AdvertID" as a variable for this to work?

If I do where?

Thanks.

Passing A Filename As A Variable..is It A String?
Hey can someone help me,

I want to set a variable as a file name,

i.e variable_1 = "file_1.exe";
How should I declare it? I was declaring it as above but it was being passed as a string and wasn't being picked up by my other functions, I also tried without the inverted commas and it wasn't being picked up at all, any advise?
Cheers

Passing String Variables To Flash
I am passing variables in a url string from an asp page to my .swf file and reading the variables into text boxes within flash.

eg.
http://www.mywebpage/pageFlash.asp?...ameVar=François

As you can see, the variable I am using contains a special french character.

Now here is the problem. On some computers the variable is passed to flash with no problem at all and on other computers the same flash file is unable to read the variable. I have tried url encoding the variable to read %E7 and also have placed System.useCodePage=true; on my first line of actionscript, but neither works.

Does anyone know why the special character works on some computers and not on others? All the computers have IE 6 and are running Windows 2000.

[CS3] Passing Variables From Query String
Hi there,

i'm trying to pass a variable from a web page to a flash file. The flash file has a dynamic text box with the var value set to formError.

In the webpage i have the following code:

<script type="text/javascript">
var so = new SWFObject("flash/index_030308.swf?t=150", "mymovie", "938", "305", "8", "#FFFFFF");
so.addParam("allowScriptAccess", "sameDomain");
so.addParam("quality", "high");
so.addVariable("formError", "<%=request.QueryString("formError")%>");
</script>

to test i am typing in the address bar default.asp?formError=woteva, hoping to see "woteva" displayed in my dynamic text box in the flash file, but this isn't the case. Where am i going wrong?

Passing A Variable To Flash Via Url String
I understand how to get a variable into flash when it's hard coded into the html using Flashvars or this is how I do it with SWFObject:
where variable: location=subdirectory

Code:
<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("featuredviewer.swf", "featuredviewer", "620", "480", "8", "#fff");
so.addVariable("location", "subdirectory");
so.write("logo");

// ]]>
</script>
What I don't understand and can't find is how to do this...
I have an html file with an swf in it. Different buttons in the file open a popup window via javascript. I want to pass a variable to the swf in the pop up window, possibly like this:

Code:
on (release) {
getURL("javascript:Launch('featuredviewer.html?position=one')");
}
But how do you extract the variable position=one out of the url and get it into flash?

Passing Class Names As A String...
Hi People,
I need to pass a class name to a function acting as a class 'instancer' (bad english, sorry)

I've tried [] and eval but no result...

one of wrong cases I've tried:


Code:
showModule = function(moduleClass:String){
var module = new eval(moduleClass)(_level0.module_container);
}
thanks

Passing Variable On Querry String To PHP
I'm building a upload app and need to send my php script some info when I call my upload script. I've established a var ID.

Can someone confirm if my syntax is correct.

ActionScript Code:
fileRef.upload("upload.php?userid='+ID+'");

Thanks!

Passing A Variable To A Query String
I am trying to create a form in Flash that passes variables to a query string. Simple enough, but when my variables have an underscore (eg variable_one) Flash coverts the underscore to “%5F”. I noticed that it seems to convert all non letter or number characters to something else. Unfortunately I don’t have the option to change the names of the variables I am passing.

This is the code:

submit.onRelease = function () {
getURL ("http://www.actionscript.org","", "GET");
};

Has anyone encountered this? Help Please!

Passing String Info Via MovieClip?
Hello.

I'll try to explain what I'm looking for, I haven't started coding yet so have nothing to show.

I have 190 movieclips which display various types of information. When a user clicks on a movieclip, it has to tween larger but also send a string to a method. I'll probably e.currentTarget to use one function which contains a tween and I wondered if there was a quick way to pass string info in a similar way?

So, each movieclip has it's own value which can be passed to a method which will use that value. The only way I can think of so far is to have 190 functions which send the string data to the appropriate place. I'm trying to avoid that if I can.

Thank you.

Passing A Query String To Flash
Here's the need:

I'm going to be making a gallery of "thumbnails" which are all a flash file dynamically loading new content in each. So a single html page will house up to 48 copies of that same swf loading a new picture in each.

There has to be a way to load a flash file with a query at the end, right (in the html source code)? Like filename.swf?id=123&thispage=123 right? If so, how do I access those variables passed to flash?

My idea was to write my standard loop (in PHP) posting a new swf in each iteration but change the query string with each so that I can load the new content.

MX : Passing Variables To Command String
I'm trying to design an interface that to simplify the construction of a string. Here's an example: My output (using the getURL command) needs to be in the form of:

http://fakesite.com:8080/java/submit...ng2=y&thing3=z

I'm able to define variables for x, y, and z, however I am unable to figure out how to substitute the defined values for those variables into the string when it is time to send it.


I may not be being very clear here, but does anyone have any ideas?


Thanks

Jeff Kirsch

Passing Variables Via Query String
i am trying to load different xml that get generated through .net when I am trying to pass varibels i am getting undefined. Can someone give me a heads up on what i might be doing wrong. from what I have read and learned I can pull via-

Code:
xmlData.load("/family/galleryimage.xml.aspx?pid=" + _root.loaderInfo.parameters.pid.toString());

Then I am defining pid in within the object class.

Code:
<param name="pid" value='<% =Request.QueryString["pid"] %>'>
However I am getting undefined. Any help is much appreciated, thanks.
MT

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);

MX : Passing Variables To Command String
I'm trying to design an interface that to simplify the construction of a string. Here's an example: My output (using the getURL command) needs to be in the form of:

http://fakesite.com:8080/java/submit...ng2=y&thing3=z

I'm able to define variables for x, y, and z, however I am unable to figure out how to substitute the defined values for those variables into the string when it is time to send it.


I may not be being very clear here, but does anyone have any ideas?


Thanks

Jeff Kirsch

Passing Query String From Address Bar URL Into Swf
Hi All,

Let me preface this by saying that I'm primarily a design/animation/marketing guy so this could be a stupid question with an obvious answer. However, I have been scouring the web for two days now and have yet to find any posts/tutorials which offer a solution.

Here's the challenge:

I have a flash movie that movie is contained within the same included file on every page of a site. I need some way of telling the flash which pages it's on so it can display the appropriate XML feed. Since each of my pages has a query string in the URL (i.e. thesite.com?page=1) I imagine the best way to do this is to somehow send the string into the flash movie. Once it's inside the movie I'll write a function that pairs the each string with it's corresponding XML feed (btw, if anyone has an a similar script they can post it would be a huge help to me!).

Note that because the movie is part of an include that is on ever page its parameters (such as EMBED tags) cannot be changed either.

The only solution outside of directly passing the query string from the page URL (as it appears in the address bar) to the flash would be to create some sort of Javascript in the HTML that captures the query string and then sends it along.

If anyone can help me out with this it would be GREATLY APPRECIATED.

Thank you in advance!

Problem With String Variable To Target A MovieClip...
Ok, here is a sample of what I am trying to do. Basically, I want to use a string variable to target a movieClip with the same name.


ActionScript Code:
var pageName:String = root.loaderInfo.parameters.page;
if (pageName){
    pageName.alpha = .5;
}

I know the variable is a String, but how do I convert it to target the movieClip that has the same name?

Multi Level Target Path From String
I'm having trouble converting a string (stored in a database) containing a multi level target path into a working target path. I try to do it this way:


ActionScript Code:
_level0[pathFromDatabase]

It works if pathFromDatabase consists of just one movieclip with an appended textfield variable name like: "clip1.textfield1".

But if there are several nested movie clips in the path: "clip1.clip2.clip3.textfield1", it doesn't work as expected. I can still reach the path through action script, but it doesn't match the actual path:


ActionScript Code:
pathFromDB = "clip1.clip2.clip3.textfield1"
level0[pathFromDB] = "Test"
trace(level0[pathFromDB])
trace(level0["clip1.clip2.clip3.textfield1"])

Gives output:

Code:
Test
Test
But it won't change the text field. Nor is the value accessible with relative paths from inside the clips.

Sorry if the explanation is unclear ...

Does anyone know what's wrong, or a better way to achieve what I am trying to do?

Passing Event Target Name To Text Field
Hi There,

I'm new to 3.0 and can use some help here... should be an easy one for you experts...
I just need to pass an event target name to a text field:

square.addEventListener(MouseEvent.MOUSE_DOWN,downObj);

function downObj(event:MouseEvent){
targetObj = event.target;
mydrag.visible = true;
targetObj.startDrag();
mydrag.addEventListener(Event.ENTER_FRAME, dragClip);
target_txt.text = String(event.target);
}

I've also tried:
target_txt.text = event.target;
but no luck so far..

Any help would be highly appreciated.
Cheers...

Bruno Aun
Flash + Coldfusion Developer
http://www.BrunoAun.com






























Edited: 05/28/2008 at 12:52:13 PM by AunStudio

Passing Variable From An HTML Query String
HELP?

I am using the javascript

window.document.smoothie.SetVariable("_root.texty" , query);

in an HTML page, to pass the value in 'query' to a dynamic text box, 'texty' on the main timeline of my Flash movie.

The passing of the variable works, and can be seen on any one of these 3 pages:

http://www.runspotrun.com/test/page2.html?chewbacca
http://www.runspotrun.com/test/page2.html?hansolo
http://www.runspotrun.com/test/page2.html?obiwan

If the value of query is 'chewbacca' then what loads on the page is different than if the value is 'hansolo' and so on...

The passing of this variable works, EXCEPT - one needs to RELOAD the page to see it. When the movie/page first loads, the value doesn't appear. If it is reloaded, then the value appears. A following visit to the same page, even passing a different variable will work fine also. It's just that very first visit, the first time the movie is opened on a particular browser.

After many hours of trying to figure this out, I am at a loss. Can anyone help me with this please?

ThankS!
mark

Passing Special Characters On A Query String
Hi,

I have a project that requires to send a string variable to a swf movie using a query string in html like this:

<PARAM NAME=movie VALUE= "movie.swf?text=Vous êtes dans le Hall d'entrée.">

My problem is:
this text is read from a database using jsp and has special characters like é, è, à and other french specific ch.

I've seen the posts for external txt files using unicode, tried to save the html file as unicode, but still no results. My text field doesn't look right.


Can anyone help me? I ran out of solutions.
Thank you.

Passing Query String Var Into Flash Only Works Sometimes...?
I'm trying to pass a variable into Flash from a query string, and for the most part it works great.

flashmovie.swf?page=home

On any page other than the home page, the Flash movie should skip it's build animation and go right to a resting state. Code:

if (page != "home") {
gotoAndPlay("navigation");
} else {
play();
}

This only works as intended after visiting several pages. Lets say I arrive on the home page and the movie plays through all it's animations. Fine, great. Now I go to any other page and it should skip right to the 'navigation' keyframe - right? Wrong, the movie skips ahead only about 40 frames, and plays out the rest of the intro. All other pages afterward behave correctly as coded. And revisiting that second page also now behaves normally.

What's the deal?

Passing Multiple Variables In GetURL String
Is it possible to pass multiple variables in a getURL string?

I can do this getURL("javascript:doLMSSetValue('cmi.interactions .0.student_response','"+group1.getValue()+"')

where group1.getValue()is the variable. But what what I want to do is pass something like this

var qadata = doLMSSetValue('cmi.interactions.0.id', '1');
doLMSSetValue('cmi.interactions.0.type', 'choice');


and have tried

getURL("javascript:"+qadata+); and other varieties but can't quite get that to work.

Thanks.

Copyright © 2005-08 www.BigResource.com, All rights reserved