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




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.



SitePoint > Design Your Site > Flash and Actionscript
Posted on: May 14, 2004, 15:05


View Complete Forum Thread with Replies

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

Unable To Determine Clip Width After Its Loaded
Hi,

I am loading images into a container movie clip in response to user commands. As the images are fairly large I use a preloader. This preloader looks like this:


ActionScript Code:
var loader_mcl = new MovieClipLoader();
loader_mcl.addListener(this);


function startPreload(url){
    loader_mcl.loadClip(url, container_mc);
}

Using MovieClipLoader() allows me to use its methods to determine when the clip has loaded, where I place further commands to position the new clip relative to its width. However I am unable to determine the clips width, it simply returns 0.


ActionScript Code:
function onLoadInit (target){
   
    // remove the preloader animation
    preloader_mc.removeMovieClip();
   
    //set position of movieclip
    //target.setPos();
    _root.setPos(target);
    trace(target._width);
}

Can anyone tell me why I can't determine its width?

Thanks.

Determine Path To Swf
Hello,

Is there a way to determine if the swf file is playing back from a local file:/// or server http:// location in AS3??

Happy Thanksgiving!

cheers,

frank grimes

Determine A SWF's Own Path On The Server
Is there a way actionscript can determine the path of the .swf file on the server?

Lets say the full path of the .swf is http://localhost/folder/my.swf.
I would like my.swf to determine its own path on the server.. in this case http://localhost/folder/.

Anyone can help me out here? Thanks in advance!

Unable To Record To SAN Using A UNC Path
We are trying to connect our FMIS3 with our SAN using a UNC path "\upload.localuploadFMSRecording". We have modified the Application.xml’s “StorageDir” tag and we have tried modifying the Vhost.xml’s “Streams” tag. We are able to play the flvs from the share and able to record if the directory already exists, but if the FMIS3 has to create the directories it does not record.

We have configured the SAN permission for FMIS3 to read and write. We have also locked the user account for both the Flash Media Server and the Flash Media Administration Server and the user has full control access.

I would appreciate anyone that could help. Thank you.

How To Determine The End Of A Loaded SWF
I am loading an SWF into an empty movie clip in scene 1.
Scene 1 has only one frame. I would like to advance to the second scene after the loaded SWF finishes its animation.

How can I determine the end of the SWF so that I can move on to the second scene?

Thanks in advance for anyone with ideas.

Determine When .jpg Loaded
Hi there,

I have used the function LoadMovie to load an external .JPG to a target movie clip instance in my flash.

Is there any way that I can determine when the external .jpg has finsihed loading into flash before I contine to the next frame?

Thanks!

(using MX2004)

Determine When An External Jpg Is Loaded
When using the load movie function to load an external jpg, the swf continues to play regardless of whether or not the external jpg has loaded. Is there any way of determining when an external jpg has loaded? The usual pre-loaders don't work for this problem.

Can A Swf To Determine If/when HTML Has Loaded?
I'm wondering if there is a way for a swf to determine if and when the HTML page it's residing in has completed loading. I assume this would involve javascript sitting in the page that communicates to the swf?

Thanks in advance.

How To Determine When A Movie Has Loaded
Hi,

Using the below command

loadMovie("ar_ad.swf", "arena_loader");

what would be the commands i would use to determine when it had finished loading?
I have read through various tut's and in my books, but i cant seem to grasp what i need to use

Any help would be cool,
Thanks
Steve

Determine When A Movie Has Loaded
I load a swf movie with
loadMovie("01.swf","_level1")
and want to set some properties of this movie after loading.
How does the calling flash program determine when the movie 01.swf has loaded so it can
set the the propterties of the loaded movie.
Can anybody help me on this
Thanks,
Markus

?Determine The Filetype Being Loaded (swf,flv,png,gif,jpg)?
Hi all I'm pretty new to actionscript 3.0 and I have already found a problem I just can't seem to solve.
I need to load flv's or jpg,gif,swf,png files from dynamic urls.
I don't know what type of file it is until I start loading it. So I need to somehow find that out, and then handle the files with the appropriate functions (eg playFlv, loadOtherContent)



In my old non-AS3 player I used this code to do that. ( I bet there is a better way, but I did not know it and still don't )
Code:

// loads dynamic urls and returns the real url
function decodeUrl(url:String):Void
{
   var decodedUrl:String;
   var _mcl:MovieClipLoader = new MovieClipLoader();
   
   createEmptyMovieClip("tmpMc", getNextHighestDepth());
   _mclListener = new Object();
   
   _mclListener.onLoadStart = function(target:MovieClip) {
      _mcl.unloadClip(target);
      cleanUrl(target._url);
   }
}
// cleans url of querystring extras ( ?xml=aodfkjqer&meta=lkjl1298737 )
function cleanUrl(url:String):Void
{
   var searchTermsArray:Array = new Array(".flv", ".jpg", ".gif", ".png", ".swf");
   var cleanedUrl:String;
   
   for(var i=0;i<searchTermsArray.length;i++)
   {
      var searchString:String = searchTermsArray[i];
      var index:Number;
      
      index = url.indexOf(searchString);
      if(index != -1)
      {
         cleanedUrl = url.slice(0, index+4);
         determineUrlFileType(cleanedUrl);
      }
   }
}

// sets the filetype variable
function determineUrlFileType(url:String):Void
{
   fileType = url.substr(-4);
   contentLoadSwitcher(fileType, url);
}

function contentLoadSwitcher(fileType:String, cleanedUrl:String):Void
{
   if(playerStartedPlayingClip) recordEvent("Start");
   if(fileType == ".flv")
   {
      playFlv(cleanedUrl);
      break;
   }else{
      contentLoader(cleanedUrl);
      break;
   }   
}


I bet there would have been more elegant ways to do this, but I'm pretty new to Flash stuff and that was the only way I worked out to do it.

Hope you can help me find a AS3 way of doing it. Thanks in advance

Determine If External Movies Are Loaded (MX)
I have a collection of random background swf files that I am using in my site (thanks to reading some posts on this board). However, I do not want my parent movie to start playing before the child backround is loaded. I hope that makes sense and I am using the proper terminology. I do have a simple preloader which checks to see if the movie is completely loaded.

Any help will be appreciated

Determine Size Of Loaded Image.
hello.. I am using loadMovie in loading images in flash..is it possible to know the size of loaded image? thanks..

Determine If Movieclip Has Certain Frame Loaded?
Hello hello!

I am making a very large project, and it's gotten so big that my boatloader needs a bootloader. The bootloader has a movieclip in it. The first half of the movieclip is simple animation thats quick to load. The second half is very large and doesn't need to play until the main movie is done. I don't want to change this setup.

What I am trying to do is get the pre-bootloader to check this movieclip to see if the first half of it has been loaded, so that it knows its safe to run the main bootloader.

I am using this code. It was guesswork though:

ROOT FRAME1:

Code:

if (_root.box_3._framesloaded >= 45)
{
_root.gotoAndPlay(3);
}

ROOT FRAME2:

Code:

gotoAndPlay(1);



box_3 is the variable for the movieclip in question. Its frame 45 is where the small content finishes. Said frame has a stop(); applied to it as well.

However, the root's frame 3 never plays. What have I done wrong?

Your help is greatly appreciated!

-Chibi

Determine If SWF Loaded Into Movieclip Has Finished Playing
Hello all,

I am using Flash CS3, aiming to get a version 6 or 7 flash with actionscript 2 file.

I have made a flash file which is a menu system to load external SWF files, as well as a container (called "movieclip") which is a mc to load the external SWF files into.

So on the left I have the menu, and on the right I have the movieclip container.

This all works fine.

What I would really like is that when one SWF finishes playing it will automatically load the next one.

Here is my current set-up.

Each menu item is a 'button', and there is actionscript on another layer which defines what the button does.


Code:
my4_btn.onRelease = function (){
loadFour();
}
So all it does is call the function "loadFour" which is a custom function.


Code:
function loadFour() {
loadMovie("fl_04_address_controller.swf", "movieclip");
trace("loaded clip four");
while(movieclip.getBytesLoaded < movieclip.getBytesTotal) {}
trace ("after while loop");
if (movieclip.getBytesLoaded == movieclip.getBytesTotal) {
trace ("clip fully loaded");
createEmptyMovieClip("preload5", 5);
preload5._x = -2000;
preload5.loadMovie("fl_05_messaging_controller.swf");

this.onEnterFrame = function() {
if (this._framesloaded != undefined && this._currentframe == this._totalframes) {
trace("Playback complete!");
loadFive();
delete this.onEnterFrame;
}
};
}
}
The things loudFour() should do is this
1) Load the Fourth SWF file into the container.
2) Once that clip has fully loaded it will begin to preload the Fifth SWF file in a container off the edge of the screen.
3) Once the Fourth SWF has finished playing all it's frames, now we will call loadFive(); which does all the same stuff but to the next clip.

Number 1 works.
Number 3 definitely doesn't work. Number 2 - no idea.

This is my first attempt at writing actionscript, and what I've put together here is a result of my research thus far.

Determine Width & Height Of Loaded Image With AS?
Is there a way to determine the width and height of a dynamically loaded image using Actionscript. I'm loading jpgs using "LoadMovie" from an XML doc and I'm trying to resize the images to fit in the specified MC. I want this set up so I don't have to pre-size all of my images in advance.

I've searched the archives and forums but haven't found a definate answer that I can understand.

Thanks for any help you folks can provide.

How To: Determine If SWF Is Running In Same Browser Domain As It Was Loaded From
This may sound like a strange request, but I need to be able to determine:

1. What browser domain the current swf is executing in (that is, the page that hosts the swf is displayed in a browser, what is the domain of the page)?

2. What server domain the SWF was loaded from (ie, what the URL domain was for the SWF)?

I believe both of these I can get via javascript and ugly workarounds and pass them in, but what I need is actually to get these values (at least #2) from inside the SWF without relying on the javascript in the hosting page.

Specifically, what I'm trying to determine is if the SWF is executing in a page from the same domain as it itself was hosted/loaded from. I want to fork on this test and create different behavior for a SWF if it's "hot-linked" (that is, loaded onto a page on a different domain from where I host it).

I've looked into flash.system.SecurityDomain and ApplicationDomain... both these have properties called 'currentDomain' which would seem to be the value i'm looking for (for #2), however this object is a static variable that I can't seem to get any information out of or transform into any kind of useful string that I can look at it's value and test with it.

The only info I've found on either of those two classes all relates to passing them to LoaderContext and such, when you are loading external resources.

I do not want to load anything, I just want to determine how and where the SWF is executing.

please help!?

How To Determine When Shared Library Components In A Child Swf Is Loaded
Exported for player 8, AS2, per client's corporate environment

I have a parent swf that loads in several child swfs. Some child swfs use a runtime shared library for components.
When each child swf is loaded (using onLoadInit) the parent swf scans the child swf looking for recognizable instance names so it can apply functionality.

This worked fine until I moved the components into a shared runtime library. Now it seems that the scan is being triggered before the shared components are available on the stage.

Is there a way to determine when the shared components are:
A. Present on the stage, as not all child swfs have them
B. Loaded

Ideally without adding code to the child swfs, as there are a lot of them and I'd prefer to keep them as dumbed down as possible.

Thanks for any help!

Unable To Target Loaded Swf In 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.

COuld Someone Please Show Me How To Determine An External Loaded Movies Frame Number?
HI,

I would be most greatful if someone could assist me with my problem here, my project cannot progress until i have resolved it - and i have been searching and searching for an answer.

To most, this question will seem basic probs, but to me... i havent grased the ideas yet.

I am using a loader component, instance named 'loader' to load in an external swf, called 'mc_1'.
I can load it in fine, and even have a progress bar - but my plight is two fold.

Firstly, and the most important - i want another event to trigger at the end of when the loaded movie has 'played' - and i do not know how to determine when the loaded movie has reached the ends of its internal timeline. PLease could someone assist me. I tried using the currentframe command attached to the 'loader', i.e. loader.currentframe - but when i do a trace it keeps saying that the frame is '1'. My logic is telling me, thats because in affect, the loader component im using does only have 1 frame - its actually the loaded in movie that contains the frames. So how do i actually access the frame number of the movie loaded into the loader component (man.. sorry if i repeated myself there a bit - im finding this quite difficult to explain)

Also... when a movie has loaded in using the loader component, how do i only get it to play when i require

I would be most greatful if someone could spend a little time here and help me

Thanks
Steve

MC Troubleshooting - Why Unable To Click On Loaded MC?
Hey,

I have 2 small prob's:

I have my index file which loads an intro.swf on a blank MC on the main timeframe, and the actionscript for the MC is like

onMovieClip(enterframe)
{
loadmovienum("intro.swf",1);
}
//i don't have in front of me so "onmovieclip" might be wrong but it's the right one.

the frame itself has stop(); on it. The prob is that nothing loads on the blank MC and i have no idea why?? it's in the same directory, and such.

Prob #2:

That within the intro.swf they play a tile moving game called tile.swf and that is loaded right over the timeline in level0, and when tested, the tile.swf loads fine, BUT I can't click on the tiles to play the game, or the cheat button, I see when i can click (like when cursor over button) but when i click, nothing happens..

I've tried every variance of the script and am truly STUCK!!!

PLEASE I need this up and running really really soon!!

thanks in advance
Greg Overholt

[CS3] HOT Unable To Delete Loaded Movie
Hello,

I have a main move with containers that load slide show swf's at runtime on button click. As I cycle through my menu that has a different version of a the same xml gallery I notice that when you back track to an area and reload the swf, it plays both slide shows. Since I load all the swf's in the same container I use this code.


PHP Code:



on (release) {
unloadMovie(_root.infoAContainer_mc);
loadMovie("info2.swf", "_root.infoAContainer_mc");

}




I have tried createEmptyMovieClip and get the same thing. I also notice this in the .as file


PHP Code:



var a:Banner = new Banner(_root.infoAContainer_mc.createEmptyMovieClip("holder2", 10), ((_level0["BannerXmlPath"]==undefined)?"banner2.xml":_level0["BannerXmlPath"]));




Did a bit of looking around to see how to delete this variable all together but no luck.

Loaded Movie Unable To Use Goto Actions
Hi there:

Im developing a flash photogallery with about 800 images. do the large number of images I decided to split them in separated swf files, and load them to a main interface using loadMovie. The problen is that the independent swf files holding the images use a flash MX component called "mc, controller" that I got from a flash template. this component is designed to work placing the images in the main timeline (the code has several references to "_root"), so.. if i load this swf and place it inside a movieclip it stops working. so I decided to load it to a empty scene in level 1. Here comes the tricky thing.... it loads beautyfully, BUT when I try to go to an other scene it simply doesn't work...

here is the code of the boton that is soposed to go to a different scene, it is located inside the "mc, controller" component:

on (release) {
tellTarget ("_level0") {
gotoAndStop("fotos", "fotos_main");
}
}

Id also tried using relative and absolute path, and dot notation:

this._parent.gotoAndStop("fotos", "fotos_main");

_root.gotoAndStop("fotos", "fotos_main");

_level0.gotoAndStop("fotos", "fotos_main");


I have allready tested like 20 diferent aproches to solve this but no one seem to do it right.. please help me, or lend me a gun to blow my brains out

sorry for the english... me not native speaker...

Unable To Access Function From Inside A Loaded Movie...
Guys,

I am new to Actionscript. Up till now I have only used flash for animation. So hopefull I make sence...

I have a movie called Loader.

In loader I have a tooltip function (fillTip) which shows tool tip for items in that movie (works fine in loaders.swf).

Now I am loading another movie (movie.swf) inside loader. I want to access a function located in the loader.swf. Being this is a second movie that is loading, I can use trace to check my problem...

I have tried _root.fillTip and _global.fillTip...

Please advise,

Shrini

[MX04] Unable To Get LoadVars To Use Array Reference To Loaded Variable
Hi,

I would like to display some text that I have loaded into a movie through the LoadVars object. I am able to do this if I hardwire the name of the variable to be picked up on in the loaded .txt file, but not if I use a reference to the variable by looping through an array holding the variable names used in all the files to be loaded in.

So in other words this will work:


Code:
_root.past_txt.text = _root.varLoader_array[0].past;


But this wont:


Code:
variableName_array=["past", "present", "future"];

_root.past_txt.text = _root.varLoader_array[0].variableName_array[0];


I think the problem might be that Flash sees the variableName_array[0] part as a string & not a variable, I really dont know, but I would be grateful if anyone can help me out on this.

Many thanks.

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.

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.

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 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.

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

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

Relativ Path In Dynamicaly Loaded Movie
hi all
I have a mc (MC1) containing a number of objects wich all are placed dynamicaly in a position relative to each other. This works fine by it self.

The problem is that when I dynamicaly load MC1 into another MC (MC2) in the movie the positioning gets screwd. The problem seems to be that the relative paths used for positioning the objects within MC1 dosn't work when the MC1 is loaded dynamicaly into the MC2.

Anyone know whats happening? and how to avoid it?

[MX] Preloader Path Problem For Loaded Movie
I have created two flash files. One contains the main content of my flash website(design2.swf). The other(finaldesignsite06.fla) contains the code to load design2.swf:

Code:
(loadMovieNum ("design2.swf", 1);
stop ();
The first purpose of loading one movie into the other is a workaround to solve some gif distortion problems. The second purpose is to try to solve some preloader problems I am having(which I have not completely solved yet)(yes, I have unchecked export on first frame)

Here is what I need help with: I would like to have the preloader that is within finaldesignsite06.fla show how much of design2.swf has loaded.


Here is the code I am using right now:

Code:
//this is in the first keyframe
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*300;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(4);
}

Code:
//this is in the second keyframe
this.gotoAndPlay(1);
Does anybody have any suggestions for how to make this work?
Thank you.

Setting File Path For Loaded Movieclip
I have a large collection of flash movies stored in different folders. These movieclips are loaded by a master flash menu application using loadMoviceClip. The problem I have run into is that the movieclips I load in turn loads other movieclips that are located relative to THEIR file root. The problem is that the file root of the MASTER flash file, the loader, are used as file root. Is there a way to set the file root for a loaded movieclip ? I do not want to change the load routines in the MC's I load since there are thousands of them..

Ext Loaded Mc - Path Problem - How To Organize Project
I load like every time ext. swf into main movie.
Exist any way how to find out the path of the loaded movie. :?:
I am used to have in external movies control of actions and buttons.
I fight with this problem every time.
Is somewhere discribed how to use working with code if you load external movies?
I have some code in external movie and access some functions is than not easy - path problem mostly.
Than look the code like this and I waste my time what path is wrong :cry: :
Code:

_parent._parent._parent._parent.indicator.windowWhirpools_mc.title_top.html = true;
_parent._parent._parent.indicator.windowWhirpools_mc.title_top.htmlText = _parent._parent._parent.myVars.var_section_name_04;
Thanks

Target Path Not Working In My Externally Loaded SWF File
Alright, so I've tried quite a few things with no luck. I have a scrollbar that works in the swf fine, but when loaded into my mainmovie container I get this error...
Target not found: Target = "/scrolling text " Base = "_levelO.swf container"

Basically I understand this to mean that the externally loaded movie cannot find the instance name /scrolling text. The code is as follows that I have set to the scrollbar button in the externally loaded swf....

on (rollOver) {
tellTarget ("/scrollingtext") {
nextFrame();
}
gotoAndStop("down1");
}

Any suggestions? I tried changing the target to _root.scrollingtext with no luck. Also tried _parent. So I'm sure I'm just not thinking about it right but Any help would be greatly appreciated. Thank you ahead of time.

Loaded Movie Losing Actions - Path Problem?
I have posted a question regarding this before, but I have tried the same solution and it is not resolving my problem. I have some code in a movie that is not working when it is loading into another movie. I tried changing any instances of _root to this, but that is not working. Is it possible that it is a setInterval issue?

Here is the code (original code that is working within the loaded movie)


Code:
function loadPhrase4(){
clearInterval(loadPhrase4);
_root.attachMovie("phrase4","phrase",998)
_root.phrase._x = 374.6;
_root.phrase._y = 6.3;
_root.phrase._alpha = 100;

MovieClip.prototype.grow = function(j,k) {
this._xscale += k;
this._yscale = this._xscale;
if (this._xscale>j-1 && this._xscale<j+1) {
delete this.onEnterFrame;
}
};
_root.phrase.onEnterFrame = function() {
this.grow(2000,100);//2000 is size?, 100 is speed of growth? both effect each other
if (this._alpha <= 100)
{
this._alpha -= 6;//speed of alpha fade
}
else{
delete this.onEnterFrame;
}
}
}
loadPhrase4 = setInterval(loadPhrase4, 100);

Taget Path Problems With Targeting A Frame Of A Movie Thats Not Loaded
Hello all, I have tried lots of work arounds and still can't get this to work.
I have a stop frame that loads a movie, I need to target a frame of that movie.. even though its not yet loaded because I have one target for all my content. this works whens its loaded:
on (release) {
_root.container.loader.work.gotoAndStop("work_ad") ;

}
is there a way to have an path for a frame for a movie that is not yet loaded?
like:
on (release) {
_root.container.loader.work.gotoAndStop("work","wo rk_ad");

}
any help would be great... thanks!

Using Eval Function And Variable In A Path (target Path)
Hello,

I have to reprogram some of my website and it calls to conjugate strings in a way that's beyond my understanding. Please help me with some suggestions. Kind regards.

the original code is:

code:
if (_global.useCount<10) {
//hide
var diff = 10-_global.useCount;
for (diff; diff>0; diff--) {
eval(String(11-diff))._visible = false;
}
}

There are buttons named 1 to 10 and this turns off the ones that are not used. Now I want to nest those buttons in subclip "buttonsRow", instead of having them on main timeline. How do I rewrite that code to make it work with new path?

I have already tried the "associative array" method, but it don't really know how to pack the whole eval function in there. I've tried many combinations, like:

code:
this.buttonRow[eval(String(11-diff))]_visible = false;
//or
this.buttonRow["eval(String(11-diff))"]_visible = false;
//or
buttonRow[eval(String(11-diff))]._visible = false;
//or
buttonRow["eval(String(11-diff))"]._visible = false;
//or
buttonRow[eval(11-diff)]._visible = false;
// or
buttonRow[8]._visible = false;
//the last one at least turns off button 8, lol

Some of those return syntax error and some just don't work. Anyone have any ideas? Thank you again.

Cannot Export An Avi Of Motion Along A Path When Path Is Specified With Action Script
Hello!
I have the following problem: I am using Flash 8 Professional to produce a series of avi files showing the motion of a dot along different paths. Whenever I use the drawing tools to draw the path everything is all right: I can export both a swf and an avi file showing the motion. The problems start when I use action acript to specify the path: then a swf can be exported, but not an avi file (Flash acts as if it is exporting but the avi file produced shows only a stationary dot). Can anybody help me?

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