Swf within a Swf scoring issue

I've created a flash file (my project) that is loaded into another swf (our player) file on our site. When I test the project file on my computer the scoring displays correct at the end of the lab. When it is loaded into our  swf player on the site the score doesn't display. I'm at a lose for why this is happening. If someone could provide me with some direction I would be very thankful.
// Declare variable
var numOfCorrect:int = 0;
// Every time someone click the correct selection it adds one to the score
function correct(e:MouseEvent):void{
     numOfCorrect++;
//I have a text box with the name yourScore
yourScore.text = numOfCorrect + " out of 5";
It is very basic code so I have no idea what is isn't working. My only guess is there is some kind of conflict once it is loaded into an external swf. What would I do in this case? Thanks.

I seemed to have figured it out. I changed the text box from TLF Text to Classic Text and selected Dynamic Text. Also changed the Actionscript up a little.
instead of just:
yourScore.text = numOfCorrect + " out of 5");
i did:
addEventListener(Event.ENTER_FRAME, displayFinalScore);
function displayFinalScore(event:Event){
    yourScore.text = String(numOfCorrect + " out of 5");
Not sure which of these things fixed the issue but it is working now. Thanks for the help though! Now I just need to figure out the issue with the drag and drop.

Similar Messages

  • Using AS 3.0 to create a popup .swf within an .swf

    Hi,
    I need to have an .swf running for a game.  Within this .swf there will be a "Help" button, which, when clicked, needs to create a new popup window from a different .swf file. The second .swf file must appear in a new window, in a separate popup, and not replace anything in the first .swf window.
    I want to know how to do this in ActionScript 3.0. I don't need help with the button click event, but I do need help on how to make the popup appear.  Any advice?
    Thanks.

    use
    navigateToURL(new URLRequest("yourswf.swf"));

  • A swf within a swf

    Hi,
    Hopefully someone can help me with this...
    I would like to embed a swf (call it swf 1) within my captivate 5.5 project (swf 2), but the catch is that swf 1 is interactive.  More specifically there are pause points within the course where learners need to play around with roll-overs or other features before clicking a button to resume.  There are a number of swfs going into swf 2, but I thought it best to focus on one for now.
    The idea is to publish the main project (swf 2) with a skin and TOC and to be able to control progress all progress, including the progress within swf 1, using the playbar from swf 2 - i.e. if I click on the playbar at a certain point, it should take me to that point even if it is half way through swf 1.
    I know how to add an animation to a slide and synchronise it with the project so that I can get that kind of playbar functionality.  However, this only works if swf 1 plays from end to end without any interactivity.  It doesn't seem to work when swf 1 pauses in the middle (in fact swf 1 barely even starts, before it vanishes again, leaving me watching the background of the slide that it was on).  Alternatively, if I don't synchronise it, then the main project will continue on to the next slide regardless of whether swf 2 has finished or not.
    So, the question is, how can I insert an interactive swf into the main project, synchronise it and retain the interactivity?  Any helpful, not too technical suggestions?
    Thanks.

    You won't be able to achieve this in Captivate without having advanced ActionScript 3 coding skills.
    You are better advised to find another way of delivering the effect you want that does NOT involve nested SWFs.

  • Inserting swf within a swf

    I am creating a Captivate project, basically, as a shell with
    5 slides. Within each slide, I would like to insert swfs that I
    have previously published. As a result, each of the 5 slides will
    play while the embedded/inserted swf plays within. Have you ever
    tried to do this? It seems to work only if I don't include a
    skin--but I would like to include a skin on each of the swfs that I
    have inserted.
    Any ideas? Thank you.

    quote:
    Originally posted by:
    jdmosley
    How do you revert a project back to Captivate 3 when you hit
    a Captivate 4 limitation? Is there a simple way? I made a ton of
    changes in Captivate 4 and don't want to have to re-do them with
    the previously saved Cap3 version of the project. Thanks!
    You could copy/paste the slides from CP4 to CP3 - we just did
    that with a project. It doesn't retain all the slides settings (I
    think the buttons / goto slide etc) needed to be configured again,
    but it still beats having to redo the project from scratch in CP3
    ;o)
    quote:
    Originally posted by:
    isv2009
    Thanks for your reply.
    It seems to work whenever the embedded swf does not have a
    skin... and not work with a skin on it. Have you tried both cases?
    Sorry no I haven't tried this with swf's with skin. I just
    saw that your original question actually stated that, but I missed
    that part. I would imagine that a skin with a second playbar could
    mess things up in Captivate.
    If you have Flash skills an idea could be to make a simple
    "loader shell" which loads the animation you wish to import. That
    way the levels of the two playbars would be seperated even more and
    perhaps it would work.
    /Michael

  • Swf within a swf

    So I've been nesting a lot of MCs within each other.
    What I want to do is have a basic "image gallery," so to speak, that links to about 6 other SWFs I already have made. For the life of me I cannot think of how to do this properly.
    The main thing is the button and the goto function. Is that even the right function?
    Hopefully someone understands. This is time sensitive. Thanks.

    I don't know if it matters, but I would avoid capitalizing Event in... Event:MouseEvent
    because Event is a class just like MouseEvent
    I get the impression you are using the UILoader component--fair warning, I tend to avoid using components, so I can only reference the help files to try tio help.  If you mean that code is not working for you, then I think you have to use the load method to actually load what you identify as the source.
    var swf:Array = new Array("flash1.swf", "flash2.swf", "flash3.swf")
    obama_btn.addEventListener(MouseEvent.CLICK, obama);
    function obama(Event:MouseEvent):void
        media_mc.source = swf[0];
         media_mc.load();
    You may be able to replace those two lines in the function with...
    media_mc.load(new URLRequest(swf[0]));

  • Open a swf within a swf

    Hi.
    A long standing client has requested that I create a fully
    flash website to replace the site I created for them a few years
    ago. I naively agreed, with quite a limited flash knowledge.
    I can create the site as one flat file, but the initial
    preloader would be loading the entire site which would take ages.
    So I thought that if I have each section of the site on its own swf
    file, I could open each one from within the initial flash site.
    This means it would be loaded as an external entity if you like,
    and the initial preloader would not load it which is the desired
    result. Am I right? How do I do it? please say if i've lost you
    with the above!!
    STeve

    all you want is the loadMovie command - search the help docs,
    this forum, or google - it's been used
    for so long - oh and these tutorials:
    http://www.kirupa.com/developer/mx/full_site.htm
    http://www.kirupa.com/developer/flash8/best_structure_flash_site.htm
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    StevoUK wrote:
    > Hi.
    >
    > A long standing client has requested that I create a
    fully flash website to
    > replace the site I created for them a few years ago. I
    naively agreed, with
    > quite a limited flash knowledge.
    >
    > I can create the site as one flat file, but the initial
    preloader would be
    > loading the entire site which would take ages. So I
    thought that if I have each
    > section of the site on its own swf file, I could open
    each one from within the
    > initial flash site. This means it would be loaded as an
    external entity if you
    > like, and the initial preloader would not load it which
    is the desired result.
    > Am I right? How do I do it? please say if i've lost you
    with the above!!
    >
    > STeve
    >

  • External swf within external swf?

    Hello..
    I'm currently playing with a music player template that loads
    the songs as external swf files.
    Is it now possible to load this music player as an external
    swf into my main flash website? So far I've managed to get it
    loading in the right place, but then the songs don't play. :( If
    there's anything crucial I need to know, please enlighten me, or I
    can stick some code up here if it's perhaps not so obvious.
    Cheers
    x

    Hey!
    If you can play the song from the music player independently
    but not while the music player is external: I'm going to go ahead
    and say you're hitting a security issue.
    I'm going to do some research then I'll post back here.
    Thanks,
    John
    edit: try this
    http://www.adobe.com/devnet/flash/articles/fplayer_security_04.html

  • Print button - captivate swf within falsh swf

    Hi I have a nice problem and I hope someone might have an
    answer for me.
    I am making an interactive tool book. The design,
    backgrounds, button etc are all in flash. I have also done a quiz
    in captivate which has a bank of 50 questions but only 20 random
    ones appear each time you do the quiz.
    As you cannot import a random quiz captivate file into flash
    I have made a movie clip titled container that the captivate quiz
    swf. file loads into. This all works without a problem. However I
    have to make a print button also in flash so the user can print
    their result page (the result page is apart of the captivate file).
    I have tried every print Action script I can think of;
    however, none of them print the results. The page prints with all
    the flash created objects (background, buttons etc) but it will not
    print the end results page that appears in the movie clip titled:
    container, which is located in the middle of the flash stage.
    Although if I click print in the flash player file menu it
    does......
    Can anyone help me or have I confused you all??
    From Sez

    Markus,
    I use "this." in the Actionscript, but I don't think that's the problem. In the attached file you'll see my problem.
    Downloadable from:
    http://www.dorna.nl/captivate_widgets/example_passing_variables_cp4.zip
    http://www.dorna.nl/captivate_widgets/example_passing_variables_cp4.zip

  • Putting a swf within a swf

    A friend of mine told me that I can take and create a swf
    file and then pull it onto another swf file (ex: creating a swf for
    the buttons and then the pages) he said that I needed to use action
    script and to create a container for the other swf to load into? I
    can't get a hold of him and was wondering if anyone could provide
    some help.

    Mr. Ocean wrote:
    > A friend of mine told me that I can take and create a
    swf file and then pull it
    > onto another swf file (ex: creating a swf for the
    buttons and then the pages)
    > he said that I needed to use action script and to create
    a container for the
    > other swf to load into? I can't get a hold of him and
    was wondering if anyone
    > could provide some help.
    check loadmovie and loadmovienum in your help files for
    details on usage of these
    actions.
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Possible to make embedded swf (in another swf) fill browser?

    I have an .swf which is set at 100x100 percent and fills the
    browser window. I have an embedded .swf within this .swf, and I
    would like to be able to have the embedded .swf fill the browser
    window and remain fluid (for different screen resolutions). This
    has to be done from the embedded .swf.
    I thought if I could retrieve the stage details of the parent
    .swf from within the embedded .swf, then I could use these to
    resize the embedded .swf - but I haven't been able to do this.
    I'm plum out of ideas. Can anybody give me any pointers?
    Many thanks.

    I may have my terminology mixed up. I have a pre-compiled
    .swf that allows embedding of .swf's from a seperate .xml file via
    a LocalConnection API.

  • Saving/Printing work from within a .swf file

    Okay so here's the deal. I have to create a flash game in
    which users will be creating artwork. When users are done with
    their artwork we want them to be able to SAVE their work, EMAIL it
    to a friend, and PRINT it out all within the .swf file.
    HOW IN THE WORLD DO YOU DO THIS?????? I have been searching a
    researching and going through many forums and tutorials trying to
    see if anyone out there can help but I have come up with nothing.
    Although I did come a across a website that was able to achieve
    what we are looking to do in this flash game.
    Click here to view
    Snowflake Website
    On this website users can make snowflake art the old fashion
    way but this time on the web within a flash site. When users are
    satisfied with their snowflake they can save it and the snowflake
    is added to an ever growing database of user created snowflakes
    that also can be viewed by others at anytime. Users are also given
    the option of emailing their snowflake design to friends and
    downloading their design as a JPEG or and EPS file. You can also do
    the same to any of other numerous snowflake designs with the
    snowflake design database.
    HOW IN THE WORLD DO YOU DO THIS??? I have contacted the
    agency that was responsible for creating this site for their help
    as well but any assistance I can get from you guys would be greatly
    appreciated as well.
    Still quite confused but eagerly awaiting your
    responses.

    Printing object:
    on (release) {
    //creates the object of the class printjob
    var pj:PrintJob = new PrintJob();
    //starts the procedure
    //opens the windows printing window
    pj.start();
    //sets the printing area (i may be made outside the stage,
    so using the A4 area and adding any other information that should
    not appear on screen)
    area = {xMin:0, yMin:28, xMax:465, yMax:296};
    //printing options - true=bitmap / false-=vetor... bitmap
    generates a bigger file, but results in better quality for images,
    vector is smaller and a good option if you work just with text
    options = {printAsBitmap:true};
    //adds the page the the printing queue
    pj.addPage(_root, area, options, null);
    //sends the page to the printer
    pj.send();
    //deletes the object to clear memory (very important)
    delete pj;

  • How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???

    I have the following situation
    MainMove.swf is doing a loadmovie of SecondMovie.swf
    The Button that loads SecondMovie.swf also disables other buttons in MainMovie.swf
    on (release) {
        _root.intro_btn.enabled = false;
        loadMovieNum("SecondMovie.swf", 2);
    How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???
    Using AS2 is this current project
    Thanks

    lol Sorry bout that I'm brand new here and was looking for the option to remove the post from the other location.

  • Call a external SWF by press the button within another SWF file but the second SWF file play Externely

    Hello Guyz.
    i am working on Macromedia Flash 8 and i just want to call a external SWF when i press the button within another SWF file.......but the second SWF file play Externely............can any one knows the code.... AS2

    try this
    http://www.actionscript.org/forums/showthread.php3?s=&threadid=28123

  • Embedd a database within a SWF?

    Hi -
    I'm wondering if the following can be done with Flash -
    - can a swf contain it's own database that the user can add,
    delete, read?
    - while the view is online, entering and interacting with the
    data- is it being sent back and forth to the server?
    - can this database be protected with some sort of encryption
    that is only unlocked by the user's code?
    - and so that if the user emailed the swf or the db file from
    within the swf, only a person with the key could access the data?
    Can it be done?
    Can someone point me to how to these features might be
    possible with Flash?
    TIA your input,
    jl

    Hi,
    1.- SWF files cannot contain their own databases but they can
    access several server side scripts to mantain/modify a server side
    database.
    2.- Yes the interaction with the database occurs without the
    user having to take notice.
    3.- You can use any type of session protection wih
    authentication to protect your data.
    4.- SWF are like HTML or plain text (anyone can find a way to
    read it) so I'd recomend using server side authentication rather
    than relying on swf key protection.
    Cheers,
    Gorka
    http://www.AquiGorka.com/blog

  • Creating an SWF to play within an SWF

    Basically I need to be able to play an SWF file within an SWF
    project. The project contains a layout of different navigational
    buttons. I wish for one of the buttons to go to a frame containing
    an older SWF project I created.
    Please help if you can.

    Even if the SWF played directly on the timeline it would
    still be ok. As long as you were able to alter it's X and Y
    positions. ( I really don't care too much about playing AS2 SWF's
    eather. I'm more concerned about AS3. Out with the old and in with
    the new)

Maybe you are looking for

  • FCP 6 - getting Sequence to conform to clips

    FCP 6.0.6 imported a folder full of images into a brand new sequence. getting red in TL manually conformed Sequence to "clips" (still images with dur of 2 secs) Ive read that drag and drop (a clip to the sequence icon) in the browser or the TL should

  • Trouble displaying thumb nails in Elements 9

    Hi, I have been uploading pictures fine, and they have been displayed as thumbnails in the organiser. Now, where the thumbnail of the raw file should be, there is just the timer sign. When I double click, the picture is there, its just that I can't s

  • Want to remove iteration in this query

    below mention query is showing results ok but problem is i have used iteration due to this it will slow down many many times if no. of transactions increases can i use this query without iteration please help me out? select SNO,NDATE,SERIALNO,LOCATIO

  • To display 01 to 10 using select query

    Hi all, using select query... In where clause..., If u give 1 to 9 it should display 01 to 09 and If u give 10 it should display as 10. I want it in a single query . Thanks & Regards, Hariharan ST.

  • Debugging in the forms

    Can anyone help me out in debugging a form. I mean I want it to know when (for e.g.'OK') button pressed what does happens in the database side. What tables get populated and what other things happend in the database. How would I know all these things