srenshaw's Recent Forum Activity

  • I use a PHP file to get the data out of a mySQL database using the JSON_ENCODE function, for example:

    https://www.opentechguides.com/how-to/article/php/100/mysql-to-json.html

    Then I used the following tutorial to create the scrolling list of items with ProUI:

    https://www.youtube.com/watch?v=WvQsGNlp-4Y&t=324s

  • Hi Aekiro, I'm using Scroll View to display a very long list of over 400 clickable items (each item has the button behaviour attached). When I scroll the list using either touch or mouse clicks a button click is often registered, which then triggers an action and prevents scrolling through the rest of the list. Also, the scroll speed is fine using touch controls, but far too fast using the middle mouse button.

    1. Is it possible to detect whether the scroll list is moving so that I can disable button clicks whilst scrolling?

    2. Can I control the scroll speed when using the middle mouse button?

    Thanks,

    Steve.

  • Brilliant, thanks Aekiro.

    For anyone else reading this, I was also able to show the scrolling text in a pop-up Dialog box by adding the ProUI Game Object behaviours to the various elements, then setting the relevant Parent/Child names.

  • Hi Aekiro,

    I've just realised that the Scroll View will only accept images as content, not text. Is there any chance you could add this functionality as I plan to have a number of pop-ups that show instructions or dialogue and I'd like the user to be able to scroll the text in the pop-up.

    Great plug-in by the way - very useful so far :¬)

    Thanks,

    Steve.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks Ashley, I've made some progress controlling the YouTube player inside the iFrame object. I'm using C3 buttons to send javascript commands such as:

    document.getElementById("myFrame").contentWindow.postMessage('playVideo','*');
    

    The following code in the iFrame listens for the commands then communicates with the YouTube player.

    window.addEventListener('message', function(event){
    
    	document.getElementById('message').innerHTML = event.data;
    
    	if (event.data == 'pauseVideo') {
    		pauseVideo();
    	} 
    
    });
    

    I would also like to pass information back to C3, such as the player state and the time elapsed. I thought I could do this by simply creating global variables in C3 and setting their values using the iFrame javascript:

    runtime.globalVars.playerState = pState; 
    

    However, I get the following console error:

    'Uncaught ReferenceError: runtime is not defined'

    Is it possible to access global variables from the javascript running in the iFrame object?

    Thanks, Steve.

  • I can successfully interact with the contents of an iFrame using C3's built in iFrame object and the new JavaScript facility. However, I can't figure out how to use this technique to control an embedded YouTube video.

    I've experimented with a couple of options but had no luck so far:

    Option 1: C3 JS sends commands directly to the YouTube iFrame which is embedded in the C3 iFrame.

    Option 2: C3 JS sends commands to the C3 iFrame, which then sends commands to YouTube iFrame.

    Unfortunately I don't know if either of these options is technically possible, and if so, what code to use.

    I've created a quick project to illustrate the problem and I'd be grateful if anyone can help with a solution (or put me out of my misery and tell me why it's not actually possible):

    https://www.dropbox.com/s/0nq8fhv5vuxu0x0/YTtest01.c3p?dl=0

    Many Thanks,

    Steve.

    Tagged:

  • Hi Jase00, did you have any luck with this? I'm also looking for a way to control a youtube video using C3. I'd like to be able to Play/Pause the video in it's iFrame, trigger events at a specific playback time and basically use C3 to control any aspect of the video that the Youtube IFrame Player API allows. Unfortunately I've had no luck so far - I can achieve results using just HTML and Javascript, but I can't get C3 to successfully replicate this functionality. Does anyone know if it's actually possible, and if so, how?

    Many Thanks,

    Steve.

srenshaw's avatar

srenshaw

Member since 6 Dec, 2017

None one is following srenshaw yet!

Trophy Case

  • 6-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies