Hi,

I have a on the stage in Director two puppetsprites each containing a
#flash-member; one of the sprites is a menu that depending on what item is
clicke loads the acutal content #flash-member in the other sprite. I also
have a handler that activates a certain "page" in the content #flash-member,
this is done kinda like this:

the menu #flash:

function sendSomething(inVar) {
        getURL(getURL("event: getParamFromSub,\"" + varChapter + "\", \"" +
varPage + "\"")
}

triggers a frame-handler that recieves and takes care of the actions that
needs to be done in Director; loads a new member into the sprite and so on
and when that is done I want to send the avove "varPage" to the newly loaded
content #flash member and direct it to the correct "page", something like
this:

on setPage (whatPage)
        flaRoot = sprite(3).getVariable("_root",FALSE)
        flaRoot.gotoActivePage(whatPage)
        flaRoot = ""
end

Of couse there is a function in flash that recieves this and takes action
according to conditions... NOW this works FINE as long as the functions gets
triggered from a mouse click, but when I try to trigger the setPage-handler
(whitout using the menu #flash function) by just triggering it from inside
my Director-movie WITHOUT mouse-clicks it does not respond at all... except
from when I first start the movie.

Parts of the actual code is below... What I can not seem to understand is
why the last flash-function gets triggered when the command comes from a
mouse-click within the first flash, but not when I try to trigger it with
just code... Anyone??? Please? HELP...

//Kristian


-- MENU #FLASH MEMBER - sends this...
function setActiveSubLevel(var_subLevel,var_contentPage) {
        _root.collapseMenu1();
        arrayMC_subName[var_subLevel].gotoAndStop(5);
        sendSubLink = (arrayMC_subLink[var_subLevel]);
        if (sendSubLink != "") {
                getURL("event: getParamFromSub,\"" + sendSubLink + "\", \""
+ var_contentPage + "\"");
        }
}


-- FRAME SCRIPT IN DIRECTOR RECIEVES AND PASSES ON...
on getParamFromSub me, subMenuID, conPageID
  respondToParamFromSub(subMenuID, conPageID)
end getParamFromSub


-- ACTUAL HANDLER IN DIRECTOR TAKES CARE OF BUSINESS...
on respondToParamFromSub(subSectionID, contentPageID)
        member(gContentMemberName & gActiveMemberList.aTopItem &
gActiveMemberList.aSubMain).unload()
        gActiveMemberList.aSubMain = subSectionID
        gActiveMemberList.aSubSub = ""
        member(gContentMemberName & gActiveMemberList.aTopItem &
subSectionID).preload()
        sprite(3).member = member(gContentMemberName &
gActiveMemberList.aTopItem & subSectionID, "contentCast")
        if (member(gContentMemberName & gActiveMemberList.aTopItem &
subSectionID, "contentCast").loaded) then
                flaSetActiveConPage(contentPageID)
        end if
end


-- DIRECTOR HANDLER THAT TALKS TO THE CONTENT #FLASH MEMBER
on flaSetActiveConPage(conPage)
  updatestage
  flaRoot = sprite(3).getVariable("_root",FALSE)
  flaRoot.gotoActiveContentPage(conPage)
  flaRoot = ""
end


-- FUNCTION THAT RECIEVES THE PARAM FROM DIRECTOR AND GOES TO THE FRAME
function gotoActiveContentPage(pageID){
        for (i = 0; i < arr_getPageID.length; i++) {
                if ((arr_getPageID[i] == pageID)) {
                        MC_ch10.gotoAndStop(arr_getPageNum[i]);
                }
        }
}


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to