Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2004
    Location
    Portugal
    Posts
    53

    Another tough one... Interaction between Web and AMS

    Hi!

    My project interacts with online wizards (which make it easier for me to update certain parts of it). Imagine I load a certain page setup.asp, which retrieves a certain amount of fields from a database and then prints them in a page.

    I've seen schemes that allow offline/online component interaction. One of them is the Windows Digital Rights Management. Whenever you are playing protected content, Windows Media Player pops up a window with an embed browser and goes to a license download page.

    Here the producer can - for example - authenticate, bla bla. When all that is done, a Javascript system stores a variable X with the license key and then calls a WMP function StoreLicense().

    I would like to know if we can have an offline function embed in Autoplay Media Studio, which can be called from a webpage.

    Thanks again... I know my questions always involve external components, but they do increase potential in AMS

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    If the web object is inside AMS, then no problem.
    Attached Files

  3. #3
    Join Date
    Jan 2004
    Location
    Portugal
    Posts
    53
    Hm... You really can't stop surprising me

    But can you use functions? For example, if I want to pass a variable from the ASP script...

    In DRM, I'd use StoreLicense(x)... In here I can't do that, can I?


    Thanks again
    Last edited by Agent Jones; 08-09-2005 at 03:18 PM. Reason: Added a question

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    There are a several ways to go about it, but it's still the same concept. Get the information in the URL so you can detect it in the On Navigate.

    Type something in the textbox and click the button. The javascript navigates to a bookmark which lets AMS detect the navigation. The by checking the URL we can pass the info needed into AMS.
    Attached Files

  5. #5
    Join Date
    Jan 2004
    Location
    Portugal
    Posts
    53
    OK... That's good. It only allows me to pass one variable (or I think so, but I should've learned that nothing's impossible with AMS :P ), but that's all I need.

    Thanks

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Depending one what you're doing you can pass several pieces of information in a URL. Using that data you can easliy "trigger" any sort of ASP/PHP functions, etc. Using a switch function in PHP is a great way to route functions, I'm not sure what the ASP equivalent is though...

  7. #7
    Join Date
    Jan 2004
    Location
    Portugal
    Posts
    53
    Quote Originally Posted by Corey
    Depending one what you're doing you can pass several pieces of information in a URL. Using that data you can easliy "trigger" any sort of ASP/PHP functions, etc. Using a switch function in PHP is a great way to route functions, I'm not sure what the ASP equivalent is though...
    Thanks for replying.

    I know both ASP and PHP, but I'm using ASP because fewer people know it - making exploits harder to find

    If I understood you well, your suggestion refers to sending data from AMS to the online script... That's the easy part What I was asking for was a way to trigger functions embed in the AMS project from the web script...

    Code:
    <body onload="AMSFunction()">
    Worm has presented a very nice solution, which I am now exploring... I think I can work with it

    Again, thanks to you both.

  8. #8
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    You can also do that without javascript. Using a refresh meta-tag or named anchor link one can also trigger functions, i.e. index.html#video or index.html#audio and so forth.

  9. #9
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Quote Originally Posted by Agent Jones
    It only allows me to pass one variable
    The example I did does only sent one variable, but I did that to make it a bit easier. To send more than one variable, use a delimiter in the URL (i.e. test2.htm#variable1:variable2:variable3:variable4)

    You could use the existing code in the AMS app I uploaded to get the string of variables, then use the DelimitedStringToTable function (found in your Gallery) to load them into a table for easy processing.

  10. #10
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Here's another thread that has been developing into an interesting Web/AMS interaction project.

    http://www.indigorose.com/forums/showthread.php?t=12414

  11. #11
    Join Date
    Jan 2004
    Location
    Portugal
    Posts
    53
    Sorry to "bump" this thread again, but I have a question:

    You probably have noticed that I created two threads: one of them asked about the "animated popups" and the other one asked about "interaction between web objects and AMS". Well, it happens that I need to combine both: I need one of those oIE (InternetExplorer.Application Object) to interact with AMS.

    I tried to follow the same scheme, but I can't trigger the onNavigate... I know oIE has a simmillar trigger, but I can't use it... Have a look:

    Code:
    if oIE then
    	blnWait=true;
    	blnAnimatePopupUp=false;
    	blnAnumatePopupDown = false;
    	nWait = 0;
    	oIE.Quit(nil)
    end
    	
    --Create an Instance of IE 
    oIE=luacom.CreateObject("InternetExplorer.Application.1") 
    	
    if oIE.NavigateComplete then
    	e_URL = oIE.LocationURL;
    	nPos = String.Find(e_URL, "#VISIT", 1, false)
    	if nPos > -1 then
    		Dialog.Message("Test","Good");
    	end
    end
    	
    --Navigate to this Website 
    oIE:Navigate("http://gsantos.santanhosting.com/assistant/operations/remind.php?days="..dias) 
    	
    while oIE.Busy do
    --wait for navigation to complete
    end
    	
    --set the menu, adddres, and toolbar to off 
    oIE.Menubar = false; 
    oIE.AddressBar = false; 
    oIE.ToolBar = false; 
    oIE.StatusBar = false; 
    oIE.TitleBar = false;	
    
    nWidth = 255
    nHeight = 338
    oIE.Width = nWidth
    oIE.Height = nHeight
    
    oIE.FullScreen = false;
    oIE.Resizable = false;
    
    --Remove the title bar
    n = DLL.CallFunction(_SystemFolder.."\\User32.dll", "SetWindowLongA", oIE.hWnd..",-16,109314048", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    	
    oIE.Top = tblDisplay.Height
    oIE.Left = tblDisplay.Width - nWidth
    
    --Put the window on top
    Window.SetOrder(oIE.hWnd,  HWND_TOPMOST)
    
    --show IE 
    oIE.Title = "....................................................."
    oIE.Visible = true
    	
    blnAnimatePopupUp=true;
    I really don't know how to trigger that event...

    Thanks for reading.

  12. #12
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    If you haven't look at the thread I posted earlier, you should. It opens new ways of interacting with the web object.


    In your code...

    Add the following to your Global Functions:
    Code:
    IE_Events={}
    function IE_Events:BeforeNavigate2(pDisp, URL, Flags, TargetFrameName, PostData, Headers, Cancel)
    end
    
    function IE_Events:ClientToHostWindow(CX, CY)
    end
    
    function IE_Events:CommandStateChange(Command, Enable)
    end
    
    function IE_Events:DocumentComplete(pDisp, URL)
    end
    
    function IE_Events:DownloadBegin()
    end
    
    function IE_Events:DragDrop(Source, X, Y)
    end
    
    function IE_Events:FileDownload(Cancel)
    end
    
    function IE_Events:GotFocus()
    end
    
    function IE_Events:LostFocus()
    end
    
    function IE_Events:NavigateComplete2(pDisp, e_URL)
    	nPos = String.Find(e_URL, "#VISIT", 1, false)
    	if nPos > -1 then
    		Dialog.Message("Test","Good");
    	end
    end
    
    function IE_Events:NavigateError(pDisp, URL, Frame, StatusCode, Cancel)
    end
    
    function IE_Events:NewWindow2(ppDisp, Cancel)
    end
    
    function IE_Events:OnFullScreen(FullScreen)
    end
    
    function IE_Events:OnMenuBar(MenuBar)
    end
    
    function IE_Events:OnQuit()
    end
    
    function IE_Events:OnStatusBar(StatusBar)
    end
    
    function IE_Events:OnTheaterMode(TheaterMode)
    end
    
    function IE_Events:OnToolBar(ToolBar)
    end
    
    function IE_Events:OnVisible(Visible)
    end
    
    function IE_Events:PrintTemplateInstantiation(pDisp)
    end
    
    function IE_Events:PrintTemplateTeardown(pDisp)
    end
    
    function IE_Events:PrivacyImpactedStateChange(bImpacted)
    end
    
    function IE_Events:ProgressChange(Progress, ProgressMax)
    end
    
    function IE_Events:PropertyChange(szProperty)
    end
    
    function IE_Events:SetSecureLockIcon(SecureLockIcon)
    end
    
    function IE_Events:StatusTextChange(Text)
    end
    
    function IE_Events:TitleChange(Text)
    end
    
    function IE_Events:UpdatePageStatus(pDisp, nPage, fDone)
    end
    
    function IE_Events:Validate(Cancel)
    end
    
    function IE_Events:WindowClosing(IsChildWindow, Cancel)
    end
    
    function IE_Events:WindowSetHeight(Height)
    end
    
    function IE_Events:WindowSetLeft(Left)
    end
    
    function IE_Events:WindowSetResizable(Resizable)
    end
    
    function IE_Events:WindowSetTop(Top)
    end
    
    function IE_Events:WindowSetWidth(Width)
    end
    Then in your main code where you create the IE object, connect to the table of events.
    Code:
    oIE=luacom.CreateObject("InternetExplorer.Application") 
    luacom.Connect(oIE, IE_Events)
    Last edited by Worm; 08-18-2005 at 11:32 AM.

  13. #13
    Join Date
    Jan 2004
    Location
    Portugal
    Posts
    53
    Thanks for replying... You really can't stop

    One final question: do you know the property to hide the window from the taskbar? Here's a screenshot for you to see what I mean.



    Thanks again

  14. #14
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    This uses a DLL I wrote a while back to change the Windows Style to a tool window which removes it from the taskbar
    Attached Files

Similar Threads

  1. Is web access by AMS identified as SUF?
    By longedge in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 07-05-2005, 03:40 PM
  2. Replies: 2
    Last Post: 02-03-2004, 02:54 AM
  3. Sample project, how to manage dynamic web site content via an AMS GUI
    By Corey in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 01-05-2004, 08:32 AM
  4. Web Browser Object and AMS Runtime Error
    By Worm in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 01-13-2003, 06:40 PM
  5. Web object interaction again
    By josecastello in forum AutoPlay Media Studio 4.0
    Replies: 10
    Last Post: 01-04-2003, 07:26 AM

Posting Permissions

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