A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: tips needed for coding within Movieclips

  1. #1
    Member
    Join Date
    Jun 2005
    Posts
    60

    tips needed for coding within Movieclips

    This is hard for me to explain...(I am awful at terminology so please be patient)

    I'm creating a tutorial in flash. Each lesson is its own .swf file. Each lesson has about 5 slides. These slides are movie clips in each frame on the main timeline. (main timeline is then 5 frames long...etc)

    Before the user can continue through the site, they HAVE to get through this tutorial. I have it so at the last frame within this last movieclip (slide of tutorial) it sends that it's been completed to a server-side script. Then the main .swf, the menu with all the lessons receives this info and knows the tutorial has been watched. Done. fine. works. yay.

    (that was just background - here's the question)

    The user can cheat and click next (which takes them to the next slide) until they get to that last slide and it will send the info... I need to get make sure this doesn't happen....

    Here are some ideas I have, but I'm not sure how to implement...

    1. within each movie clip I can use a frame (3/4 through) that makes some variable true and then once it reaches that last frame in the last mc then it will check if all these variables are true before sending the info.

    problem with 1. can i place the as3 code in that single frame of a mc so that it can be read in another mc. I guess my problem is communicating between mc's without having to make a separate class that these both can communicate with.

    2. make a as3 class that deals with it... but then id have to create an instance in each of these frames within each of these mc's...and another one in that last frame that can then read from the class... I suppose I can do this but I'd like to avoid this solution...

    3. (my favorite) is there a way I can make 1 class that knows the total number of frames (including those that in the movieclips) and then just proceed that way.

    I like this best because I can use the same class that deals with the server side stuff and just create another method that deals with knowing if the user has seen all the frames... (it needs to not count extra if the user looks at a slide over again)

    If you got this far and are willing to help. Thank you very much! if you have questions about what I'm trying to ask.. please ask... sometimes I'm pretty lame at explaining what I am looking for

    saura

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    Just removeEventListener on the next button until they've done what you want them do.

    ie, if you need them to tick a correct answer than removeEventListener from the nextbutton when you first come to that section, and when they do the correct answer addEventListener.

  3. #3
    Member
    Join Date
    Jun 2005
    Posts
    60
    That wouldn't work because it's not a quiz or anything like that... it's just a matter of whether or not they've viewed the lessons.. I mean technically they could leave it on and walk away from the computer and come back and it would be fine... the program will think they've watched it... but I can't prevent them from doing that either.

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    People hate those forced view things. Your user is going to be seriously cranky at you, regardless how well intentioned your motives. (And what if they accidentally navigate away from the page? Or come back to the site a second time?)

    That said, you can use the timer class to add and remove the eventlistener.

  5. #5
    Member
    Join Date
    Jun 2005
    Posts
    60
    If they navigate away - we have a database that has the users information and what they've viewed so that it will remember if they've seen it already.

    btw this is for research and these people (at the end probably 200 ppl) are getting paid to go through this site. It's not open to the public.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center