Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Recording trial-based responses from Flash (case 434)

  1. #1

    Recording trial-based responses from Flash (case 434)

    Hi,

    I'm fairly new to both MediaLab and DirectRT. I'm using the 2008 version of both softwares.

    After browsing through the help files, I have some questions regarding the use of Flash files (SWF) in my experiment.
    First of all, I would like to know if it's possible to embed Flash files in DirectRT, because my experiment is trial-based and I prefer to use DirectRT.
    As far as I know, I can only do this in MediaLab... right?

    Assuming I have to use MediaLab for this, I would very much like to know:
    1. What types of communication are possible between a Flash movie and MediaLab? My subjects will perform a Flash-based visual task and I want to record their responses, as well as their response time.
    2. Each subject will perform many trials, repeating the same Flash-based visual task. Can MediaLab handle trial-based results?

    Thank you, Ziv

  2. #2
    jarvis24 Blair Jarvis, Administrator
    You are correct that DirectRT doesn't do Flash yet. MediaLab can handle it but capturing the data from Flash is trickier. Are you able to post data from Flash to a URL--e.g., sending a web browser a command to go to some URL with some optional arguments? If so, MediaLab could probably intercept the data from those data postings / commands to the browser. Does that make any sense?

  3. #3
    Yes it makes sense. If I'm able to post the URL data from Flash, how do I record this in MediaLab? Thanks.

  4. #4
    jarvis24 Blair Jarvis, Administrator
    First take a look at the section on Custom Items in the user's guide. If you can embed a flash file within a custom item (e.g., an HTML page) and have it execute a post command, then MediaLab can probably intercept whatever data you like. Take a look at the samples too--then if you have any questions be sure to let me know! I'd be curious to see if you could pull this off--would be very cool.

  5. #5
    Hi Blair,

    I appreciate your advice so far.

    Ok, so I've managed to embed a Flash-based visual-task file inside a Custom Item (HTML file), and have it re-load the page with a POST request containing the appropriate variables (I have 2 of them in each Flash-based trial: "xPos" & "Side"). Doing this outside of MediaLab, in the latest versions of Chrome or Firefox for example, works perfectly, and I can see both variables showing up as $_POST variables in a PHP echo.

    However, when running a questionnaire in MediaLab 2008, I encounter 2 serious problems:
    1. MediaLab keeps crashing (100% of the times) right after the POST submit (even though it first notifies me to "Please inform the experimenter that you have completed this portion of the session").
    2. Looking at the results table in Excel, I see the variable *names* showing up instead of their *values*. So it doesn't seem to be intercepting the data.

    I suspect the first problem has to do with MediaLab's built-in IE browser. Is it possible to force the questionnaire to load my HTML in a different browser?

    I'm also attaching the questionnaire file I'm using. I'd be grateful if you could take a look at it and tell me what I'm doing wrong.

    - Thanks, Ziv

  6. #6
    Nevermind, I solved it! :)
    Instead of having the Flash script itself initiate a POST request, it's now passing the parameters to the client-side JS, and that code submits a hidden form.

  7. #7
    zlevin, as a Flash guy myself, I'd appreciate any code or source files you're willing to share. I imagine I'll be doing this in the near future.

    my email is
    sdavis at mays dot tamu dot edu