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




Path Trouble In Loaded Variables



Im trying to load variables into a mc in a movie, but i cant get them connected. Anyone got any ideas ?

Im loading the variables into level 0, trying to loadMovie them using loadMovie(variablename, "target") in the mc. This does not work.

Also, i want to chech if one specific value of a variable (fps) in level 0 is the value i want it to be. An if statement of a button going:

if (fps == 5) {
_root.framecount.GoToandPlay(20);
}
if (fps == 8) {
_root.framecount.GoToandPlay(25);
}

does not work.

PLZ help, and thanx again.



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-26-2004, 04:48 PM


View Complete Forum Thread with Replies

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

What Path To Use For Variables When The .swf Will Be Loaded Into Another Movieclip?
Basically exactly what the title says. In a .swf, I create movie clip objects in a for loop like so:


Code:

_root.createEmptyMovieClip("box"+i,i);
var newMC = eval("box"+i);



I know, _root is bad because now when I have a movieclip in another file that loads this .swf, it doesn't draw the objects (I use newMC to draw the objects dynamically). I'm assuming this is because I've created the movieclip in _root, and it's trying to display within a movieclip, thus the info is inaccessible?

But how should I create the empty movie clip? I tried _level0 and that didn't work either.

What Path To Use For Variables When The .swf Will Be Loaded Into Another Movieclip?
Basically exactly what the title says. In a .swf, I create movie clip objects in a for loop like so:


Code:


_root.createEmptyMovieClip("box"+i,i);
var newMC = eval("box"+i);




I know, _root is bad because now when I have a movieclip in another file that loads this .swf, it doesn't draw the objects (I use newMC to draw the objects dynamically). I'm assuming this is because I've created the movieclip in _root, and it's trying to display within a movieclip, thus the info is inaccessible?

But how should I create the empty movie clip? I tried _level0 and that didn't work either.

Path Depth And Variables Between Loaded .swfs
Hi,

I've been stumped for way too long so I'm hoping someone here knows what the problem might be with this file...

To understand the problem, you have to know the structure:
_level0 is a movie that holds all of the navigation.
_level0._root.object is an MC that holds all loaded .swfs (the guts, the content)

I have a button in _level0 with a text field that changes depending on the content that is loaded into _level0._root.object. This text field MUST be two levels deeper than root in order for it to be part of the interactivity within the navigation of _level0. (My draggable window panels, navigation palettes)

The text field changes when a button in _level0._root.object has been pressed. I do this by calling a function which sits in _level0 on the _root. The function is as follows (with 'blah' as placeholder for field variable name):

Code:
function fillField () {
_level0._root.nav.nav2.blah = "BLAHBLAH";
}
There's more to it but I removed the unimportant parts.

My problem is: The field will not fill if it is any deeper than _level0._root. So, the code above does nothing, even if the field is sitting in the nav2 mc. If the field were in the _root and I had this in my function:

Code:
function tempBack () {
_level0._root.blah = "BLAHBLAH";
}
...it works great. BUT I need the field to sit two levels deeper in order for it to drag with my windows and stuff.

Does anyone know why it won't work when I take it off of _root?? My field's variable name is even set to the path above (ideally _level0._root.nav.nav2.blah). Is it a limitation of flash or haha maybe it's me!! I owe you one if you can solve this.

Thanks,
Jessica

Trouble Accessing Variables From Root In Loaded Swf - AS3
I've searched the forums for days now and can't seem to figure this out. I'm building a flash site using AS3 that loads the individual pages into a single movie. The problem I'm having is I can't get the loaded swf to see variables that are set in the root movie.

For example... The site is for a construction company and I've created a dynamic image gallery. The gallery is divided into different catagories (embassies, churches, commercial, etc...) and the user chooses one of those catagories from the XML generated main menu located in the root movie. That loads the image gallery page into the root movie. The image gallery should then call a php page which returns the selected catagory from my database. I can't figure out how to get the gallery swf that was loaded into the root movie to know which catagory it should send to the php page.

I'm trying to set a variable when catagory is selected, "returncatagory.php?catagory=churches" for example, and have the image gallery use that for its URL request.

Any thoughts????

Path Trouble
hello, not sure if i can do this, right ill try my best to explain.

i have a main.swf and into this file i load navigation.swf and content.swf, now within content i have a mc named (contentwindow) which is dragable, and within the (contentwindow) mc i have another mc named (content).


now here's the part im stuck on, im tring to add a button to the navigation.swf that tells it to load another swf into contents.swf>contentswindow>content.


can this be done.

thanks in advance

Target Path Trouble
Hey people...
I was wondering if I could get an assist with this scroll problem I'm having.

I have a dynamic textfield called blog1
an up and a down button that is supposed to scroll the blog 1 textfield when they are rolled over. The buttons are contained in movie clips.

The blog1 textfield and the movie clips that contain my buttons are all in a movie clip called "chooseblog".

"Chooseblog" is in a movieclip called "blue_mc"

On an actions level in chooseblog I load the .txt file that populates blog1 with this command:

this.loadVariables("blog.txt") and I show the text using this command:

blog1 = blogtext.

The file is loading just fine into the textfield but the scroll isnt working.

In order to scroll I'm using:

on (rollOver) {
chooseblahg.blog1.scroll--;
}

and

on (rollOver) {
chooseblahg.blog1.scroll++;
}


I'm pretty sure I just have no idea what I'm doing with the target and reciver paths for this. Can someone please help?

Target Path Trouble
We have a project here where we need to get a movie to play a certain frame, and it's not happenning. Here's the deal: In the main timeline, lies a movie clip ("argue") that advances frame-by-frame as the user types, revealing new images every keystroke. On certain frames within that movie clip, we want a different movie clip ("boil_mc"), in the main timeline, to gotoAndPlay certain frame labels. We know that we need to use _root.boil_mc but we just can't get any script to actually make this happen. Totally frustrating. Any help here would be greatly appreciated. Thanks.

twiggarts

Trouble With Calling The Right Path
this is probably really simple but its been bothering me for a while now.

i try to make my code more generic. for example i want to create a function for a preloader which refers to different Movieclips at different times. thats what i am trying to do

//calll my function from somewhere
preload("mcNews.mcImg.mcPlaceholder");

//funciton is located somewhere else
function preload(vmc){
_root[vmc].getTotalBytes();
}

so i simply want to swap the 'vmc' according to the movieclip i need the preloader for. but it seems i can never have a path like "mcNews.mcImg.mcPlaceholder" for my vmc. it only works with something like "mcNews". how come? is there another solution to this

cheers
J

Trouble With Path To SetInterval
I have a setInterval running a pause function in a movie that is loaded into a blank MC using this code:

ActionScript Code:
//===============================
//PAUSE FUNCTION
//===============================
function pause(t, v)
{
        stall = setInterval(unPause, v, t);
        t.stop();
}

function unPause(t)
{
        trace("clear & play");
        clearInterval(stall);
        t.play();
}

//===============================
// INITIATE FUNCTION
//===============================
pause(this,3000);
And I'm trying to clear the "setInterval" from my main _root with a button with this code:

ActionScript Code:
_root.movieLoader.subMovieLoader.clearInterval(stall);
But, it's not working and I have no idea why. Does anyone have any recommendations? I've tried everything!! It's so simple... Why is it not working?

Thanks ahead of time!

SharedObject Path Trouble, Blah
Ok, I am using SharedObject's, which is VERY easy to use, and I've had no problems...

Until I try to give it a specific path other than a global "/"

For instance, this works fine:

Quote:




cookie = SharedObject.getLocal("doghouse");




And this works as well

Quote:




cookie = SharedObject.getLocal("doghouse","/");




But this does not work:

Quote:




cookie = SharedObject.getLocal("doghouse","/projectname");




So if I do not put in a path (the first option above), it puts it deep inside these subfolders depending on where the swf is on my computer.

If I use the universal "/", then it simply places it in a "localhost" folder.

Any ideas on why this isn't working when I specify a subfolder?
Oh, I did try a following "/" after the subfolder name, and it doesn't work as well. So basically, if I specify a subfolder, the .sol file isn't written whatsoever.

Thanks in advance for the help!

Paths - More Trouble On This Path Than Little Red Riding Hood
Hello there,

I am having a bit of trouble with a site I am making .
Here is what I've done.

a) I've constructed a main page where I have my header and buttons for navigation at the top. At the bottom I have a footer with some basic contact info.

b) In the middle I have various pages load. I have used the following code to load these movies.

//Projects Button - loads the Projects SWF file into the main time line.
function openProjects() {
_root.createEmptyMovieClip("siteContentPage_mc",_r oot.getNextHighestDepth());
_root.siteContentPage_mc.loadMovie("../projects/Projects.swf");
_root.siteContentPage_mc._y=68;
_root.siteContentPage_mc._x=0;
}


Now the problem I am having occurs after this page successfully loads a new set of buttons for a person to select to see various completed projects.

In this movie called Projects.swf, I want to create another empty movie clip, where another page can be displayed beneath the new set of buttons. I am having a tough time figuring out the path to get the movie to load correctly in my browser. I've tried many variations with the code, but it has not proven to be very successful. Here is what I've done:


_root.siteContentPage_mc.createEmptyMovieClip("Loa dedPortfolio_mc",_root.siteContentPage_mc.getNextH ighestDepth());
_root.siteContentPage_mc.LoadedPortfolio_mc.loadMo vie("instructions/Instructions.swf");
_root.siteContentPage_mc.LoadedPortfolio_mc._y=17;
_root.siteContentPage_mc.LoadedPortfolio_mc._x=135

I don't even know if this is on the right wavelength now. Can someone please edit my code, so that I can go to sleep . I posted this earlier, but had difficult understanding what it is that I need to do. If you wouldn't mind, I would also love to have someone explain what it is that they did to fix the code. I know that is asking a lot, but any help is greatly appreciated.

If you would like to see the site it is at www.modainteriordesign.ca

Thanks for your help,

Greg

Path In Loaded Swf
I've created a swf wich loads variables from a textfile. It works fine. The problems starts when I load this swf into another swf (which is located in another directory) - then the path of the textfile get all messed up. It seems that the loaded swf is now using the directory of the swf it's loaded into - and can't find the textfile.

Is there an easy solution for telling the loaded swf to use its own path/directory, or do I have to hardcode the new path (and not be able to test outside the main swf ( ?

Path In Loaded Swf
I've created a swf wich loads variables from a textfile. It works fine. The problems starts when I load this swf into another swf (which is located in another directory) - then the path of the textfile get all messed up. It seems that the loaded swf is now using the directory of the swf it's loaded into - and can't find the textfile.

Is there an easy solution for telling the loaded swf to use its own path/directory, or do I have to hardcode the new path (and not be able to test outside the main swf ( ?

Keep Path Of Loaded Swf
I have a main.swf, and iam loading a new swf called home.swf in level 0, so it substitutes the main swf, the new swf is inside a folder called "data"

ActionScript Code:
loadMovieNum("data/home.swf", 0);

now the problem is that the new swf doest work good, because it mantains the main path of the main.swf, i what it to have the home.swf path, i hope this is clear.

PHP Path To Loaded Swf, Any Help Please...
Last edited by crabbe : 2002-08-21 at 09:37.
























PHP path to swf loaded in moviei have a main swf and i load other swfs into it.
one of which calls to a php file which does not work when inside the main swf but does if you view it in a html file I think its something to do with paths but i can't get it!!!

Any help will be great, tried a few variations of _level2. in the php with no success.
the movie is loaded into level 2 of the main swf.
thanx in advance...


#PHP path and reference to flash txt box in swf...

print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";

do i need to edit the path above? Guestbook is the main txt box.
here is the AS in the flash movie...

NumLow = 0;
NumHigh = 10;
loadVariablesNum("GuestBook.php?NumLow="+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);
stop();
setProperty("", _quality, "low");


LINKS, this is how it should work but the path is a bit of a mystery.
http://www.dec0de.com/v2/diary/intro.swf or
http://www.dec0de.com/v2/diary/editintro.html
thanx.

Variables Path?
i'm trying to set the value of a variable that i'm loading, this is the AS i have attached to the button now.

on (release) {
_level2.targetx = 800;
loadMovieNum ("barspics.swf", 2);
}

it does nothing. i've tried several variations, still nothing. i'm trying to set teh variable from my home movie to level 2. I can't do it from within the movie clip because i already have it set for a different event.
thanks
e

Path With Variables In It...?
hi there...
im trying to target a variable using a dynamic path
this is my statement:

(which doesn't work)

_root[currentname]mainfolderlabel = _root[currentname];

currentname is a variable that changes in a loop.

How do i re-write this to work?

Cheers

Danny

Using Variables In Path
I would like to replace the paths in the following based upon variables:

switch (_global.ticksLeft) {
case 3 :
_root.MainScoreboard_mc.gl_11.gotoAndStop("On");
break;
case 2 :
_root.MainScoreboard_mc.gl_12.gotoAndStop("On");break;
case 1 :
_root.MainScoreboard_mc.gl_13.gotoAndStop("On")break;
}


Like this:

_global.goalLightPath = _root.MainScoreboard_mc.gl_12;

switch (_global.ticksLeft) {
case 3 :
_global.goalLightPath.gotoAndStop("On");
break;
case 2 :
_global.goalLightPath.gotoAndStop("On");
break;
case 1 :
_global.goalLightPath.gotoAndStop("On")
break;
}

Easy enough...but I'm having problems with the next step which is to replace the gl_11, gl_12 and gl_13 instances with a variable and combining the result to one path. There are 4 levels, 1 through 4 and each of these instances represent a light displaying what level you are on. I want to replace the first number in each instance as this represents the level.

i.e. - gl_11 becomes gl_x1, gl_12 becomes gl_x2 etc...

so if it is level one:

_global.levelNum = 1;
gl_11, gl_12, gl_13

if it is level 2 I would set the var:
_global.levelNum = 2;
gl_21, gl_22, gl_23

and so on...

I am unable to develop the correct code to do so - any help would be appreciated. I know I'm missing something

Basicly - I need this:

_global.goalLightPath = _root.MainScoreboard_mc.gl_x2;

where x can be dynamic based upon a previously set variable

Any and all help appreciated.

Variables In A Path
hi
How would I put a string variable in a path? I tried variable.property
but that doesn't work.
Cheers

Using Variables In A Path
hey i was just wondering how i use the variable say "pagevar" in a path like _root.content.(variable here).goToAndPlay(20);

Variables In Path
Can anyone tell me why if this works

this.select_info.textInfo.current_txt.text = this_lv.definition

why these don't work

scr_name = "select_info";


this.scr_name.textInfo.current_txt.text = this_lv.definition
this[scr_name].textInfo.current_txt.text = this_lv.definition

I'd appreciate some help here so that I can get into somemore trouble later.

Thanks in advance...

Using Variables In Path
Does actionscript not allow variables to be used in a path? Here is my problem:

clipName= _root.tileArray[row][column];

boardPieces.clipName.attachMovie(movieType, "clip2",boardPieces.clipName.getNextHighestDepth() , {_x: -36.6, _y: -11.2});

The problem is with using 'clipName' in the path. It doesn't seem to recognize it as a variable. How can I use a variable in this way?

Two Variables In Mc Path... Tried Everything
Hi... searched also through forum without luck...

Wrote this function:


Code:
MovieClip.prototype.remove_tooltip = function(tooltip_number:Number, tooltip_id:Number, source_level:MovieClip) {

source_level.tooltip_onStage3.alphaTo(0, 0.2, "linear");
clearInterval(source_level.tooltip_onStage_id3);

};
Basically, in "source_level" variable I pass a MC path to the function, ie: _level0.panel .

The problem is the number after _onStage (in the above case "3") should be also a variable (tooltip_number).
Same goes for the second statement: where the number "3" should be swapped with "tooltip_number" variable.


Like:

source_level.tooltip_onStage ??? tooltip_number ???.alphaTo(0,0.2,"linear")...
clearInterval(source_level.tooltip_onStage_id ??? tooltip_number ??? );

I've tried everything... square brackets,quotes,double quotes,eval... I'm going mad...

How can I swap the fixed number with my dynamic variable "tooltip_number" ?

Please help.
Thanks.

Path Problem In Loaded Swf
Hi,

I made a complete presentation intro, one swf.

Because I don't know much about paths (actually actionscript in general...), I wrote _root. in front of everything I could, that made it easy for me to write correct paths.

Now My problem. I need to load this complete swf inside a new sfw (an swf with one mc in it that acts as a container for the intro-swf).

Because I load the intro swf in to the container, nothing works anymore because all the paths now reference to the _root of this new container swf... (if I get it right, root is always the main timeline?).

I don't want to go and correct all the code in my intro swf because it's a lot of work and I wouldn't even know how to do it right!

Is there a way I can solve this problem easily?

If not, I will solve it with multiple html pages with slightly different intro-swf's, but that makes it more difficult to update any possible changes in the intro (then I need to update all the intro-swf variations).

Thanks,

wouter

(any good path tutorials would be great to :-)

Path To Loaded Clips
I'm loading one clip into another.


ActionScript Code:
var loadedClip:MovieClip = new PageHome();
loadedClip.name = "clip1";
contentHolder.addChild(loadedClip);

That works, but the reason I loaded it into another clip was so that I can swap it out for other clips but still manipulate them all with the same code by referencing the child. But I can't target the child in there!

Trying to refer to it as "contentHolder.loadedClip" or "contentHolder.clip1" doesn't work.



ActionScript Code:
trace(contentHolder.getChildAt(0).name);
When I trace this way I get "clip1." Cool. But I can't use that syntax in any statements.

For example none of the following work:

ActionScript Code:
contentHolder.loadedClip.octHomeApparel.addEventListener...
contentHolder.clip1.octHomeApparel.addEventListener...
contentHolder.getChildAt(0).octHomeAppparel...
contentHolder.getChildAt(0).name.octHomeAppparel...

I tried various ways of doing square brackets.

Since I couldn't write a correct path to the clip that I put inside another clipI gave up trying to nest the clip. So I tried something like this:


ActionScript Code:
var loadedClip:MovieClip = new PageHome();
loadedClip.name = "clip1";
contentHolder.addChild(loadedClip);

function swapIt(event:MouseEvent):void {
contentHolder.removeChild(loadedClip);
loadedClip:MovieClip = new PageFootwear();
contentHolder.addChild(loadedClip);
}

I get an implicit coercion error. What the proper way to load a clip and then be able to swap it out for other clips?

All my code is in my first first frame and the movie only has single frame clips. I am trying to avoid writing a class.

Reference Path Using Variables
Hello,

i have a script that creates a text field and sets a text field.

the since the text field is dyanmically generated i need to reference the path using variables e.g.

_root.textfieldContainer.mytext.text = _root.stringArray.shift();

i neeed to reference the "mytext" as i will be generating mytext1, mytext2, etc..

how can i do this

Using Variables In A Target Path?
how do I put a variable into a target path?
for example
_root.myMovie._x, but I want to do this to different myMovie files, eg.
myMovie_1,
myMovie_2
etc, and I have a variable var s = 1
eg. the number that changes for each movie. Is it then
_root.myMovie+s._x?
or what???
thanks, and I hope this is not a stupid question.

How To Get Page Name And Path As Variables
I've created a movie that will load another movie clip depending on the path and name of the page that is currently loaded. However I don't know php or how to get the path/pagename returned to flash as a variable, which would then correspond with the movie name to load. The path variables would need to be dynamic for lower levels of the site structure.

So for example:

mysite.com/photos/page1.html
would result in
path1=photos&pagename=page1

and

mysite.com/photos/group1/page1.html
would result in
path1=photos&path2=group1&pagename=page1

Having worked with a php programmer on a mini-flash site that was driven by php and mysql, I figured this was the way to go. Is there a simpler solution? Not sure where to begin.

Thanks!

Attaching Mc's To Other Mc's Using Path Variables
Hi all,

I need to attach a mc or textfield to a parent mc using a path variable (backgroundBoxPath in this case), and manipulate the attached mc with reference to its parents parameters.

However, although trace reports the values of the parameters that you would expect, the results on screen seem to show something completely different, bearing no relation to the figures reported in trace.

Can anyone tell me why this doesn't work as I expect it to?

code: _root.createEmptyMovieClip ("holdingLayer_mc", 1);

_root.holdingLayer_mc.attachMovie ("square1", "backgroundBox_mc", 1);

backgroundBoxPath = _root.holdingLayer_mc.backgroundBox_mc;

backgroundBoxPath._x = backgroundBoxPath._y = 20;

backgroundBoxPath._width = backgroundBoxPath._height = 20;

backgroundBoxPath.attachMovie ("square2", "foregroundSquare_mc", 1);

insetBoxX = backgroundBoxPath._x;

insetBoxY = backgroundBoxPath._y;

insetBoxWidth = backgroundBoxPath._width - 2;

insetBoxHeight = backgroundBoxPath._height - 2;

backgroundBoxPath.foregroundSquare_mc._x = insetBoxX;

backgroundBoxPath.foregroundSquare_mc._y = insetBoxY;

backgroundBoxPath.foregroundSquare_mc._width = insetBoxWidth;

backgroundBoxPath.foregroundSquare_mc._height = insetBoxHeight;

trace ("backgroundBoxPath.foregroundSquare_mc._x = "+backgroundBoxPath.foregroundSquare_mc._x);
trace ("backgroundBoxPath.foregroundSquare_mc._y = "+backgroundBoxPath.foregroundSquare_mc._y);
trace ("backgroundBoxPath.foregroundSquare_mc._width = "+backgroundBoxPath.foregroundSquare_mc._width );
trace ("backgroundBoxPath.foregroundSquare_mc._height = "+backgroundBoxPath.foregroundSquare_mc._heigh t);

Bill

Multiple Variables In Path... Help Please
I got this:
movieClip_mc["button"+buttonNum+"_mc"].onPress = yada yada //works
I want this:
aVariable = movieClip_mc;
-or-
aVariable = _level2
aVariable["button"+buttonNum+"_mc"].onPress = yada yada //is poo poo


how do i make it "not poo poo" (work).

many thanks

Tracking Variables Path
Hi all,
Is there away to track where a variable exists via trace or any other means. If i have created a variable that is in a movie that is in another movie and so on and so on can i trace it's path in relation to the _root?
Cheers

Path Variables Help/advice
Im building an interface and I have a path question.


I have These movies nested
Scroll Clip --instance name :ScrollShell
Mask Clip --instance name :Scroll
Text Clip --instance name :ScrollPanel
Product_Box --instance name :Product1


Prod1_Name
In Product_Box I have a Dynamic TextBox called

Prod1_Name


what path do I give the variable

Ive tried _level0.Prod1_Name and _root.Prod1_Name
then I tried combinations of the above names in linear sequence with dot notation between each name

Im stumped please advise me.

Referencing Variables In Path? HELP
Hey All,

I'm pretty certain this is an easy one, just can't figure it out. Here's the code....... Some of it is commented out. The issue was that everytime the loop ran through the images would reload starting from top down. So I'm trying to set this up so that the instance names of the movieclips are also designated by the loop. The movieclip instances are "th1, th2, th3, etc....."


clipData = new XML();
clipData.load("clips.xml");
clipThemes = new Array;
clipData.ignoreWhite = true;

function myOnLoad () {
clipThemes = clipData.childNodes;

for(a=0; a < clipThemes.length; a++){
//a = a+1;
TH1 = clipThemes[a].firstChild.attributes.thumb;
CL1 = clipThemes[a].firstChild.attributes.clip;
TI1 = clipThemes[a].firstChild.attributes.Title;
CT1 = clipThemes[a].firstChild.attributes.clipTxt;
monster = "th"+[a];

trace(monster);
//// the trace here works!!!!!

_root.monster.spot.loadMovie(clipThemes[0].firstChild.attributes.thumb);
_root.monster.title_txt.text = (clipThemes[0].firstChild.attributes.Title);
////// The issue is here..... How am I referencing "monster" wrong?????


/* th2.spot.loadMovie(clipThemes[1].firstChild.attributes.thumb);
th2.title_txt.text = (clipThemes[1].firstChild.attributes.Title);
th3.spot.loadMovie(clipThemes[2].firstChild.attributes.thumb);
th3.title_txt.text = (clipThemes[2].firstChild.attributes.Title);
th4.spot.loadMovie(clipThemes[3].firstChild.attributes.thumb);
th4.title_txt.text = (clipThemes[3].firstChild.attributes.Title);
th5.spot.loadMovie(clipThemes[4].firstChild.attributes.thumb);
th5.title_txt.text = (clipThemes[4].firstChild.attributes.Title);
*/


Any help would be great!!!!

Dynamic Path's W/ Variables
hey guys,

i cant figure out how to do this in AS 3.0, but I want to do something like so:

var numz:Number = 1;
DocumentClass(root).container_mc.path[numz]_mc
numz++

know what I mean?

where the numz gets put in on the path, how do I put variables into paths?

thanks =)

Help Creating A Path Using Variables.
HI

I;m trying to create a path to a movievclip created with attachMovie. I need tio create the path using variable:

_root.var1.var2.gotoAndPlay("something");

How can I tell flash that var1, var2, etc are variables and not a relative path?

Tks,





























Edited: 01/16/2007 at 10:50:24 AM by oscmejia

Variables In Target Path?
I have been searching all over and cannot find a solution to this problem. It works fine when I hard code it but I am trying to get this to work with the for next loop. It apears that the variable arrays are giving me a problem. Whatever I try gives me "TypeError: Error #1010: A term is undefined and has no properties"

Code below:

var menuCurrentPos:Array = new Array(0,1,2,3,4,6);
var menuDefaultPos:Array = new Array(0,1,2,3,4,6);
var menuMCArray:Array = new Array("btnAbout_mc", "btnCustDes_mc", "btnMaint_mc", "btnLogos_mc", "btnWebDesign_mc", "btnHome_mc");

for (var i:Number = 0; i < menuMCArray.length; i++){
trace("i: " + i + " " + menuMCArray.length + " " + menuMCArray + " " + menuCurrentPos);
this.menuTabs_mc.setChildIndex(menuTabs_mc.menuMCArray, menuCurrentPos);
menuTabs_mc.menuMCArray.addEventListener(MouseEvent.ROLL_OVER, buttonOver);
menuTabs_mc.menuMCArray.addEventListener(MouseEvent.ROLL_OUT, buttonOut);
}

Any suggestions would be appreciated.

Thanks

Inserting Variables Into A Path...
Hi guys,
having a bit of a problem, it's so basic but my brain is struggling.

Code:
on (release) {
thisid = "2";
_root.i_icon(thisid).iconstates.gotoAndStop(1);
}
I'm not sure what I am doing wrong here, I just want to insert the variable defined on line 2 into the path, I have tried everything and nothing seems to work...any ideas would be much apreciated,
thanks

Problem With Variables And Path To Mc
Hey everybody!

A short description of my project:
1) Fetching data from mysql
2) Make x numbers of buttons using duplicateMovieClip. (depends on num_rows from db)
3) Set text in buttons from db with dynamic text.

I'm talking about the buttons on the left side here:
http://www.distorted-personality.com/index2.html

Here's the code-snippet i experience problems with.


Code:
for(var a=0;a<10;a++){
_root.btn_archive.duplicateMovieClip("button"+a,_root.getNextHighestDepth());

button0.archive_txt = lv.tittel0;

button0.onRollOver = function(){
this.gotoAndStop(2);
}
... And so on.

If you look a the code above, button0 <- I want that to be something like: button[a].
If I do a trace on trace("button"+a), it works perfectly.(returns button0, button1 ... etc)
If I make it a variable, var tmp:String = "button"+a;, it will also give me the same result.

But if I try to target a mc with path, example tmp.onRollOver = function(){, it will not work.
- button[a].onRollOver doesnt work.
- "button"+a.onRollOver doesn't work.

How can I integrate that a-variable into my path to the newly created mc's?

Guess any of you in here can help me out! I hope so!

Thanks in advance.

Target Path Using Variables?
Hey everyone,

I've run into a problem where I want to use a variable as part of a target path...example..


Code:
var myVar:String = String("myMC");

//say I have a MC with this path...this.myMC
this.myVar._y = 3;
is there a way to do something like this? Everything I try doesn't work, yet I can use this concept in a different way.


Code:
//this works fine
var newColor:Color = new Color("States." + myArray[i]);
I have tried the tellTarget(object) also the with(object) but I can't seem to get anything to work. Any ideas?

Variables In A Target Path?
i have this target path

grnd = _parent.ground2._y;

i want the object to move up to the next ground object i have -

there's 4 levels and when they push the up arrow i want them to move up one level and if they push the down button i want them to move down

level1 = ground1
level2 = ground2
level3 = ground3
level4 = ground4

here's waht i have that doesn't work

PHP Code:



    if (Key.isDown(Key.UP)) {
        if (i<4) {
            i++;
        }
        rGrnd = "ground"+i;
        grnd = _parent.rGrnd._y;
    } 




this comes up undefined

i know you could do it by asking what ground its on and then go up or down from there but if i could find a way to use variables it work be alot easier

Question: Using Variables In A URL Path?
I am getting a variable from a PHP page and trying to use that number in loading an image in flash. Here is the code.


Code:


imgNum=_root.newNum;
loadMovieNum("/images/small/"+imgNum+".jpg", 2);



Currently it is not working. I have a dynamic text field showing the correct number using 'imgNum' as the var:

The code works fine if I use:

Code:


imgNum=1;
loadMovieNum("/images/small/"+imgNum+".jpg", 2);



What am I doing wrong here? Thanks for any help!

FSCOMMAND With Path Variables
Greetings,

This is my first attempt at working with flash since about 5-6 years ago, so I guess I am new again.

To note: I am using MX 2004 Education Edition. I am creating an SWF that runs in Projector (.exe).

There is a button that says "Browse Contents" that, when clicked, will open windows Explorer (explorer.exe) and show the contents of the disc. I am having it launch a KIX script, which works properly from the RUN line and CMD. I am wondering if there is a syntax problem with my code.

Both WKIX32.EXE and browse.txt are in the FSCOMMAND folder. I am able to get this Projector to open other applications via a Batch file (such as an InstallShield app) but not through KIX. I am using KIXTart because I was unable to create a batch file that could detect what CD drive the Projector was on.

Here is the code:


Code:

on (release) {
fscommand("exec", "WKIX32.EXE browse.txt");
}



Possible solution is for me to fix my code OR find out a way to make with a BAT file.

The KIX script code is as follows (limted):


Code:

IF EXIST ("D:fscommandsetup.bat")
$cddrive = D
ENDIF

RUN "Explorer /root,"+$cddrive+":"



I imagine that Projector is having a problem opening KIX and not running the script.

Thanks

How Can I Find Out The Path Of The Loaded Swf File On The Web?
Yes, my problem is this:

I am calling my swf from all the pages on my web site. The pages are on a lot of different levels on the server - there is /index.html as well as /se/2004/index.html

So far so good, but my Flash file is loading variables from an external file, a file which has to be referred to with relative paths, since I am calling different files depending on what language the site is being show in. Confusing? Not really, look here:

/se/swf/movie.swf should load /se/flashvars.txt

while

/fi/swf/movie.swf should load /fi/flashvars.txt

This wouldn't be a problem if I could find out the path of the page that the swf file is being called from! But I don't know how to find out from inside the Flash file whether the swf is residing on /index.html or /se/2004/index.html

Could anybody shed some light in the matter? I'd be very grateful...

/Mans

Path For Loaded Html Text
I have a scrolling dynamic text field that loads in text from an external txt file. This works fine in the child swf. But when I load this swf into the parent mc the text does not show up. The scroll bar is there and sized. I am sure that i am missing something simple. An extra set of eyes would be great. I am not sure where to add the path???
F

scroller.html = true;
myLoadVar = new LoadVars();
//load the contents of the text file into the LoadVars object
myLoadVar.load("dinner_menu.txt");
//check to see if the loading is completed and, if so, put the contents in the text field
myLoadVar.onLoad = function(success) {
if (success == true) {
scroller.htmlText = myLoadVar.myText;
}
};

Changing The Dir Path Called From A Loaded Swf
by default when a http call is made from a swf the directory path refers to the placement of the html file that the swf is loaded into.

In the case that the html file is loading in the swf from a different server. Is there anyway to target the directories on server from which the swf is loaded using relative paths within the swf.

example

html resides at

www.myhtml.com

swf loads in from
www.myswf.com

is there a way to get the swf to call

www.myswf.com/swfdir/index.html
using getUrl("/swfdir/index.html");

Loaded Movie Target Path
Hi

I'm having real problems working out the path to get a scroll function within a movie loaded into another movie (using a movie holder) to work. Grateful for some help.

The main movie has a movie holder with an instance name of 'approach_mc'. This hold a movie (approach.swf).

Approach.swf has a scroll function with the following actionscript:

ActionScript Code:
y = getProperty("_root.text.content", _y);
if (y<-120) {
gotoAndPlay(4);
} else {
setProperty("_root.text.content", _y, y-6);
}
The _root.text.content path on the loaded movie is obviously the problem, as it refers to the root on the loaded movie rather than the main (parent) movie.

But what should the path look like - I've tried various paths but nothing is working.

Grateful for some advice.

Thanx

Dirk

Loaded Swf - Relative Path Problem
I know this problem has been discussed/solved ad nauseum here and on other sites, but I've scoured the boards, and can't find it, so forgive me.

I'm building a portfolio site for an art director. He has access to final swfs but not fla files, and I'm calling these final swfs into a main movie, using MovieClipLoader. The external swfs live in subfolders, relative to the location of the main movie. The problem, of course, is that when the external swfs are loaded they look for any additional swfs relative to the movie they're loaded into, and not relative to the folder they're located in. I've tried _lockroot -- no dice. Any ideas -- or can you point me in the direction of a post where this has been solved?

Thanks,

Flysi

Unable To Determine Path Of Loaded MC
I was wondering if somebody could shed some light on this for me. I have attached a .zip with the files used. I am loading an swf file into a created MC. Then I am trying to reference a movie clip contained within the loaded swf. When I look at the path in debug it shows _level0.test_mc.instance1.button1. I can reference it using this but the instance# changes depending on when you click the button that loads the swf in my larger movie. I have instance names assigned for all the movie clips involved, but I dont know what the instance1 is referring to. Any help will be appreciated.

Loading Variables With A Relative Path
Hi!

IŽd like to know how do I have to write the relative path to get a .txt that is placed in another folder. This is, inside my project folder there's another one called "texts" that includes several .txts

If I write:
loadVariablesNum ("\texts\mytext.txt", 0);

it works when publishing if I open it with Netscape , but it doesnŽt when using IExplorer

How can I solve this??

Any good idea?

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