Loading Vars, But Not As A String?
I hope my title doesn't confuse you. Well, I am working on my website, right now my blog. The comments section to be exact. I load variables from a PHP script. I have it all working, except I want to load a number as a number, not a string, ie numRecords = 1, instead of numRecords = "1". I think there is a way to convert it, but I don't know. Thanks for you help
DevShed > Flash Help
Posted on: August 12th, 2004, 12:37 PM
View Complete Forum Thread with Replies
Sponsored Links:
Creating A String From Vars
hi all
I am trying to create a dynamic URL string that I can call using getURL. I am taking two inputs and placing them inside of a string
i.e: http://www.url.com/login?user=--VARI...ass=--VARIABLE
but I can't seem to get it to read the variable ...
website="http://www.url.com/loginView=Main&User=" + uname.getValue() + " &Password=" + pword.getValue();
getURL(website, "blank");
uname and pword are the names of the input boxes.
any thoughts.. please..
Thanks in advance.
View Replies !
View Related
Add/remove Vars From A String
Ive searched the archives and went to proto to see if I could dig anything up.
Basically Im trying to make a hotmail multi message delete function for a message reader.
Here is what Im doing on my home made check box: (try to look past all the _parent stuff, this box is pretty deep in a scroll pane)
Code:
on(release){
if(_parent.deleteMsg == "0"){
//make the red x appear and set the var to 1
this.gotoAndStop(2);
_parent.deleteMsg = "1"
//add the new message ID to the end
_parent._parent._parent._parent.delString = _parent._parent._parent._parent.delString + _parent.messageID + " ";
}else{
//take away the X is its already there and return the var this.gotoAndStop(1);
_parent.deleteMsg = "0";
// find the message ID and replace it
_parent._parent._parent._parent.delString.split(_parent.messageID + "
").join("");
}
}
So basically its appending fine, but when I want to search the string for the messageID var with the space, it doesnt work. Ive spent a lot of hours on this, and havent really felt like Ive come close.
Heres hoping you guys can help me (and add it to the archive for others)
Cheers,
Scott
View Replies !
View Related
Flash Vars In URL String?
I know this is a noob question... but I'm running out of hairs to pull...
I need to pass a flash variable via the getURL command.
That's it!... but I can't figure out the syntax.
This of course works fine with variable hardcoded:
getURL("fileName.cfm?varName=myName");
and in the document when I use <cfoutput>#URL.varName#</cfoutput> I get "myName"
as expected, but when i try to make it dynamic using either:
getURL("fileName.cfm?varName=&flashVar");
or
getURL("fileName.cfm?varName="&flashVar&"");
Where flashVar is the name of an input field on the stage...
I get nada.
ANY help would be GREATLY appreciated.
Thanks,
jH
The funny thing is these are both examples from MM's site.
View Replies !
View Related
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?
View Replies !
View Related
Multiline String Vars
Does anyone know if it is possible to have multiple lines of text assigned to a string variable in actionscript 2.0. Basically I have a class that parses XML data passed as a string. Originally erasing the line breaks and putting the XML data onto one line was not a big deal but now I am working with XML files that are 5k+ in length. Any help would be greatly appreciated.
Thanks in advance,
-Derek
View Replies !
View Related
AS3 - How Can I Pass Vars 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?
View Replies !
View Related
Can You Still Pass Vars Through A Query String?
I'm trying to pass variables in through a query string appended to my url like so,
http://www.mydomain.com?myVar1=value1&myVar2=value2
From what i've read am i correct in thinking that i should be able to access these properties through 'this.loaderinfo.parameters'?
I don't seem to be able to get this to work for some reason? I'm able to get it tworking when passing in Flashvars through my html and then accessing them through the loaderinfo.parameters object, but not through a query string? Anyone got any ideas? Should this be possible?
Also i was wondering it there's any foreseeable issue passing in values both through Flashvars and a query string or should the loaderinfo.parameters object be populated with all the values?
cheers.
View Replies !
View Related
Query String Vs Flash Vars?
Hi -
Im building an mp3 player to load and play various single mp3 files for a website. i want to control each instance of the player with variables in the param name and embed sections of the html code... (ie.. load a unique title, mp3 url into each instance of the movie on a given page)
im new to this side of flash... ive googled for info and found a few things but not enough to implement what im trying to do.... would be cool if some one could sort me out on this cheers-
John
View Replies !
View Related
Query String Vs Flash Vars?
Hi -
Im building an mp3 player to load and play various single mp3 files for a website. i want to control each instance of the player with variables in the param name and embed sections of the html code... (ie.. load a unique title, mp3 url into each instance of the movie on a given page)
im new to this side of flash... ive googled for info and found a few things but not enough to implement what im trying to do.... would be cool if some one could sort me out on this cheers-
John
View Replies !
View Related
AS 2.0 Load Vars From String To Numbers
i am loading two flash vars.
ActionScript Code:
startTime = this["MediaPos"]; and csMediaPlayer.duration = this["VDuration"];
they are both numbers startTime is 1200 and duration is 30. So I need to make a variable called end point that adds them up but when I
ActionScript Code:
var time:Number = csMediaPlayer.startTime;
var time2:Number = csMediaPlayer.duration;
//
trace (time + time2);
It doesnt add it just out puts 120030
Thanks for the help!
Robert
View Replies !
View Related
Class ► ASP Format Query String Vars
I recently had a flash project that required me to get query string variables and found it cumbersome, however i found a query string class here on the forums originally created by MichaelxxOA. http://www.actionscript.org/forums/s...31&postcount=2
I reqrote it and structured it to act like Request.QueryString() familiar to those that have worked with asp and aspx.
I also added some functionality to datatype the variables as well. For example, and numeric variable value will become a number once it is pulled in and a true or false will be converted to Boolean.
Anyway, I figured I would share...................
ActionScript Code:
//External Interface Class
import flash.external.ExternalInterface;
class Request
{
//STATIC PROPERTIES
//----------------------------------------------
//Switch to Load Vars if they haven't already been loaded
private static var hasLoaded:Boolean = false;
//Define Javascript Function
private static var getURLFunction:String = "function get_url(){return window.location.toString();}";
//Array to store values once they have been loaded.
private static var values:Array = new Array();
//CONSTRUCTOR
//----------------------------------------------
public function Request(){}
//PUBLIC STATIC METHODS
//----------------------------------------------
//--Query String
public static function QueryString(varName:String)
{
//Pull Valuse From Query String if you havent already.
if(!hasLoaded)
{
hasLoaded = true;
getValueArray();
}
return values[varName];
}
//--Get Values From Query String
private static function getValueArray():Void
{
trace("]> Loading Variables from Query String.");
var o:Array = new Array();
//Call Javascript Function
o = ExternalInterface.call(getURLFunction).split("?")[1].split("&");
for(var i:Number = 0; i < o.length; i ++)
{
var tempName:String = o[i].split("=")[0];
var tempValue:String = o[i].split("=")[1];
trace(" - " + tempName + " = " + tempValue);
if(!isNaN(Number(tempValue)))
{
//Datatype value as a Number
values[tempName] = Number(tempValue);
}else if(tempValue.toLowerCase() == "true" || tempValue.toLowerCase() == "false"){
//DataType value as a Boolean
values[tempName] = Boolean(tempValue);
}else{
values[tempName] = tempValue;
}
}
}
}
You would use it like this....
ActionScript Code:
var varFromString = Request.QueryString("varName");
View Replies !
View Related
Loading Vars And Loading Jpgs
Hi there,
Haven't been working with Flash much since Flash5. Now I'm starting all over in MX2004 and I can't get things to work.
Here's the plan:
I've got a php script that reads a directory and returns the total of images; the image names (img0 = bababa.jpg); and the directory in which they are located.
I want to create a photoalbum in which I dynamically load these jpgs one at the time. I was thinking to create a holder for each jpg and then set the visibility of the others to 0 or swap depths. Another solution ofcourse is to load a different jpg in the same holder clip.
Well here is the script I've managed to script/copy/paste together:
Code:
var mainTimeline = this;
varSender = new LoadVars();
varSender.cacheKiller = new Date().getTime();
varReceiver = new LoadVars();
varReceiver.onLoad = function (success)
{
if (success)
{
mainTimeline.cc_status.text += (this.total);
// this.total is a variable reveived thru the php file
} else {
//clearInterval(varPreloader);
mainTimeline.cc_status.text = "load failed!"
}
}
//varPreloader = setInterval(checkVarStatus,100);
function checkVarStatus () {
var kbLoaded = Math.floor(varReceiver.getBytesLoaded()/1024);
var kbTotal = Math.floor(varReceiver.getBytesTotal()/1024);
if (kbTotal == undefined)
{
kbTotal = "???";
}
mainTimeline.cc_status.text = kbLoaded + " / " + kbTotal + "Kb";
}
varSender.loaddirectory = "commissions";
varSender.sendAndLoad("http://localhost/pruigrok/load.php", varReceiver, "POST");
/////////// start jpg load //////////
MovieClip.prototype.loadjpg = function(picName, holderName)
{
var h = holderName==undefined ? "holder" : holderName;
this.createEmptyMovieClip(h, 1);
this._visible = false;
this[h].loadMovie(picName);
this.onEnterFrame = function()
{
if (this[h]._width > 0)
{
this._alpha = 99;
//delete this.onEnterFrame;
this._visible = true;
this.onComplete();
}
else
{
this.onLoading();
}
}
};
x = this.createEmptyMovieClip("xxx",1);
x.onLoading = function()
{
if(this.hhh.getBytesLoaded())
{
this._parent.cc_status.text = Math.round(this.hhh.getBytesLoaded()/this.hhh.getBytesTotal()*100)+"%";
}
}
x.onComplete = function()
{
this._parent.cc_status.text = Math.round(this.hhh.getBytesLoaded()/this.hhh.getBytesTotal()*100)+"%";
this._x = 100;
this._y = 100;
};
datum = new Date();
var count = 0;
function CC_loadJPG()
{
if(count+1<=varReceiver.total)
{
x.loadjpg("http://localhost/"+varReceiver.imgfolder+varReceiver["img"+count]+'?'+datum.getTime(), 'jpg'+count);
//varReceiver.imgfolder and varReceiver.img0 thru varReceiver.img10 are received thru the php file
count++;
}
}
stop();
I placed it in a frame of the main timeline. So the script automatically loads the vars onenterframe. Then on click I call the CC_loadJPG function which loads a jpg.
I think it's the best solution to load the jpgs in different holder clips. But how would I do this? And still have the loading status work? And how would I best hide the other holder mc's when the new jpg is loaded?
Any hints?
Cheers,
Gekke_Hollander
View Replies !
View Related
Help Loading XML Vars
Hello All,
I haven't worked much with XML, but I have now come across a time that requires I learn FAST!
I'm making a calendar; found here:
http://www.cadvision.com/birdgenj/calendar.html
Now here's the problem:
I need to load dates into this calendar from XML so that I can have the dates appear on their place in the calendar (for example I click aug 26th, and then the description appears at the bottom.)
So...
How can I parse the following XML to load these variables into flash (Month, Day, Year, Description);
[EVENT]
[MONTH]7[/MONTH]
[DAY]26[DAY]
[YEAR]2001[/YEAR]
[DESCRIPTION]Student Orientation 10:00[/DESCRIPTION]
[/EVENT]
Thanks in advance!
Help is greatly appriciated
Birdgenj
View Replies !
View Related
Loading Vars
anyone here can explain how to load variables into a txt file??
i know we can call variables from a txt file.
is it possible tjhat i load vars into a txt file and tyen call them later so that i mnaintain the top score list.
thanx
View Replies !
View Related
Loading Vars From URL
want to load in some variables from the url, for example:
http://www.mydomain.com/flash.asp?data=var1,var2
anyone know if it is possible to load var1 and var2 into FlashMX as a string?
oh yeah, the SWF that needs these vars is also loaded onto this page... if that helps.. ; |
ta
View Replies !
View Related
Loading Vars
hello!
i've another question:
whats the best way to load variables out of a text file?
i alway use this way:
_root.loadVariables("texfile.txt");
_root.onData = function() {
// code
}
so does it work if i load more variables (cause _root.onData = function() is used 2 times !)?
example:
_root.loadVariables("texfile.txt");
_root.onData = function() {
// code
}
_root.loadVariables("texfile2.txt");
_root.onData = function() {
// code
}
View Replies !
View Related
Loading New Vars: Please Help
My first post on the board guys I hope someone can give me an answer on this.
What I am trying to do is have the movie load new variables over a set time, like 5th frame or something.
Right now I have it working in the designer (MX 2004) but when I export and put it on the site, it grabs the first set of variables and just stops.
The code is basiclly a LoadVariables("theasppage",0) with a swonker or whatever ya call it in frame 3 to check to see if the varables were loaded. On frame 5 it uses the varables to move a few objects.
After the objects are moved it does a gotoandplay(1) where the loadvariables is at.
This works in the designer but not on the page.
Any reasons why?
Mike
View Replies !
View Related
Loading Vars From A Url
this is for a media player for my site.
im trying to load the song information from a .txt into flash as variables that would be set up like this:
Code:
songs = new Array();
songs[0] = new plItem("Greeley Estates - Outside of This", "Greeley Estates", "Outside Of This", "3:11");
heres the class definition that the play function i made loads:
Code:
plItem = function (linkageName, artist, title, length) {
this.linkageName = linkageName;
this.artist = artist;
this.title = title;
this.length = length;
};
so when the play funciton accesses song info, its like this:
Code:
_root.songs[0].artist
_root.songs[0].title
id just like to be able to load songs from a folder on my ftp instead of changing the .fla everytime i want to switch up songs!
Real Question:
How do I format the text in my .txt file and so that I can load the song information into flash?
please ask any questions that would help you better understand my problem and what im trying to do. thanks
View Replies !
View Related
Loading Vars In To A MC
I am loading an initial value into my movie clip (from DB using PHP and loadVars) - i.e. a jackpot value - then use getTimer(); to increase the jackpot by X amount. I have the timer working, and other vars loading into text boxes, but I cant seem to get my var to load into my movie clip. I know I have the code correct, but am unsure if I can, and how to load the vars into a MC. Does anybody have a way to load vars into a MC? Am I doing this correctly? The FLA is attached...thanks
Mike
View Replies !
View Related
Loading Vars From XML
Now I've been dealing with a big problem I go to load a XML document from my flash movie and it loads and everything but the XML document just shows me what's wrote inside the xml document as if its just viewing a text file. I looking to know how to just make it read the vars that are defined inside the xml not the script. I looking to load such things as like High scores and stuff of that nature as in something like this _root.score=152; I just want it to show the 152 in my dynamic text box with the var _root.score. not the _root.score=152;. I'm also wondering how do you save info into a XML document?
Please help me if anyone can
View Replies !
View Related
Loading Vars
Im trying to load vars threw flash basically the embed code "test.swf?id=1" . I want to load a php file inside
flash not sure if this is the right code to load in flash for the php file but somthing like this.
this.loadVariables("phpfile.php?id=000");
Where the 000 is I want the number 1 on the embed code for flash to transfer into the flash swf file then load the
phpfile it will look something like this ("phpfile.php?id=1"); the php file will not print anything on flash. Im
not sure how to put a var where 1 is. Im using in the php file the request fuction $id = $_REQUEST[id];
thanks
View Replies !
View Related
Loading Vars From Php
Hi all,
I'm new to actionscript, and was having some trouble with turning a php echo into a variable for actionscript to process
Code:
loadVariables("modules/match.php", ""); // returns uMax=11
trace (uMax);
for (i = 0; i < uMax; i++) {
clip = attachMovie("Container", "u" + i, i);
setProperty("u" + i, _y,i * 14);
}
the ac script works if I define uMax in flash, but the trace comes up undefined...How do I return uMax as a variable?
Thanks in advance
View Replies !
View Related
Loading Vars
I've been trying to figure this out for hours, many hours...
PHP Code:
$table=forum;
if($_GET['action'] == displayNews) { $table=news;};
$query="SELECT * FROM $table";
$result=mysql_query($query);
$row = mysql_fetch_assoc($result);
echo "&name=$row[title]&";
it doesnt matter what's in the PHP file really.. but my point is: flash doesn't go through the IF Statements in the PHP so if i change the variable in the PHP file dynamically, flash returns UNDEFINED.
im gonna explain it again to be clearer.
in php i can initialize a Variable.
for example
$section="news";
then i can change it.
PHP Code:
if ($_GET['action']=="contact")
{ $section="contact" ;}
but flash won't look at that.. it will just load whatever value was there initially.("news")
please Help. thank you
View Replies !
View Related
Loading Vars From Php
hi there, Im trying to load variables in from php, It is not working though, flash seems to load in the raw php file, instead of the parsed file. for example, in php if i say
Code:
echo "&var1=$host";
flash will bring in the value "$host". The php page is being served, though, i can run the file on the server and it prints out the value of host correctly.
anyone have any ideas?
thanks in advance.
View Replies !
View Related
MX Loading Vars From A Txt
ok I have a load vars function that looks for a txt file and grabs data from it, right now they have to be in the same dir. I'd like to have the txt in the root of my server and then be able to link from any dir in the site...
I have: ("dataValues.txt")
what should I add before it, I thought maybe a full URL, but no, is it something like ("../dataValues.txt"), basically I want to make the link global for the site - I dont have access to the files right now so I cant just try a bunch of stuff myself.
Peace
View Replies !
View Related
Loading Vars Help
I dunno if 'm posting in the right zone still.. i did a typical loadvars only i did it on the onenterframe event... and it loads one million times the same thing.. so i modified it to load only when it changes... and it worked... if i changed it manually from notepad then the text from flash changed... So i decided to go even furtherer and thought of modyfing the text file in flash using php.. i sent the variables to php.. the php script modifies the text file but the flash program doesn't... why?? I REPEAT.. only when using php.. manual edit works..
View Replies !
View Related
Loading Vars
since it seem sapparent that i cant loadvars externally, how can i use the flashvars section of the flash embedding code? so that i can make my links be adjustable without making a new flash file everytime, but without having to overcome the problem of not being able to use theload vars to an external text file..
View Replies !
View Related
MX Loading Vars From A Txt
ok I have a load vars function that looks for a txt file and grabs data from it, right now they have to be in the same dir. I'd like to have the txt in the root of my server and then be able to link from any dir in the site...
I have: ("dataValues.txt")
what should I add before it, I thought maybe a full URL, but no, is it something like ("../dataValues.txt"), basically I want to make the link global for the site - I dont have access to the files right now so I cant just try a bunch of stuff myself.
Peace
View Replies !
View Related
Loading Vars Help
I dunno if 'm posting in the right zone still.. i did a typical loadvars only i did it on the onenterframe event... and it loads one million times the same thing.. so i modified it to load only when it changes... and it worked... if i changed it manually from notepad then the text from flash changed... So i decided to go even furtherer and thought of modyfing the text file in flash using php.. i sent the variables to php.. the php script modifies the text file but the flash program doesn't... why?? I REPEAT.. only when using php.. manual edit works..
View Replies !
View Related
Loading And Using Vars
Hi all,
I have 1 text file, in wich is specified: "filevar=file1.swf"
In my flash movie, I need to load this var and use it to load the specified file, so I tried the action: loadMovieNum="_root.filevar"
sure it didn't work. I dont knoew how to use this vars inside an action like LoadMovie.
Can somebody help to get better?
thanx all entries
D E M A S
f l a s h
View Replies !
View Related
Loading Vars Into Flash From URL
hello-
I'm having a problem loading a var from the url (i.e. index.php?p=1). Here's what I have so far...
in the embed and object tags I attach "p" to the end of the .swf file (i.e. myFlash.swf?p=1). Then in my flash movie I try to read this var by using the _root.p however, I get nothing in that var.
is there a reason for this? I thought that _root.p would hold the var in the url that I passed...
thanks,
jay
View Replies !
View Related
Loading Vars Within Function
I want to load variables from a database query into level 10. Using the function below, it seems the vars are loaded into the Functions Moviclip on level 10 rather than level 10 itself.
This is the function in my function MC sitting on level 10
--------------------------------
function loadvars_summary () {
loadVariablesNum ("industry-news.asp", 10, "GET");
}
--------------------------------
If i create this same function and call it by the label name from level 10 itself, it works fine, but not as a function within a MC.
Any ideas...!!!
View Replies !
View Related
Loading Many Vars Into One Box, But Individually From One Txt
I have a text file called workloads.txt
Inside it are these variables ...
text1= blah blah blah
&text2=some more blahs
&text3=even further blah blah blahs
I have managed to display all my variables in to the text box in the movie, but by creating a separate textbox for each variable.
as follows
button one calls this....
**************************************
on (press) {
gotoAndStop (3);
loadVariables ("workloads.txt", "_root.text_box1");
}
*************************************
This goes to frame 3 and in frame 3 there is a text box with the variable called text1
I do this all along in the movie for many buttons and still read off one txt file.
The problem is I need to have one text box but many buttons pointing to variables in one text file... So rather than create multiple boxes and many frames for each variable in my txt file I want to show all the variables in one box but separately and not create so many frames and so many text boxes!
I hope this make sense?
Please help.
View Replies !
View Related
Loading Vars From .php File Into MX
I know how to load variables into flash from a txt file but I'm wondering how to do it from a php file. If I try loading it the same way as a text file I get "_level0.myvarname" in the place of what I want to be loaded.
Is there a certain way to go about naming variables in the php file? Any help would be appreciated.
Mike
View Replies !
View Related
Loading Vars From PHP Script
Hi everyone!
I have a problem updating data in a Flash movie. I'm using loadVariables() function to get the vars from a PHP script. I need to execute that script let's say every 10 seconds and get updated data from a database. I have a MovieClip object, which calls that function every 10 seconds.
Now the problem is following: when I use loadVariables with simple text file (loadVariables("data.txt", this)), it works every 10 seconds and I get updated data from that file. But when I try to do that with PHP script (loadVariables("getdata.php", this)) it only loads data the very first time and then it does not seem to call that function again and get updated data. Or maybe there's anything that doesn't allow PHP script to execute once more?
I'm really stuck with this trouble, please help!
Thanks a lot beforehand!
View Replies !
View Related
Loading Vars From An Asp File
hi.
i'm hoping someone can help. i am trying to load vars from an asp file and am having no luck. i've tried everything i can find to do it and still it does not work. the asp file outputs in standard format "var1=text1&var2=text2&" etc. but i can't seem to get loadVars.load or loadVariables to read the output. if there is a trick or a certain way of doing things, please let me know.
also, can i download all the variables to _root then access them from various movie clip thoughout the rest of the movie? if so, do i have to declare 2 separate variables? ie: this.var1 = _root.var1 or can i just go straight to using var1?
these variables are being used to dynamically fill text, images and links.
thanks.
jason
View Replies !
View Related
Loading Array/vars From Txt
hi everyone, i can load vars from a txt file but can't seem to manage loading arrays or similar. i want to end up with an array variable, which also can have arrays inside of the arrays.
any suggestions? thanks for any help.
View Replies !
View Related
Loading And Sending The Vars
hi
Thanks for the previous help
I have a movie from which I am sending the var to asp pages and loading it from it . the coming data is according to the var send.
problem is that my mov contain several movies one inside the another . when i send and recieve var from top mov everthing goes right but when I tried same with movie inside the top movie it does,t do it . why I dont know it just keep loading the vars and give mess tha t not able to connect the site.
code
mymov.loadvariableNum(url,method)
I also tried with loadVars object but the same thing goes .
tell me the sol if any body have. My movie contain large number of the vars so I have to send few of them that's why i am using post
thanks and regards
bips
View Replies !
View Related
Loading Vars In LoadSound
Hi guys,
Hi,
I figured out how to use ASP in Flash and it's no problem to load and send textfield data from and to the asp page.
But now I need to know how to get a variable from that asp page into my loadSound object.
the asp page (audio_loader.asp) is giving this as result
audio1=sounds/sound1.mp3
Now I want to assign it to the soundLoad
loadVariablesNum("audio_loader.asp", 0, "POST");
stop();
function MoveNext() {
nextFrame();
}
coolTune = new Sound (soundLoader);
coolTune.loadSound( here needs to be the var audio1 ,true);
coolTune.onSoundComplete = MoveNext;
Do I first need to get the var out of the asp file?
I dont know how I need to code this. must be simple
View Replies !
View Related
Loading Clips In Via Vars
Hi all
Got a filthy piece of code here that isn't loading clips in as it should.
Anyone able to shed some light? All of the swf's are named correctly (westAustralia.swf etc) in the directory.
When clicking one of the faux buttons (b1, b2, b3 etc as they are called in each clip, which are really just static MC's), the existing movie is simply removed.
Code:
b1.placeName = 'westAustralia'
b2.placeName = 'northTerritory'
b3.placeName = 'queensLand'
b4.placeName = 'newSouthWales'
b5.placeName = 'southAustralia'
b6.placeName = 'tasmania'
b7.placeName = 'victoria'
this.i = 0;
while(this["b" + (++this.i)]) {
this["b" + this.i].onRollOver = function():Void {
myColor = new Color(this);
myColor.setRGB(0x5FBEFE);
}
this["b" + this.i].onRollOut = function():Void {
myColor = new Color(this);
myColor.setRGB(0x139FFD);
}
this["b" + this.i].onPress = function():Void {
_root.stage_mc.loadMovie(["b" + this.i].placeName + '.swf')
}
}
delete this.i;
View Replies !
View Related
Not Always Successfull Loading Vars
When I run this code, sometimes the first call of the function produces 'undefined' then the second call gets the right variables. Other times the first call won't open the file at all. Finally very occassionally both calls work OK.
Is there a way to make this more reliable?
PHP Code:
function loadthumbs() {
v = new LoadVars();
v.load("http://www.charliekassel.com/_joncox/exterior.txt");
v.onLoad = function(success) {
if (success) {
n = v.name.split(",");
trace(n);
}
};
}
loadthumbs();
loadthumbs();
View Replies !
View Related
Loading Vars From Php To Flash
hello everyone,
I want to make a HTML page with a flash movie in this page. within this html page is a php variable. i want to let flash load this var, how do i do this.
i looked for this in serveral forums but came out empty handed.
the only thing i found a few times is how to load a var from a php file, i want to get a var from the same html page where the flash movie is embedded.
it's possible as far is i know, but today my mind is playing ticks on me so i can't figure it out .
thanx in advance .
maxgrafx
View Replies !
View Related
Loading Vars Problem
Right okay this is a bit complicated to explain, but hopefully you will get it.
Basically I've got my master file which i have created, which loads all my other swf files into. In frame 1 in the actions layer i have a normal movie clip loader and a normal vars loader. And basically when i create my seperate sections, in these sections i create a dynamic text field, which loads my notepad text files using the loaded vars variable in the master file into the text feild in that section.
Well that all works fine. But what i want to do is basically create a seperate swf file which loads into the text field and in the section when the user clicks on the picture (which is the swf) a box will come out, and what i want to do is have that text coming from a text file just like i do for loading the image file into the text area in the section.
To break down even more so that you guys understand... here is a lil more help to explain what im exactly trying to do....
This is the action scripting in my "master" file (This is where all my content loads into)
PHP Code:
stop();
// ----------------<MCL-Loader>-------------------- \
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
// ----------------</MCL-Loader>-------------------- \
// trigger the MCL to load this asset.
myMCL.loadClip("trigger.swf", 5);
// ----------------<LoadedVars>-------------------- \
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function(success) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error with loading the content please contact the webmaster";
}
}
// ----------------</LoadedVars>-------------------- \
Then on Frame 10 in the master file we have this action scripting;
PHP Code:
stop();
myMCL.loadClip("navigation.swf", 20);
Now the next part of action scripting is from the "crew" page which is the page that loads into my master file.
On this page we have a dynamic text box which loads a css styles sheet and then the actual text from the "notepad" text file using the loaded vars varaible. In the notepad file we have an image html tag which loads the swf file
PHP Code:
// -------------<Load CSS>---------------- \
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("styles/styles.css");
cssStyles.onLoad = function(success) {
if (success) {
loadedInfo.styleSheet = cssStyles;
_level0.myLV.load("vars/crew.txt");
} else {
loadedInfo.text = "There's been a problem loading the content, please contact the webmaster";
}
}
// -------------</Load CSS>---------------- \
// -------------<scrollBtn>---------------- \
var scrollDirection:String;
this.scrollDown.onPress = function() {
scrollDirection = "down";
scrollText();
}
this.scrollDown.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollDown.onReleaseOutside = function() {
delete _root.onEnterFrame;
}
this.scrollUp.onPress = function() {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollUp.onReleaseOutside = function() {
delete _root.onEnterFrame;
}
function scrollText () {
_root.onEnterFrame = function () {
if (scrollDirection == "up") {
loadedInfo.scroll -= 1;
} else if (scrollDirection == "down") {
loadedInfo.scroll += 1;
}
}
}
// -------------<scrollBtn>---------------- \
All this works fine. But in the text field that i am loading i have an image and this image is an "swf" file which is also an animation type thingy. And in this swf file i want to be able to do the same exact thing but have the text load into the text field on that swf page on a particular frame. Now i have added this action to frame; "39" because this is where the text field comes up in the animation:
PHP Code:
stop();
// -------------<Load CSS>---------------- \
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("styles/styles.css");
cssStyles.onLoad = function(success) {
if (success) {
loadedInfo2.styleSheet = cssStyles;
_level0.myLV.load("vars/rob.txt");
} else {
loadedInfo2.text = "There's been a problem loading the content, please contact the webmaster";
}
}
// -------------</Load CSS>---------------- \
But for some reason when it gets to this frame, it then loads the "rob.text" file into a seperate text field like its a different page and not into the text field i want it to go into on the swf file, i think it loads it into the original text field above. The text field i want it to load into is called "loadedInfo2" which is in the swf file which gets loaded into the "crew" page via a "loaded vars" variable as you can see.
I know this is pretty hard to understand but if anyone can help me figure this problem out. It would be amazing LOL
Thanks in advance
View Replies !
View Related
Help Loading Vars From Html
I’m trying to load an image into flash when the visitors screen resolution is more than 800px wide using this JavaScript:
quote:
window.onload = function() {
setTimeout(getRes, 0050);
}
//this makes html communicate with flash.
function getMovie(movieName) {
if (window.document[movieName]) {
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1) {
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
} else { // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
return document.getElementById(movieName);
}
}
function getRes() {
var flashMovie=getMovie("test");
if (screen.width > 800) {
res = "foo";
alert('1024');
flashMovie.SetVariable("/:screen", res);
}
And in the flash file “test.swf” the ActionScript on frame 2 is:
quote:
if (screen == "") {
gotoAndPlay(1);
}
(frame 1 has no ActionScript)
I’m trying to use the if statement in Flash to make sure the var ‘screen’ has a value before proceeding to the frame that uses that var. I’m not sure if this is the best way of testing a var has a value.
Also, the if statement doesn’t seem to work? The var is recognized by flash as being “foo”. I can see this using a dynamic test box with the var name “screen”.
I’ve spent days trying to get the if statement to work. I really need some help!
Thanks.
View Replies !
View Related
Loading Vars From URL Address Bar
Ok let me define my problem.
I have a flash header/menu (I partially used the preloader/menu tutorial from Kirupa)
I have it when the user clicks on a link it loads the php ?page=portfolio, in portfolio.php i have a peice of code that writes "var=portfolio.swf" to a .txt file Actionscript loads the text file and grabs the var, which is sent to the preloader which loads portfolio.swf. The problem with this is the Flash cache, you have to open a new window to see the portfolio.swf loaded and the second problem would be clients fighting over the .txt file.
What I want to do is, eliminate everything on the client side (the txt file) and make it so flash picks up the vars from ?page=portfolio and directly passes that to the preloader.
I heard this can be done with FlashVars, its kinda hard for me to understand could some direct me to an example code of FlashVars that I can play around with.
Thank you,
x-naga
View Replies !
View Related
Loading Js Vars Into Flash
hello i got this for my js:
Code:
SCRIPT LANGUAGE=JavaScript>
<!--
document.write ("width="+screen.width+"height="screen.height)
//-->
</SCRIPT>
and i have this in the Actions of a movie clip inside the swf
Code:
onClipEvent (load) {
_root.navigation._alpha=0;
}
onClipEvent (enterFrame) {
loadText = new LoadVars();
loadText.load("main.html");
loadText.onLoad = function() {
height.text = this.heightY;
}
_root.navigation._y = this.heightY - 100;
}
whats this supposed to do? well, its suppose to get the current height of the window and then sending the var to the swf, after it to movieclip inside the swf should get the vars from the html document and to start the var "heightY", it is not working, so i tried this:
Code:
<SCRIPT LANGUAGE=JavaScript>
<!--
var htmlY = (!document.all)?
window.innerHeight:document.documentElement.offsetHeight;
document.myFlash.SetVariable('navY', htmlY)
window.document.myFlash.SetVariable("navY", htmlY)
//-->
</SCRIPT>
and also this:
Code:
<SCRIPT LANGUAGE=JavaScript>
<!--
var htmlY = document.write.screen.height
document.myFlash.SetVariable('navY', 'screen.height')
window.document.myFlash.SetVariable("navY", sendText)
//-->
</SCRIPT>
so, the code for the movie clip would look like this:
Code:
onClipEvent (enterFrame) {
_root.navigation._y = navY-100;
}
not working...
could someone be so patient and kind of helping me out? ^^'
I've been working on this for a while, and i have too much coke and coffee on my veins right now x.x
i beg of you, in the name of flash, help me... u.u
View Replies !
View Related
|