Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. [solved] QWebView loads Flash swf fine, but only "randomly" loads images loaded by a flash file
QtWS25 Last Chance

[solved] QWebView loads Flash swf fine, but only "randomly" loads images loaded by a flash file

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 1 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jan Riechers
    wrote on last edited by
    #1

    Hello,

    I succesfully load and display a flash swf file. But I also do load images using code of the following style - dynamically into the swf file for display.

    Actionscript 3 loading code:
    @var logoUrl:URLRequest = new URLRequest("icons/logo.png");
    var logoLoader:Loader = new Loader();
    logoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addLogo, false, 0, true);
    logoLoader.load( logoUrl );

    function addLogo(evt:Event) {
    var logo:Bitmap = evt.target.content;
    logo.x = 110;
    logo.y = 330;
    logo.scaleX = 0.25;
    logo.scaleY = 0.25;
    addChild(logo);
    }
    @

    But there is an issue that, "randomly", the images loaded by the swf become displayed, othertimes not. This can mean, 6 times yes, 2 times not. Also sometimes theres only one image loaded instead of all included. The loading routine in the flash file is happening in frame number 1.

    I also tried to increase the amount of frames in the flash swf up to 250 frames / 25 fps, 10 seconds to ensure that there are enough frames in the flash file to give the loader instances time to process the data loading.

    But an XML file loaded using a regular "Loader", instead of "URLLoader", class always becomes loaded and extracted succesfully.

    Now, Im just not sure where exactly the problem lies on - in the QWebview loading or the swf file itself.

    I should notice that the webview has some settings, those are:
    @
    QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, false);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::AutoLoadImages, true);
    @

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jan Riechers
      wrote on last edited by
      #2

      [quote author="Jan Riechers" date="1410508863"]Hello,

      Actionscript 3 loading code:
      logoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addLogo, false, 0, true);
      [/quote]

      It seems I found the issue, maybe that helps someone else:
      Dont use "weak reference", last parameter, for the addEventListener,
      this should look like this:
      @logoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addLogo, false, 0, false);@

      Amount of frames, one/1 is enough.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved