Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loadmovie and target problems (sorry for the long post)

Status
Not open for further replies.

PaulFynch

IS-IT--Management
May 23, 2002
105
CA
thanks in advance for reading this post. any help you can give would be awesome. i would like to add that i have only posted a couple times, and have been working with flash for about 2 years now, but almost every problem i have encountered, i have found a solution in the postings at tek-tips. awesome job to all of you!
now on to the problem. over the last month this movie has become complicated, so i have simplified it to the basis of what it does still retaining the syntax etc:

i am working with a map that is separated into 2 parts, each part has 2 divisions
part "a" is upper region (_root.content.upper) and part "b" is lower region(_root.content.lower).
each region has 2 divsions: upper has division A & B, lower has division C & D.
Both MCs (upper, and lower) have a number of frames and animations for the different divisions with
frame labels for each one: upper framelabels: "blackout"(frame 1), 'playA', 'playB', and the lower with
'blackout', 'playC' & 'playD' repectively.

on the HTML pages where i call the map (results.php), i use a tiny, simple little php code to pass a variable into the flash movie so the map will display the same division it was on when the user clicked, or if the page is new, start from the beginning.
the php code looks like this

<PARAM NAME=movie VALUE=&quot;flash/map.swf?divid=
<?php echo $divid?>&quot;>

buttons for divisions a, b, c, and d respectively have
getURLs that call the same page, for example:

on(release){
getURL(&quot;./results.php?divid=A&quot;)
}

for the division A button.
all of this works fine and wonderful
now.
in frame one of the movie, i have a couple functions:

function findDiv ()
{
//////this function determines if the map page is new,
//////or if there is a variable in 'divid' and plays
//////the movie accordingly

if (_root.divid == &quot;&quot;) {
break;
} else if (_root.divid == undefined) {
break;
} else if (_root.divid == &quot;A&quot;) {
_root.backVar = &quot;upper&quot;;
_root.hooksMeUp();
} else if etc...B,
} else if (_root.divid == &quot;C&quot;) {
_root.backVar = &quot;lower&quot;;
_root.hooksMeUp();
} else if etc...D

function hooksMeUp()
{
//////this function concatenates the path and
//////variable '_root.backVar' to play the right MC
//////appropriate to the variable 'divid' and then
//////tells the MC _root.backVar(upper or lower) to play
//////at framelabel &quot;play&quot;+divid

_root.myPath = eval(&quot;_root.content.&quot;+_root.backVar);

if(_root.backVar==&quot;lower&quot;){
_root.contents.upper.gotoAndStop(&quot;blackout&quot;);
//cuz i dont want upper and lower
//playing at the same time
} else {
break;
}

_root.myFrameLabel= &quot;grow&quot;+_root.divid;
//will return &quot;growA&quot; or whatever
_root.myPath.gotoAndPlay(_root.myFrameLabel);
//go to where you were before
}

and all this works fine.....
but, then i rip frames in _root.content.upper, and _root.content.lower into separate flash
documents &quot;external_upper.swf&quot; and &quot;external_lower.swf&quot;, making upper and lower blank instances.
then i add this function:

function loadMeUp(){ //self explanatory
_root.content.upper.loadMovie(&quot;external_upper.swf&quot;);
//methods rock;actions suk!
_root.content.lower.loadMovie(&quot;external_lower.swf&quot;);
(plus some coordinates stuff to position them properly)
}

and change the previous function 'findDiv' to call 'loadMeUp':


function findDiv
() {
//////this function determines if the map page is new,
//////or if there is a variable in 'divid' and plays
//////the movie accordingly

_root.loadMeUp;

if (_root.divid == &quot;&quot;) {
break;
} else if (_root.divid == undefined) {
break;
etc, etc...
}

here is where the problem is:
i call &quot;findDiv&quot; at the bottom of the Actions in the first frame of the _root.
of the movie, everything loads up and works fine on the php page in the browser
when i put in the addy

or

the MCs &quot;external_upper and lower&quot; load into the holders just fine and play and are fully functional.
whenever i click on one of the divisions, however, thus creating something similar to:


the next movie comes up as before, but i cant seem to get the

_root.myPath.gotoAndPlay(_root.myFrame);

to work. the movie sits blank.
i put a variable declaration on frame 1 of &quot;external_upper.swf&quot;

_root.iAmHere=&quot;I am here&quot;;

and used a dynamic text field in the main movie to verify that the movie is loaded
and it displays the variable, but the movie still just sits there blank.
in another MC i put 2 frames with a statement

_root.frameNumber=_root.myPath._currentframe;

which normally shows up properly until &quot;divid&quot; has a value.
then it just displays &quot;1&quot;

i have been at this for hours, trying to find the problem, and have a deadline coming very soon. This of course, is about the last thing i have to do with the movies, is get them working with the loadMovie function to make the user experience more smooth and efficient.
i am positive that is should work by the methods and syntax. every test i can come up with gives me no lead as to why this wont work. I know that the MCs are loading into the containers properly, and have reported
their paths with _target. I am wondering, for some reason do i have to eval() the framelabel '_root.myFrameLabel'
because i am loading the movies or something?
although if i do this normally, it gives me a blank variable '_root.myFrameLabel'.

At a complete loss and your humble servant. Please help
thanks for your time all!

Paul
 
thank for your time to anyone who read the post, i abandoned loading those two MCs in favor of a couple others that didn't require the same MC control, but were comparable in file size....
thanks again

cheers
paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top