Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 29
  1. #1
    Join Date
    Jul 2001
    Posts
    17

    Grin Flash Button Opens Mult. Instances of Prog.

    When I try to open a program on my desktop via an AMS flash object, it opens two instances of the prog. Not good.

    To start, I created a simple flash btn with the action script code:
    Code:
    On (release){
         fscommand("test")
    }
    Next, I put the Flash object on an AMS page and added the actions to get the property variable for the fscommand command. Next I used an IF statement to check the property 'On Fscommand.' If it matched the IF, I ran an Open.File on a path leading to the Access database file (in this case).

    I've tried variations like placing a RETURN statement following the Open.File action, changing the property variable immediately following the Open.File command, placed a pause after the get.property command etc. - But it seems the fscommand is firing more than once at a single click of the button.

    Two methods produced the desired result:
    1) I placed a message box just after the get.property command line in the code. That seems to hang the execution long enough to keep the flash from sending the message twice...

    2) If I move the mouse out away from the button 'hot spot' immediately after clicking it.

    Any insight appreciated.

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. I'd have to see your flash and AMS files to say for sure. If your Flash is firing an FScommand more than once then the problem is in the flash. AMS will not detect a single FSCommand as more than one, I have tested the daylights out of it and it works perfectly in this regard.

    In terms of your AMS no need for the IF statement in this case. Just put a file open action in the OnFScommand event. One single action, no room for errors. Try that and let me know how it goes.

    One more question, what happens when you double click your database file in Windows explorer?

    Corey Milner
    Creative Director, Indigo Rose Software

  3. #3
    Join Date
    Jul 2001
    Posts
    17
    What I'm trying to achieve is an AMS menu that will sit on the desktop and open various progs on the PC. It consists of a single Flash object containing multiple buttons designed within Flash.

    The buttons have a simple Flash Action Script code (as described earlier) placed on each button instance, on the root timeline, that produces an fscommand string like "a1" "a2" "a3" etc. Each has text in the Up button frame, and a colored background in the Over button frame. During AMS runtime, I notice that the colored background stays lit momentarily after mouse release - don't know if this is relevant. When I throw a Message box in between the get.Property and open.File statements, the pause caused by the text box lets the Flash button return to its Up state before the open.File command is sent - and only one instance of the prog opens (is there a correlation?) Same thing when I click on the button and quickly move the mouse away from the 'hot spot.'

    To answer your question, when I put the open.File action alone with the OnFScommand event, it works. Only one instance opens. Once I start to add multiple IF statements to account for the various buttons - trouble.
    Also, opening the .mdb / .mde files directly, through desktop '.lnk' shortcuts etc. in Explorer, Commander or whathaveyou always only opens one instance.

    Here's the AMS code:

    Code:
    <IR_ACTIONS_LIST>
    <Action name="Get Property">
    <Type>98</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Property%</Variable>
    <ObjectName>Flash1</ObjectName>
    <Property>Last FSCommand</Property>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%Property% = "quit"</Condition>
    </Action>
    <Action name="Exit">
    <Type>2</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%Property% = "a4"</Condition>
    </Action>
    <Action name="Open">
    <Type>7</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>V:\testFile\FileA.mdb</FileName>
    <Verb>open</Verb>
    <WorkingDir/>
    <RunMode>0</RunMode>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%Property% = "a5"</Condition>
    </Action>
    <Action name="Open">
    <Type>7</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>V:\testFile\FileB.mdb</FileName>
    <Verb>open</Verb>
    <WorkingDir/>
    <RunMode>0</RunMode>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%Property% = "a6"</Condition>
    </Action>
    <Action name="Open">
    <Type>7</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>V:\testFile\FileC.mdb</FileName>
    <Verb>open</Verb>
    <WorkingDir/>
    <RunMode>0</RunMode>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    </IR_ACTIONS_LIST>
    (by the way, thanks for the quick reply)

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    OK well we have isolated the problem then at least, your IF syntax. Should be easy to fix. If you want me to check out your code just upload your project here using the file attachment feature. Other than that the only thing I can offer is this:

    http://www.autoplaystudio.com/webhel...ructure.IF.htm

    Corey Milner
    Creative Director, Indigo Rose Software

  5. #5
    Join Date
    Jul 2001
    Posts
    17
    I'll simplify it:

    Code:
    %Property%=FlashObject[Flash1].GetProperty ("Last FSCommand")
    IF (%Property%="quit")
    Application.Exit
    END IF
    IF (%Property%="a1")
    File.Open (open, "V:\TestFile\FileA.mdb")
    END IF
    IF (%Property%="a2")
    File.Open (open, "V:\TestFile\FileB.mdb")
    END IF
    IF (%Property%="a3")
    File.Open (open, "V:\TestFile\FileC.mdb")
    END IF
    Seems pretty straightforward. Am I missing something obvious?

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    As I mentioned I can only check your code if you upload a file.

    Corey Milner
    Creative Director, Indigo Rose Software

  7. #7
    Join Date
    Jul 2001
    Posts
    17
    Umm... okay.

    Exactly what part(s) of it would you like?
    Everything in the distribution folder?
    The .am4 file & resources folder?

    Zipped?

  8. #8
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Whatever you prefer. Limit is 750K. If I can't see your code in play I can't really say what's going wrong...

    Corey Milner
    Creative Director, Indigo Rose Software

  9. #9
    Join Date
    Jul 2001
    Posts
    17
    Alright, here's the .am4 file.

    (The only code is just what I typed earlier - verbatim).

    By the way, .am4 files aren't allowed, only .am5 (??).
    I've zipped it.
    Attached Files

  10. #10
    Join Date
    Jul 2001
    Posts
    17
    ...and this problem seemed so elementary.

    Having any luck?

  11. #11
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Not sure. IF syntax looks OK at a glance. I have no experience with .mdb files so I can't say what's going on for sure... Sorry.

    Corey Milner
    Creative Director, Indigo Rose Software

  12. #12
    Join Date
    Jul 2001
    Posts
    17
    Don't sweat it. In your earlier quote you'd seemed confident that the IF syntax was the culprit, so I was crossing my fingers.

    I've created, VB-coded, and maintain seven Access databases at work (not my primary job!) for automated report generation, personnel tracking, training etc. I've also written a fair amount of action script for Flash(5), used as both stand-alone projectors and incorporated into Access. So you can understand the vested interest in finding programs compatible with Access & Flash.

    I tried AMS over two years ago and was favorably impressed, but was more focused on the above progs at that time. Now that I've developed the content, I'm looking to author training CDs for new employees - AMS came to mind. Ideally, I'd prefer to show my bosses a functioning demo of AMS when I hand them the software requisition paperwork. I've got about 18 days left on the trial versions (home/work).

    The problem I've detailed occurs on both W2K OS machines. In further testing today, I found the mult. instances issue - while intermittent - happens on both Access .mdb/.mde files *and* .exe files. I recreated a *simple* Flash button on a trial version of MX, and exported as both vers. 5 and vers. 6 - same problem.

    I've included a .jpg of the button from Flash.
    Has no one else experienced this?
    Attached Images

  13. #13
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    If I create a flash button here with an fscommand which I use to trigger a File.Open action on an .exe file I get only one instance of the file opening. This is consistent with the experience all our users have. If you are getting different results then it's an issue on your end...

    If you post your files I can take a look. But obviously you need to post all files related to your question, this would include your flash .fla, flash .swf, and intact AMS project otherwise it would be impossible for me to assess the situation. Posting screencaps of code doesn't allow me to actually see or test any of the code...

    Corey Milner
    Creative Director, Indigo Rose Software

  14. #14
    Join Date
    Jul 2001
    Posts
    17
    Understood. When you said, 'whatever you like' earlier, I wondered if the code alone would suffice.

    Due to the upload limit, I'll send the autorun.exe separately...

  15. #15
    Join Date
    Jul 2001
    Posts
    17
    ...and the exe...

    Thanks.

Page 1 of 2 1 2 LastLast

Posting Permissions

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