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




Loading Image From Id Passed From Php



Actually I am working on a project where images are loaded in flash fro id passed to him from server.For example

http://www.coloringbookpictures.net/...php?imgid=1001
http://www.coloringbookpictures.net/...php?imgid=1002
http://www.coloringbookpictures.net/...php?imgid=1003
http://www.coloringbookpictures.net/...php?imgid=1000


i am thinking the way to load it through loadMovie() but still had doubt.If any one suggest any other .Or there are any tutorials out there to help me

Thanks in advance



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-14-2007, 07:36 AM


View Complete Forum Thread with Replies

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

Loading Dynamic Text From File By Using Passed Var String
Okay, so I have a movie clip, a rotating wheel, and as the wheel rotates, it changes the value of a variable (centerBox). Clicking on the foremost part of the wheel loads a mc into a higher level that has info about that part of the wheel. On this 2nd level there's currently a button to unload (and go back to the wheel), a text box with some summary text, and a button to play a video related to the subject.

The swfs for these loaded levels (the 2nd level, and the video) are named in such a way that I am passing the centerBox variable and concatenating a string for the rest of the file name to be loaded, ie:


ActionScript Code:
var centerBox = "pac";

and so clicking on the button to load the 2nd level mc has a line that says:


ActionScript Code:
on(release) {   
    var filename = wheel.centerBox + ".swf";
    loadMovieNum (filename, 1);
}
which loads the pac.swf file...

and to load the movie from this screen, the button has a line that says:


ActionScript Code:
var vidname = _level0.wheel.centerBox + "vid.swf"
    loadMovieNum(vidname, 3);
which would load the pacvid.swf mc (going with the above declaration).

The problem is that I have a dynamic text box, instance name testText:

ActionScript Code:
myData = new LoadVars();
myData.onLoad = function(){
    testText.wordwrap = true;
    testText.autosize = "center";
    testText.text = this.pac;
    testText._y = 384 - (testText._height/2);
};
myData.load("kiosk.txt");

Which, as you can see, loads the text from a file, from after the pac= line in the file. This means that, for the 9 parts of my wheel, I have to have 9 of these template/2nd screen swf's, with the

ActionScript Code:
testText.text = this.xxxx;
line in everyone. If I could pass the centerBox variable into that line, to somehow dynamically load the appropiate part of the text by using the information from a passed variable, I could have ONE swf for all 9 parts of the wheel, and just pass one of 9 variables to call all of the information.

Understand? I hope I explained it okay... Can I do this? I've been looking the past 2 days for importing text from a .txt file using the string from a variable...

Dynamically Loading Image Problem (Image Covers Up The Animation)
I am trying to create a movie that uses a dynamically loading jpeg. I have some vertical lines that move across the movie and should go over the jpeg image. The problem I am having is the image covers the effects. I have tried to add "loadMovieNum("images/main_image.jpg", 0);" on Layer 2 and then on Layer 1 I have my animated lines that should go across the jpeg image. The line animation is on the bottom layer, but the image still covers the effects. Am I doing something wrong?

I have attached the .fla file for an example.

Dynamically Load An Image-Either The Image Resizes Or The Movieclip It's Loading To?
I will make a frame movie instance 400 X 400px called frame_mv.

I will use the script:
loadMovie("pic1.jpg", frame_mv);

If the pics being loaded were of different sizes. eg pic1.jpg was 1600 X 800

1- How would I make the pic resize to 400 X 400 or 400 X 200 so that it fits the frame_mv.
2- How would I make the frame_mv change size according to the pic dimensions being loaded?

Loading External Image > Image Appears Invisible
Hé,

I'm not posting here very much, so hi to anyone new.
I tried search for a solution to my problem, but I couldn't find one.

I'm using a button to load an external image:

code: on (Release) {
_root.temp.loadMovie("img.jpg");
}

Don't worry, both img.jpg and _root.temp (a box-shaped MC) excist.

When I press the button, _root.temp should be swaped by the image. Instead, it disappears, but no image appear. I have absolutely no idea what I'm doing wrong! I'm using Flash MX btw.

Here are my files:

http://www.cmd.tech.nhl.nl/users/regne200/test/

Loop While Image Is Loading / Fade Image As It Loads
Hi, another question:

I'm pulling a jpeg into a flash file using this:

loadMovie("digitalP_bg_2.jpg", "holder");

i have a shape over the image which is being pulled in, and this shape is supposed to fade after the jpeg is loaded - i've used straight forward tweening for the fade. howe ever, even though the loadMovie function is placed before the fade on the timeline, the jpeg takes a while to load and so the fade happens before the actual image has loaded.

my action scriptiing is very very minimal, i'd like to know if there's an easy enough solution to this. what i am thinking of possibly is creating a loop while the image is loading - provided that it isn't too complex to detect how much of the image is loaded.

any suggestions?

you can view the fla and swf here:

http://www.ponch.biz/flashtest/

cheers

Ponch

Basic Image View Not Dynamically Loading Image URL
What I have done Is added only a List Component to the stage and named it "lb". Then I'm Dynamically loading the data and label attributes from an external XML file. Now, I am Listening for the change event on 'lb" in order to create a new url request from the data property of the selected 'lb' item. Unfortunately, I am recieving this error message.

1067: Implicit coercion of a value of type flash.net:URLLoader to an unrelated type flash.display:DisplayObject.

Code:

var loader:URLLoader = new URLLoader();
var xml:XML;
var imgLoader:URLLoader;

loader.load(new URLRequest("http://www.xxxxxxx.com/Pictures.xml"));
loader.addEventListener(Event.COMPLETE, onLoaded);
lb.addEventListener(Event.CHANGE, itemChange);


// Loads XML data into List Component LB
function onLoaded(e:Event):void{
   xml= new XML(e.target.data);
   var il:XMLList = xml.Album[0].image;
   for(var i:uint=0; i<il.length(); i++){
      lb.addItem({data:il.attribute("url")[i],
               label:il.attribute("title")[i]});
   }
}

//Passes String used for URL
function loadImage(url:String):void{
   imgLoader = new URLLoader();
   imgLoader.load(new URLRequest(url));
   imgLoader.addEventListener(Event.COMPLETE, imageLoaded);
}

//Creates Sprite from image url passed through loadImage
function imageLoaded(e:Event):void{
   var image:Sprite = new Sprite();
   image.width = 200;
   image.height = 400;
   image.x = 200;
   image.y = 10;
   image.addChild(imgLoader);
}

//OnChange .selected item passes URL String to LoadImage
function itemChange(e:Event):void{
   loadImage(lb.selectedItem.data);
}
   

I'll admit I'm still a little new at this but I was thinking that URLRequest only need a String value wich I should be getting from "lb.selectingItem.data.toString()... atleast thats what it has been tracing. Any help is welcomed and thanks in advance.

Targeting Image Container After Loading Image In
hey guys,

i load an image from an array into a container MC.
after that i want to assign onPress function and read an image that's loaded.
but it seems after its loaded i can't do so, why is that and how do i get around this issue?


ActionScript Code:
loader_MC.loadMovie(_root.imageArray[0]);

//then
loader_MC.onPress = function(){ // this doesn't work as soon as there is an image there.
//do somthing
}
thanks!

Gallery Image Loading - Getting Image Width..help
Ladies and gents:

having a problem with my code somewhere; I'm stumped. Here's what i'm trying to do:

-When you click on a thumbnail in my gallery a load bar appears that is the width of the loading image
-While the image loads the load bar scales from full width to zero
-Once it finishes loading the image fades in
-Click on a new thumbnail, and the old image fades out, then the scrollbar is supposed to take the width of the NEW image and do the same thing

What is happening is that the scrollbar width does not set itself to the new image size until i click the thumbnail a second time...try this link to see what i mean. it's on the "portfolio" page.

http://www.lewisweb.ws/staging

here's the code:



Code:
//CONSTANTS
frame_x = 387; //the exact x coordinate where the box originates
frame_y = 184; //the exact y coordinate where the box originates
alphaSpeed = 5; //spped at which the pics fade in

//INITIAL SETTINGS
containerMC._alpha = 0;
containerMC._x = frame_x;
containerMC._y = frame_y;

//Fades in a picture loaded externally
MovieClip.prototype.loadPic = function(pic){
containerMC.fadeOldPic(); //fade out old picture
containerMC._alpha = 0;
this.loadMovie(pic); //load new pic
var loadIsComplete = false; //reset load checker
var w = containerMC._width;
loadBar._width = w; //set loadbar to new movieclip width
loadBar._alpha = 100; //make loadbar opaque
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
loadIsComplete = (Math.round(l/t) == 1); //check to see if load completed
loadBar._width = w - ((l/t) * w); //sets width of loadbar dynamically
if (loadIsComplete){
containerMC._alpha += alphaSpeed; //if load is complete, fade pic in
}
//if the load is complete and the picture is fully faded in...
if (t != 0 && loadIsComplete && _root.containerMC._alpha == 100){
loadBar._alpha = 0; //make the load bar disappear
delete _root.onEnterFrame;
}
}
};

//Fades out an old picture...pretty self explanatory
MovieClip.prototype.fadeOldPic = function(){
_root.onEnterFrame = function(){
_root.containerMC._alpha -= alphaSpeed;
if (_root.containerMC._alpha == 0){
delete _root.onEnterFrame;
}
}
};

containerMC.loadPic("portfolio/westin.jpg");
stop();
ANY help will be appreciated!

Loading Image When The Image Is Created On The Fly
I hope the title made sense.


Off Topic:
If this has been covered elsewhere please let me know and I'll ask a moderator to remove this thread


I am trying to load a gif that represents a graph of Gold Prices. The image in question is updated periodically and can be used as long as it has been unaltered and has the name of the service provider that supplies it along with a few other conditions. It's from Kitco.com.

The image itself can be found here: http://www.kitco.com/images/live/gold.gif

The easiest way to this to my knowledge is to create an empty clip, give it an a name (mcImage) and load the image as follows:

_root.mcImage.loadMovie("http://www.kitco.com/images/live/gold.gif");

* I've used an onClipEvent(load) to fire the loadMovie function.

This should work and works pretty much first time every time whenever I've needed it before but it doesn't work for this one.

Any thoughts?

Thanks,

Dynamic Image Loading / Images Not Loading?
This is my first try at loading images with action script. I read through the forums, borrowed code, and adapted it.

///////////////////////////works fine
myvars = new LoadVars();
myvars.load("alldoorsdesc.txt");

myvars.onLoad = function (success) {
if (success) {
_root.doorsinsttxt.htmlText = myvars.d1txt+"<BR><BR>To order call us at 505 934 8888";
//I would like to create a for loop here so addidtional
//items can be added, is this possible?
_global.dr1txt = myvars.d1txt;
_global.dr2txt = myvars.d2txt;
_global.dr3txt = myvars.d3txt;
_global.dr4txt = myvars.d4txt;
_global.dr5txt = myvars.d5txt;
}
};
///////////////////////////doesn't trace to loaded door

var doormovie = _root.createEmptyMovieClip("imgmovie",_root);
doormovie._y = 100;
doormovie._x = 300;
doormovie._width = 300;
doormovie._height = 300;
function loadpic(num){
trace("inside loadpic" +num);
doormovie.createEmptyMovieClip("img"+num, num);
doormovie["img"+num].loadMovie("images/door"+num+".png");

//// I'm not sure about this line
doormovie["img"+num].onload = function(){trace("loaded door"+num);};

stop();
}

function unloadpic(num){cont["img"+num].removeMovieClip();}
function unloadAll(){cont.removeMovieClip();}
loadpic(1);// load the inital picture

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

Are all these functions loaded into the root visible from another movie that is imported with getURL ? Or do I have to copy the functions to that imported movie?

[AS] Loading Main Image While Loading Thumbnails
Hello,

I've got a custom gallery of sorts going on and there's a problem with it... There's 146 photos that have thumbnails loaded in and when clicked open up a larger photo in the presentation.

What happens is while the thumbnails are loading, if one that has loaded is clicked, the main image movieclip runs, but the photo itself doesn't load. It won't load until all the thumbnails are loaded in.

Is there a way to tell the clip to load it too? Or interrupt the thumbnail loading process then restart once the loaded image has completed?

Here's what I'm using...

[Thumbnail loader]

ActionScript Code:
stop();
var tSpacer:Number      = 100;
var imagesT:Array       = [];
var imagesM:Array       = [];
var thisWid:Array         = [];
var thisHgt:Array         = [];
var imgNum:Number         = 0;
var loadthis                = "http://www.hpiracing.com/swf/2007/b2v/photoloader.php";
var myXML:XML         = new XML();
myXML.ignoreWhite       = true;
myXML.onLoad             = parseMe;
import flash.display.*;
function loadBitmapSmoothed(url:String, target:MovieClip)
{   
    // Create a movie clip which will contain our     
    // unsmoothed bitmap   
    var bmc:MovieClip = target.createEmptyMovieClip("bmc", target.getNextHighestDepth());
    // Create a listener which will notify us when     
    // the bitmap loaded successfully   
    var listener:Object = new Object();   
    // Track the target   
    listener.tmc = target;     
    // If the bitmap loaded successfully we redraw the     
    // movie into a BitmapData object and then attach   
    // that BitmapData to the target movie clip with   
    // the smoothing flag turned on.   
    listener.onLoadInit = function(mc:MovieClip)
    {       
   
        mc._visible = false;       
        var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
        this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(), "auto", true);         
        bitmap.draw(mc);   
   
    }; 
    listener.onLoadStart = function(targetMC:MovieClip)
    {
       
        //trace("started loading "+targetMC);
        targetMC._parent.mc_photoPreloader._visible = true;
        targetMC._parent.mc_photoPreloader._width   = 0;
       
    };
    listener.onLoadProgress = function(targetMC:MovieClip, lBytes, tBytes)
    {
       
        targetMC._parent.mc_photoPreloader._width = (lBytes/tBytes)*100;
       
    };
    listener.onLoadComplete = function(targetMC:MovieClip)
    {
       
        border._visible                             = false;
        targetMC._parent.mc_photoPreloader._visible = false;
       
    };
   
    // Do it, load the bitmap now   
    var loader:MovieClipLoader = new MovieClipLoader();   
    loader.addListener(listener);   
    loader.loadClip(url, bmc);
 
}
 
function parseMe(success:Boolean):Void
{
    trace("XML Loaded");
    if(success)
    {
   
        thisChild            = this.firstChild.firstChild.childNodes;
        numItems                = thisChild.length;
        //trace(thisChild);
       
        //trace("Loading " + numItems + " XML entries...");
        for(i=0; i<numItems; i++)
        {
       
            //trace(thisChild[i].childNodes[1].firstChild.nodeValue + "
");
            randMax    = 5;
            var rotRand:Number  = random(randMax);
            var rotRand2:Number = random(randMax);
            if(rotRand > (rotRand/2))
            {
           
                rotRand2 = -(rotRand2);
           
            }
           
            mc_photoholder.attachMovie("mc_photoLoader", "mc_photoLoader" + i, mc_photoholder.getNextHighestDepth());      
            mc_photoholder["mc_photoLoader" + i].mc_photoPreloader._visible = false;
            mc_photoholder["mc_photoLoader" + i]._y                         = (tSpacer * i) - 5;
            mc_photoholder["mc_photoLoader" + i]._x       = rotRand2;
            mc_photoholder["mc_photoLoader" + i]._rotation      = rotRand2;
            //trace("Loading clip " + thisChild[i].childNodes + " into " + mc_photoholder["mc_photoLoader" + i].mc_photohere);
            imagesT.push(thisChild[i].childNodes[0].firstChild.nodeValue);
            imagesM.push(thisChild[i].childNodes[1].firstChild.nodeValue);
            thisWid.push(thisChild[i].childNodes[2].firstChild.nodeValue);
            thisHgt.push(thisChild[i].childNodes[3].firstChild.nodeValue);
            //var thisWid:Array   = [];
            //var thisHgt:Array   = [];
       
        }
        loadImages();
   
    }
 
}
 
function loadImages():Void
{
   
    var imgTotal:Number = imagesT.length;
    //trace("imgTotal = " + imgTotal);
    loadImg     = imagesT;
    loadBigImg  = imagesM;
    widths    = thisWid;
    heights  = thisHgt;
    for(j = 0; j < imgTotal; j++)
    {
       
        thisMc     = _root.mc_photobarleft.mc_photoholder["mc_photoLoader" + j];
        thisMc._highquality = 2;// = true;
        thisMc.which       = loadBigImg[j];
        //trace("W = " + widths[j] + " and H = " + heights[j]);
        thisMc.thisWid   = widths[j];
        thisMc.thisHgt    = heights[j];
        //trace("Which = " + thisMc.which);
        loadBitmapSmoothed(loadImg[j],thisMc.mc_photohere);
        thisMc.onRelease = function()
        {
           
            //trace("MC was clicked.");
            var bigPicHolderMC:MovieClip    = _root.mc_photoBigAnim.mc_bigPhotoHolder.mc_photoBigLoader;
            var bigPicMC:MovieClip      = bigPicHolderMC._parent._parent;
            var bigPicFrameNo:Number       = bigPicMC._currentframe;
            //trace("Current Frame = " + bigPicFrameNo);
            if(bigPicFrameNo == 1)
            {
               
                bigPicMC.play();
           
            }
            bigPicMC.which   = this.which;
            bigPicMC.thisWid    = this.thisWid;
            bigPicMC.thisHgt    = this.thisHgt;
            //trace("Which = " + this.which);
            bigPicMC.unloadPhoto();
            bigPicMC.loadBigPic();
           
        }
   
    }
   
}
 
mc_photodragger.onPress = function()
{
   
    this.startDrag(false,108,0,108,250);
   
}
 
mc_photodragger.onRelease = function()
{
   
    this.stopDrag();
   
}
 
mc_photodragger.onReleaseOutside = function()
{
   
    this.stopDrag();
   
}
 
mc_photodragger.onEnterFrame = function()
{
   
    //trace(this._y);
   
}
 
mc_photoholder.onEnterFrame = function()
{
   
    //0 - 250
    var maxDrag:Number  = 250;
    var curDrag:Number  = mc_photodragger._y;
    var perc:Number  = Math.round(((curDrag/maxDrag)) * (this._height - maxDrag - tSpacer));
    //trace("Perc = " + perc)
    this._y = -(perc);
   
}
trace("Loading XML");
myXML.load(loadthis);


[Main Image Loader]

ActionScript Code:
var which:String;
var thisWid:Number;
var thisHgt:Number;
var maxRight:Number = 500;
var keepmoving:Number;
var playStatus:String;
mc_bigPhotoHolder.mc_photoPreloader._visible = false;
mc        = new MovieClipLoader();
preload                 = new Object();
mc.addListener(preload);
 
function loadBigPic()
{
 
    var thisTarget:MovieClip = this.mc_bigPhotoHolder;
    //trace("W = " + this.thisWid + " and H = " + this.thisHgt);
    mc.loadClip(this.which, thisTarget.mc_photoBigLoader);
    //trace("New num = " + (Number(this.thisWid) + 20));
    var bgWid:Number                    = Number(this.thisWid) + 20;
    var bgHgt:Number                    = Number(this.thisHgt) + 50;
    var thisY:Number                    = Math.round((maxRight - (bgWid - 20))/2);
    trace("Moving photo to " + thisY);
    thisTarget.mc_photoBigBg._width     = bgWid;
    thisTarget.mc_photoBigBg._height    = bgHgt;
    thisTarget._x                  = thisY;
    thisTarget.mc_photoPreloader._y  = bgHgt - 20;
   
}
 
preload.onLoadStart = function(targetMC)
{
   
    //trace("started loading "+targetMC);
    targetMC._parent.mc_photoPreloader._visible = true;
    targetMC._parent.mc_photoPreloader._width   = 0;
   
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes)
{
   
    targetMC._parent.mc_photoPreloader._width = (lBytes/tBytes) * thisWid;
    trace("thisWid = " + thisWid);
   
};
preload.onLoadComplete = function(targetMC)
{
   
    border._visible                             = false;
    targetMC._parent.mc_photoPreloader._visible = false;
   
};


Please let me know if it can be done.

Thanks!

Help With Variables Passed From URL
I am opening my flash movie and attempting to send variables into it by calling the following from my HTML:

moviename.swf?var1=1&var2=1

2 potentially stupid questions:

1. Does this work?
2. Once the variables are loaded, do they stay in the movie when you switch scenes.

Thanks for any help.
Greta

Getting Vars Passed Through Url
Hi every one.
I need to get my flash movie to recieve vars from the url that calls it. so I hava a master movie which calls a load movie which loads a movie called surf so what I want is this:

loadMovie(/surf.swf?size=6&length=17&tide=high);

so the movie clip surf when loaded already has the variables past to it.

is this even possible

hope this makes sense

dave

How To Use Variables Passed From PHP
Hi I use the following to get variables from a php script which generates something like this

&load1=http://www.domain.com/images/image1.jpg
&load2=http://www.domain.com/images/image2.jpg
&load3=http://www.domain.com/images/image3.jpg
&load4=http://www.domain.com/images/image4.jpg

I can display these variables in a textbox by setting the var=load1 and so forth. But if I want to use the variable load1 inside a

loadMovie(load1);
this has been simplified! I have tried to type in the exact URL to the image which then shows the image in my FLASH movie. But when I enter my variable i.e. load1, it doesnt sho the image???

Pls Help,

Thanks, Mads Andersen

Time Passed Since?
Hi,

I'm wanting to make a timer that counts up the Years, months, days, hours, minutes and seconds since a certain date.

I've been reading up on the UTC date function. Is this my best course of action and if so, can somebody point me in the right direction of code that will calculate the number of seconds, minutes, etc since a certain date?

Thanks

Neily

XML Variable Not Being Passed
I'm currently working with a XML menu structure, and something really strange is happening. I have a textfield representing a value from a certain node, and I want to navigate through this using buttons.

When I use this code:


Code:
var selectednode = 0;

switchnode = function(upordown, side){
sn_childPointer = menu_xml.firstChild;

if (upordown == "up" && side == "leftmenu") {
selectednode++;
message_txt = sn_childPointer.childNodes[selectednode].attributes.name;
}
}
Everything works fine, it returns the needed values. But when I try to use an external 'childPointer' it doesn't work anymore:


Code:
childPointer = menu_xml.firstChild;
var selectednode = 0;

switchnode = function(upordown, side){
sn_childPointer = childPointer;

if (upordown == "up" && side == "leftmenu") {
selectednode++;
message_txt = sn_childPointer.childNodes[selectednode].attributes.name;
}
}
it only returns: 'undefined' !

Does anybody know what I am doing wrong?

Variables Not Being Passed
I am trying to use the tutorial on this site to create a simple form submission to my database via ASP. I couldn't open the sample - I am on MX. But I followed the steps on the webpage.

My variables are not being passed. All of the Response.Write statements in my ASP page are coming up blank.

So I have the 3 input text fields. I specified each with the same variable name as used in the tutorial (fname, lname, email, message). I also used those same names as the instance names but that didn't help so I've deleted it. So currently there are no instance names, just variable names.

And then there is a submit button with the code from the tutorial:

on(press){
getURL("http://mysite.com/processForm.asp",0,"post");
}

Thats all that is in the movie.

The ASP page comes up, and the database submission completes, but all the variables and database fields are blank.

Variables Not Being Passed
I am trying to use the tutorial on this site to create a simple form submission to my database via ASP. I couldn't open the sample - I am on MX. But I followed the steps on the webpage.

My variables are not being passed. All of the Response.Write statements in my ASP page are coming up blank.

So I have the 3 input text fields. I specified each with the same variable name as used in the tutorial (fname, lname, email, message). I also used those same names as the instance names but that didn't help so I've deleted it. So currently there are no instance names, just variable names.

And then there is a submit button with the code from the tutorial:

on(press){
getURL("http://mysite.com/processForm.asp",0,"post");
}

Thats all that is in the movie.

The ASP page comes up, and the database submission completes, but all the variables and database fields are blank.

Typeof Variable Passed From Txt...
hi,

I pass the vars from txt to swf. (loadVariables).
Flash doesn't recognize the type of it (debugger: undefined). I need the number type, not a string nor undefined...

thanx

HELP How Come MACS Cant Get Passed My Loader?
Hi there,

I need a little help.
I designed a flash site and Macs cannot get passed the intro. Any ideas? The entire site is a series of flash movies loading into one another.

Here is the code for the loader.

if (Number(_framesloaded)<Number(_totalframes)) {
gotoAndPlay (1);
}


any ideas?????

thanks alot!

Textfield Value Passed To A Variable?
Is it possible to assign a variable the value of a textfield? If so, how can you do it?

Vars Passed To Methods?
FlashMX: I know for sure that i have my var Type1 because my "alert" text displays Type1:blah so, naturally, i try to pass that to setTextFormat() and it doesn't work. no format is set. can it be done in actionscript, eval? anything?


Code:
blah = new TextFormat(); blah.color=0xD659FF; blah.size=14;

alert.text="Type1:" + Type1;

_root.shoutMess.text= "";

_root.createEmptyMovieClip("mc5", 5);
_root.mc5.createTextField("t5", 0, 5, 1, 700, 20);
_root.mc5.t5.text = Message5;
_root.mc5.t5.setTextFormat(Type1);



thanks!

Receiving Vars Passed In A URL?
I'm sure this is simple, but I can't find how it's done in the Flash help manual.

How do I receive and use variables passed in a URL (i.e. GET)? So if I passed www.somesite.com/flashpage.php?var=hello , how would I get a dynamic text box to display 'hello'?

Cheers all.

Netscape And Passed Variables
I am passing variables from the object tag of my movie.
param name=FlashVars value=address=value1&secure=value2

These variables are passed fine in IE but not in Netscape. Has anyone had this problem and if so do you have a solution?

Thanks!!

Shortening A Passed Variable.
ok. I have the enviable task of working on this years election for a newspaper. yay.

here is the problem. I have xml info coming in and a variable from the xml is set as PollClosingTime="Tuesday, November 02, 2004 08:00:00 PM".

I only want to show the time (8:00 PM) but I cannot change the xml.

How do I subtract out the first part?

Thanks in advance

Daveoflav

Javascript Xml Passed To Flash
Hi
I have flash application which must be started by IE from local disk.
I have to load xml from url. Flash dosn't allow me to load external url so I need some workaround. I am thinking about load XML by javascript and then passing it to flash movie.
I've tried
var jsxml = "<a>ddadasd</a><d>daadas</d>"
document.write( " <param name="movie" value="demolution.swf?jsxml="+ jsxml +"">
" );
and in flash
_root.xmlFile.load(_root.jsxml);
but it doens't work, _root.xmlFile is empty
How can I accomplish that?

Variables Not Being Passed To Function
I have a function with a while loop that uses the i and j to peace together a path and then calls a loadvar() to check if the path exists. The Loadvars() however is not picking up the i and j at all which is starange because it picks up the array "leftpics" which is right above the two.
I know this because in the output window it will trace the correct path to the thumb but mess up because it says j is == to 0. The while loop will trace the correct numbers but the loadVars never Changes, and it never trys to load the original value of j.



Code:
/// set up ghey variables
leftPics = [_root.leftMenu.leftBtn1.leftPic, _root.leftMenu.leftBtn2.leftPic, _root.leftMenu.leftBtn3.leftPic, _root.leftMenu.leftBtn4.leftPic];
i = 3;
j = i + 1;

//// check the thumbs
var fileExists:LoadVars = new LoadVars();
fileExists._parent=this;
fileExists.onLoad = function(success){
//success is true if the file exists, false if it doesnt
if(success)
{
trace("pics/"+_root.theTxt[_root.moveNumber]+j+".jpg");
}else{
_root.leftPics[i]._alpha = 0;
}
}



//// load thumbs in to the buttons on the left \\
_global.loadThePics = function(){
trace("loading the pics");
//_root.leftMenu.leftBtn1.leftPic.loadMovie("pics/Web Design1.jpg");
while(i > -1){
fileExists.load("pics/"+_root.theTxt[_root.moveNumber]+j+".jpg")
trace(i);
trace(j);//initiate the test
j--;
i--;
}

}

Variables Not Being Passed In FireFox?
Hello guys and gals,

I've got a rather odd problem here.

I'm writing a banner ad script, which uses ASP to pull out various variables from a database, and write them to the HTML parameters which call in a container Flash movie.

The Flash movie then loads in the 'bannerRef' swf, and assigns itself the urlString value so that when it's clicked, it goes to the site contained in the database.

Not the best explanation, I know, but I'll try and break it down a bit more:

1) The ASP pulls in 3 arguements - the filename of the banner that the container clip must load; the destination URL of the banner ad; the current page that the user's viewing to add to our stats counter page - and writes them into the HTML of the page.
2) The 'container' movie clip has two mcs inside - one's a blank placeholder which loads in the banner specified in the query string, the other's a button which sits on top of this banner and gets assigned the destination url that's passed over in the querystring.
3) When displaying correctly, all the user sees is the banner that is contained in the database record - the container clip is to all intents and purposes invisible.

The reason I did it this way was because I was fed up of making Flash banners and having to remember to put in the full URL query strings in the Actionscript every time. This way, I figured, I could make just the container and when a banner's needed I can just work on the animation and not worry too much about scripting.

The problem is this: it works fine in Opera and IE, but only the container movie's loaded in FF. The button is there - you get a hand cursor when you mouseover the empty container, and the correct url is passed over - but no external banner gets loaded.

Here's the code that the script outputs:

[HTML]<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="468" height="60" id="bannerAd" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="../pix/banners/banners/bannerAd.swf?bannerRef=test.swf&linkRef=http%3A%2F %2Fwww%2Ediecast%2Dcollector%2Ecom&flashRef=http://wgp.outandaboutlive.co.uk/main/default.asp%3F">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="wmode" value="transparent">

<embed src="../pix/banners/banners/bannerAd.swf?bannerRef=test.swf&linkRef=http%3A%2F %2Fwww%2Ediecast%2Dcollector%2Ecom&flashRef=http://wgp.outandaboutlive.co.uk/main/default.asp%3F" quality="high" bgcolor="#ffffff" width="468" height="60" name="bannerAd" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>
</object>[/HTML]

I know it's probably something in the 'param' text, as normally when FF refuses to load a movie it's a problem with that, but I'm buggered if I can see it.

Any ideas?

Cheers,

-Mike

LoadMovieNum And Variables Passed From Php
k I'm working on a new site which is a confusing mixture of mysql, php, and flash.

This is basically a simplified example of my problem:

"flash1.swf" is the root flash file
"flash2.swf" is the file being loaded into "flash1.swf"
"variable1" is the name of the variable

Basically when I visit a page, I send "variable1" into "flash1.swf" using FlashVars. This assigns "variable1" to the root of "flash1.swf". Now if I load "flash2.swf" into any level of "flash1.swf" I am unable to access "variable1" from "flash2.swf" but I'm not sure why. I've tried loading "flash2.swf" into level0 and level1, no difference and I've tried using _root.variable1, _level0.variable1

Any ideas?

Calling Passed Parameters?
If I define a parameter in my object inbed tag (in this case a dynamically produced URL), what do I need to do to then call that parameter from within the .swf so that I can then use that value within a function?

Code:
<object classid="clsid:d27cdb6e...//
<param name="movie" value="player.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffff66" />
<param name="URL" value="someURLDynamicallyProduced" />
...//
</object>
Thanks much!

[F8] Getting URL Via Variable Passed Into Movie
Hello,

I have what's hopefully a simple thing that I'm not sure how to do...

I've got a small movie/animation that is basically runs for a 10 seconds or so, then reaches a STOP frame, where I have this:

getURL("http"//www.websitehere.com");

That works fine and all. BUT, what I NEED it to do, is have the website be pulled in via a variable instead of just hard coded...and that way, this file can be resused in different scenarios/sites without having to keep updating the source fla file...

I'm not sure how to do this, and would greatly appreciate an example/tutorial/advice/etc.

Thanks! seanpc

What Do You Mean X Is A String? I Passed A Number
Hello,

I've recently encountered something very strange in my actionscripting. Here's the situation:

An instance of Class A creates an instance of Class B and calls Class B's init() function and passes several variables that have been strictly typed as Numbers. Indeed, Class B's init function *expects* to be passed Numbers. Why then, when I have passed these numbers from Class A into Class B does Class B think that these numbers are in actuality Strings, and treat them as such? What is even more bizarre is that even though Class B is convinced that these numbers are strings, it will still allow me to assign what it thinks are string values to strictly typed Number variables that are private within Class B! Thus, when I try to add this string that should be a number to a variable that contains the value of what in fact is number, it just concatinates the two as though I were asking it to concatinate two strings.

Why in the world would this happen?

Function Passed As Argument
I am currently learning ActionScript 2.0 using Flash Professional 8, however, I keep getting an 'Output' error about line 7 in my code which says
The class or interface 'SimpleButton' could not be loaded.
createClassObject(mx.controls.Button, "button"+currentDepth, currentDepth);

I will post the whole code (31 lines including space and comments) if required, but hopefully it is just an obvious syntax error that I cannot spot.

Please help.

Anomalies In Passed Variables
Hey everybody,
So, yet again, I'm knee deep in an xml based project, and am noticing some interesting weirdness going on when I pass variables between functions.
Basically, I have an XML object which is pulling layout variables, and then those variables are being passed to another XML object which is sourcing some video thumbnails.
And its actually working fine, but only after some tinkering. It seems that the passed variables have to be redifined in some fashion within the scope of the new function.
It might be easier to explain with the code:
function makeGrid(backwidth, thumbHolderX, thumbHolderY, numCols, tSpacing) {
trace(backwidth);
trace(tSpacing);both trace just fine but (See spacing variable below)
var z = 0;
var a = 0;
var thumbwidth = backwidth/numCols;
var thumbheight = 60;
var thumbsPerRow = numCols;
var spacing = tSpacing/1; //unless I do this, the XML object won't recognize the variable (i.e., it won't just take tSpacing as the variable)
trace(thumbsPerRow);
var numthumbs = 6;

_root.createEmptyMovieClip("thumbholder", 7000000);
_root.thumbholder._x = thumbHolderX;
_root.thumbholder._y = thumbHolderY;
var vidXml:XML = new XML();
vidXml.ignoreWhite = true;
vidXml.load("videos.xml");
vidXml.onLoad = function(success) {
var numThumbs = this.firstChild.childNodes.length;

for (i = 0; i<numthumbs; i++) {
var thumb = this.firstChild.childNodes[i].attributes.thumb;
if (z==thumbsPerRow) {
a++;
z = 0;
}
_root.thumbholder.createEmptyMovieClip("thumb"+i, i);
_root.thumbholder["thumb"+i]._x = z* (thumbwidth+spacing);
_root.thumbholder["thumb"+i]._y = a* (thumbheight+spacing);
_root.thumbholder["thumb"+i].loadMovie(thumb);
z++;
trace(a);
_root.thumbholder["thumb"+i].onRelease = function() {
trace("caption"+i);


}
}


}
}//end thumbnails


anyone care to take a crack at explaining this?

Using Passed Parameter Fails
Hi, I'm quite new to ActionScript and have a fairly simple task to parse an xml file and dynamically create some read-only text fields.

I have a function call that I pass the name to be used for the field and then call createTextField with that name. I then use 'with' to initialize the field's properties. When I run the Actionscript there are no errors generated but I also see no text field.

I do the same createTextField, within the function call, without the passed variable, and it works (displays) fine.

I suspect that I'm doing something wrong with using the passed variable. I've scoured (kind of) the sites that seem to focus on Flash, like this one, and nothing.

Here is a snippet of the script:


Quote:




//---------------------------------
// Create Fields
//
function createField(fName, fNum, fText) {
createTextField(fName, 20, 50, 80, 100, 20);
with (fName) {autoSize = true;
background = true;
html = true;
multiline = true;
selectable = true;
text = "0";
type = "dynamic";
wordWrap = false;
htmlText = fText;
}

trace("CreateField: name="+fName+" num="+fNum+" txt="+fText+" lNum="+_labelFieldNum);

trace("----------------------------------");
}

//---------------------------------
// XML Data stub
//
function sendItOut() {
prime = new XML();
prime = this.firstChild;

for (x=0; x<prime.childNodes.length; x++) {
var header = prime.childNodes[x].nodeName.toString();
trace(x+" header: "+header+newline);

for (z=0; z < prime.childNodes[x].childNodes.length; z++) {
var fText:String = prime.childNodes[x].childNodes[z].childNodes[0].nodeValue;
var fTag:String = prime.childNodes[x].childNodes[z].nodeName;

trace("nodeValue: "+fTag+"-"+fText+newline);
trace(x+":"+z+" data: "+prime.childNodes[x].childNodes[z].toString()+newline);

createField(fTag, fNum, fText);
}
}
}

//----------------------------------------------------- fall-through main thread
//
var Odata:XML = new XML();
Odata.ignoreWhite = true;
Odata.onLoad = sendItOut;
Odata.load("c:\eBall.xml");




I've stripped much of the unnecessary portions of the script and included just the pertinent code. The parsing is working fine and it's only the createTextField that doesn't work. In the static version, which works, the field name is passed as a string literal "string" and the 'with' property keyword does not include the parens. I'm not sure how to do this with the passed argument and this may be the issue. If you need more info please let me know.

Thanks for any help with this problem.

JM

Same Value Being Passed To Load XML Data
Hi!

Trying to figure out why my onRelease is sending the same value to load my pictures from a xml file.

This is the code, it's sCase i want to send the value that belongs to that node.


Code:
//PHOTOGALLERY
yValue=185;
for(i=0;i<meny_showcase2.length;i++) {
aShowcase2.push(meny_showcase2[i]);
yValue += 17;
_root.attachMovie("News","mcNews3"+i,getNextHighestDepth(),{_x:547,_y:yValue});
_root["mcNews3"+i].createTextField("xmlShowcase2"+i, getNextHighestDepth(), 0, 0, 150, 16);
_root["mcNews3"+i]["xmlShowcase2"+i].text = aShowcase2[i];
_root["mcNews3"+i]["xmlShowcase2"+i].type = "dynamic";
_root["mcNews3"+i]["xmlShowcase2"+i].embedFonts = true;

myFormat = new TextFormat();
myFormat.size = 8;
myFormat.font = "Font 1";
myFormat.border = false;
myFormat.selectable = false;
myFormat.textColor = "0x000000";
_root["mcNews3"+i]["xmlShowcase2"+i].setTextFormat(myFormat);



//_root["mcNews2"+i].mcNewsDrag = _root["mcNewsDrag2"+i];
this.mcNewsDrag = _root["mcNewsDrag3"+i];
var bilden2 = aShowcase2[i];
trace (bilden2);
this.mcNewsDrag._alpha = 0;
_root["mcNews3"+i].onRollOver = function() {
this.mcNewsDrag._alpha = 100;
this.mcNewsDrag.tween(["_xscale","_yscale"],[125,100],0.5,"easeOutBounce");
soundBlip.start();
}
_root["mcNews3"+i].onRelease = function(sCase) {
_root["mcNews3"+i]._alpha = 0;
sCase = bilden2;
//trace (sCase);
laddaXML(sCase);
}
_root["mcNews3"+i].onRollOut = function() {
this.mcNewsDrag.tween(["_xscale","_yscale"],[0,100],3,"easeOut");
}
//#################
}

URL Parameters Aren't Passed
I am trying to pass a simple URL parameter (?c=home) to my flash movie. However, when I use the <object> tag work around that Dreamweaver provides, so that the movie is active in the new versions of IE, the variable is no longer passed to the movie. I'm sure others have had this problem but I can't find a solution.

Accessing Parameters Passed To An Swf
When parameters are passed to an swf via the html link (e.g., <param name="movie" value="flvPlayer.swf?param1"), how does one reference them from actionscript? Whwe do they live in the object model?

How To Access Parameters Passed Into A Swf
How can I get access to the parameters that are passed into the swf, such as My.swf?xyz=123 ? How can I get the value of xyz?

Variables Passed Thru HTML
ok, here's another mind-boggler.

I have an HTML page that passes a variable, the easy way.
This is the HTML generated by Flash, to which I've added the part in bold (that is, P1=BARTHEZ, thus passing the variable P1 to flash, whose value is BARTHEZ
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>FOOTBALL TEAM SELECTION</title>
</head>
<body bgcolor="#ffffff">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="960" height="570" id="football_13" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="football_13.swf?P1=BARTHEZ" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="football_13.swf?P1=BARTHEZ" quality="high" bgcolor="#ffffff" width="960" height="570" name="football_13" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
In my flash movie, I have a text field named "player".
In my code, I have


Code:
_root.player.text = P1
When I launch the HTML page, the field is correctly filled with "BARTHEZ" in my flash movie.
Now...

if I code


Code:
_root.player.text = P1
if (P1 == undefined){
_root.gotoAndStop(3)
}
else _root.gotoAndStop(4)
it should work just fine, but I always get to frame 3, even when the player.text displays "BARTHEZ"

Any help or hint would be greatly appreciated...

Should Be In This Thread (if There Are No Params Passed)
I put a stop(); on frame 1 before all takes place then I try to load if not

Code:
} else { gotoAndStop(2);
And then I have a stop(); on frame 2 with some text that says "not uploaded any files"

However it still is trying to read in something cause it stops on frame 1 trys to load but doesnt ever kick user to frame 2. Any ideas? It still shows undefineds and the image gallery when I want it to jump to frame 2 and show error text or simply set everything to false.

Here is full code.
Code:

Code:
stop();
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
title = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
title[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
} else {
gotoAndStop(2);
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("/f&f/galleryimage.xml.aspx?pid=" + pid);
Thanks. MT

Method From Passed Variable?
Hi all,

Having a little bother trying to call a method as defined elsewhere. I have a class Reactor that has public methods A and B and I want an intermediary call (Remoting) to turn the string of the method into well.. actually calling it.

I have tried


Code:
React.strMethod(var1)
and

Code:
["React."+strMethod+"(var1)"]
and

Code:
React.[strMethod](var1)
and some other variations on the square brackets, they do nothing mostly, a few variations throw errors.

I then moved to trying getDefinitionByName()

Code:
var oRef = getDefinitionByName(strMethod)
React.oRef(var1)
But these give "Variable TargetMethod not declared" etc.

So I also tried


Code:
var oRef:Function = getDefinitionByName(strMethod) as Function
React.oRef(var1)
and also with 'Class' instead of Function.

Nothing seems to work

To clarify, the call works if i just have it statically written, just not dynamically passed. Could anyone shine a ray of light onto this for me please? Eval seems so simple!

HTML Is Being Passed With LoadVariables()
HI guys, i'm trying to send out some input form variables top a php script via loadVariables() ... and it's working, but the only problem is that flash also sends out all the html font information along with the form data. so instead of getting something like "Name: Phil" the php script gets:


Code:
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Hypatia Sans Pro Semibold" SIZE="11" COLOR="#333333" LETTERSPACING="0" KERNING="0">Name: Phil</FONT></P></TEXTFORMAT>
<p align="left"></p>
is there a way to keep this from happening in flash or do i need to start getting fancy with the php?

Thanks!

XML Passed As A Class Parameter
Hi!

Trying to pass an XML object into a new instance of a class. Is this possible?

Looping through XML Nodes:


Code:
var speaker_list:XMLList = xml_data.speaker;
for (var i:int = 0; i < speaker_list.length(); i++){

var rows:int = 3;
var speaker_clip:XML = speaker_list[i];
var new_speaker:speaker = new speaker(speaker_clip);
}
Speaker class:

Code:
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.utils.*;

public class speaker extends MovieClip {

private var xml_data:XML
private var image_loader:Loader;
private var clip_name:String;

public function speaker(xml_node:XML) {
this.xml_data = xml_node;
addEventListener(Event.ADDED_TO_STAGE, stage_presence);
}

private function stage_presence(e:Event):void{

trace("speaker loaded");
}
}
}
The idea is to then populate the new instance with the data from the passed node.
Thanks in advance!

MX2004 AS[1] Passed Value Will Not Execute
Big help[ needed!
Having a big problem getting a vaiable to execute once passed the the main timeline.
I hope there is a simplke oversite on my part.
I'm passing variable from a code clip to the main time line of th root movie.


1-
//codeclip
onClipEvent(load){
loadVariables("extfile.txt", page);
}

onClipEvent(data){

_level0.page = page;//passed but not acted on in ml
//_level0.page = 40;// IF HARD CODED it passed and fnction executes ok
}



2-
//A button calls fbkmktest() function below



3-
//function located on main timeline
function fbkmktest(){
step =page; //assigns value passed from codeclip from --THIs WORKS IF HARD CODED at code clip
trace("page at fbkmktest======="+page); // Checks out OK values is passed fro mcode clip external text file.

//the rest of the code simply loads a external swf file // THis has been tested and works
vtofile = "contents/screen";
ext = ".swf";
for(i=0; i<=varray.length; i++){
if(step ==varray[i]){
vpath = (vtofile+step+ext);//concat
loadMovie(vpath, "_level101");//higher level needed on get function
}
}
}


Problem - Question - Goal
The perplexity occurs in item 1-
if _level0.page is hard coded i.e if i enter a 12, the function executes???!
However if using a variable from loadVariable etc, even though loaded value is being successfully(tested using trace-it's value does appear in the function)... now the function will not execute?

Again, if hard coded then passed from codeclip function bkmktest() execution occurs
If passed form using variable only function execution will not occur?

My goal here is to execute the function(as usual) based on a value it recieves.


Any help greatly appreciated.

iaustin

Get Variables Passed In From Swfobject?
hello

i am passing a variable into my flash movie using swfobject. how do i access the variables once i pass them in?

Code:

<script type="text/javascript">
var so = new SWFObject("movie.swf", "movie", "480", "500", "8", "#FFFFFF");
so.addParam("title", "This is the test title");
so.write("flashcontent");
</script>


i thought in my movie, i could just do
var t:String = title;
but i am getting undefined

thanks for any help!

Variables Not Being Passed From Form...
Hello,

There is a contact form which when submitted is not sending the user input.

Here is the url using the $_GET method (notice there is no value for your_name, your_email and message):


Code:

http://www.camelotandalusians.com/tim/contact.php?server_option=php&recipient=mousel@defend.net&your_name=&your_email=&message=&url%5Fvar=server%5Foption%3Dphp%26recipient%3Dmousel%40defend%2Enet%26your%5Fname%3D%26your%5Femail% 3D%26message%3D



Here is the actionscript that appears to be responsible:


PHP Code:





 on(release) {
    url_var = "server_option="+_root.server_option+"&recipient="+_root.recipient+"&your_name="+_parent.your_name+"&your_email="+_parent.your_email+"&message="+_parent.message;
    getURL("contact."+_root.server_option+"?"+url_var, "_blank", "GET");
    _parent.your_name = "";
    _parent.your_email = "";
    _parent.message = "";    








I'm helping a friend to get this working yet I know virtually nothing about flash. Could someone give me some advise? Or, if someone could fix this I'm sure she'd be willing to pay for some help.

Thanks,

Tim

Using PHP Variables Passed By URL Into Flash
I have a problem with getting my php variables from the page to the swf movie.

I have a phone number which I want to get into the flash and can't hardcode because it varies but I keep getting "undefined". In HTML I have:

Code:


<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="(URL address blocked: See forum rules)=9,0,0,0" name="needle" width="960" height="195" align="middle" id="needle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="needle.swf<?php echo "?phone=$phone"; ?>" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#121536" /><embed src="needle.swf<?php echo "?phone=$phone"; ?>" menu="false" quality="high" bgcolor="#121536" width="960" height="195" name="needle" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="(URL address blocked: See forum rules)" />
</object>


In flash I have a dynamic text box: Instance name: "display_box", Var: "display_phone"

First frame of timeline, though I also tried it a few frames later, I have: display_phone = phone;

If I set the variable in flash directly it works fine:
var phone = "123-456-7890";
If I pass the variables directly in the browser it works fine: www. domain .com/needle.swf?phone=123-456-7890

Anyone see where I'm going wrong?

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