cpmfetch in flash swf cpmfetch in flash swf
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

cpmfetch in flash swf

Started by vincentams, November 15, 2006, 10:02:01 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

vincentams

Is it possible too fetch the images inside a swf?

Joachim Müller


vuud

Quote from: vincentams on November 15, 2006, 10:02:01 PM
Is it possible too fetch the images inside a swf?

Well... not currently.  I was hoping to someday learn flash and do it myself.

Do you know flash?  Are you willing to release a flash bit back to the cpmfetch project?

If so, I will help you make it work.  PM me with your e-mail details and we can chat.

I can think of a few ways to make it work - but as GauGau said, nothing that does right now.
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Joachim Müller

Extracting images from a flash movie using a server-driven, PHP-powered app that is suppossed to run on servers that have the minimum requirements for coppermine only? Hard to impossible to accomplish imo.

vuud

Quote from: GauGau on November 15, 2006, 10:59:32 PM
Extracting images from a flash movie using a server-driven, PHP-powered app that is suppossed to run on servers that have the minimum requirements for coppermine only? Hard to impossible to accomplish imo.

Maybe I am misunderstanding what he is trying to do...

I was thinking a flash front end that calls a url that invokes cpmfetch, returns a list of paths to files, which flash then loads and displays dynamically or however it wants to do it.

So cpmfetch would do what it does best and return a list of files... flash can do, well, whatever it is flash does :)


Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Pascal YAP

Hello wuurld

Is my exemple using CpmFetch and SwishMAX (FLASH) run fine on your screen ?
http://www.pays-dignois.com/galerie/Banniere-CPMfetch.html

SwishMAX actionScript after :
onFrame (2) {
    Thumbnail_1.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im1");
}
onFrame (6) {
    Thumbnail_2.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im2");
}
onFrame (10) {
    Thumbnail_3.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im3");
}
onFrame (14) {
    Thumbnail_4.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im4");
}
onFrame (20) {
    Thumbnail_5.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im5");
}
onFrame (150) {
    gotoSceneAndPlay("Scène_1",1);
}


PYAP

Joachim Müller

Quote from: vincentams on November 15, 2006, 10:02:01 PM
Is it possible too fetch the images inside a swf?
vincetams asked to pull images that reside witin a flash file and display it separately (swf->jpg). Of course the other way round would work (jpg->swf): you could come up with a flash script that pulls an image from somewhere. In fact there's even a mod that does this (the flash scroller).
Maybe I got the initial question wrong though. Vincetams, could you clarify?

Pascal YAP

GauGau,

QuoteMaybe I got the initial question wrong though.
Maybe it's me too !
I did'nt really understood the topic title, it's my mistake  ;)

PYAP

vuud

Quote from: GauGau on November 16, 2006, 06:32:29 AM
vincetams asked to pull images that reside witin a flash file and display it separately (swf->jpg). Of course the other way round would work (jpg->swf): you could come up with a flash script that pulls an image from somewhere. In fact there's even a mod that does this (the flash scroller).
Maybe I got the initial question wrong though. Vincetams, could you clarify?

Ah, I took that as an ESL problem and assumed it was the way I thought... I mean who would want to do the other way :)

PYAP - yes, yours works great here.  I'd have a version of flash somewhere, so I'd love to have it grab images, titles, etc...  But I am very very art-poor :)



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Pascal YAP

Vuud,

;D
QuoteI'd have a version of flash somewhere, so I'd love to have it grab images, titles, etc...  But I am very very art-poor

Possible to see this one ?
Possible to enhance this one ?
And finally publish this one here ? (CpmFetch's board)

PYAP

vuud

Quote from: PYAP on November 16, 2006, 04:43:53 PM
Vuud,

;D
Possible to see this one ?
Possible to enhance this one ?
And finally publish this one here ? (CpmFetch's board)

PYAP

Sorry what I meant was I have a version of Macromedia flash somewhere... not anything for cpmfetch done in it...

My flash-fu is not very strong

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jsmoke

You were looking for something like this perhaps?

jsmoke

Oh, and if you want to see it in action, the check out http://www.freerideadventuresjpn.com/road.htm

It's pulling 15 random images from the Road album and displaying them as a nifty little fading slideshow.  All auto centered with spiffy drop shadows.

vuud

Quote from: jsmoke on November 23, 2006, 11:53:31 AM
Oh, and if you want to see it in action, the check out http://www.freerideadventuresjpn.com/road.htm

It's pulling 15 random images from the Road album and displaying them as a nifty little fading slideshow.  All auto centered with spiffy drop shadows.

Seems like it would be... but it does not do anything on my browser (firefox / linux).

Does that use cpmfetch to get the data?
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jsmoke

Quote from: vuud on November 27, 2006, 12:19:35 AM
Seems like it would be... but it does not do anything on my browser (firefox / linux).

Does that use cpmfetch to get the data?


Of course it doesn't work on linux.  Why would it work on linux?  Anyway, it's because the linux flash player only goes to version 7.0.68.0 and a lot of the code is specific to player 8+.  I think it's the filters for the dropshadow and the delay funtion (setTimeout) that break in player 7 and older.  Probably the tween functions for fading are the same, but the essential way that the data is read in should work. 

My premise was that since flash deals with xml really easily, and cpmfetch generates xhtml, then it should be pretty straightforward to deal with from there. 

It does use cpmfetch.

I think there's a better way to access the data with the api, maybe I'll get into that later in the winter.  I'm positive that there's a cleaner way to do this, but I'm pretty new to this stuff.  I'm as surprised as anyone that it actually works.

Here's the php....



<?php

include "./cpmfetch.php";
$objCpm = "";
$objCpm = new cpm("/gallery");
$source = "album=3" ;
$options = array( 'imagesize' =>'int', 'imagelink' => 'none');

  $objCpm->cpm_viewRandomMediaFrom (1, 15, $source, $options) ;


$objCpm->cpm_close();
?>



...and heres the actionscript....



import flash.filters.DropShadowFilter;
//////////set variables
//Tween types (Back, Bounce, Elastic, None, Regular, Strong). Child Types (easeIn, easeOut)
var easeType = mx.transitions.easing.Regular.easeIn;
_global.arrIndex = 0;
var imgArr:Array = new Array();
mySite = "http://www.yoursite.com";
//create array from XML result from CpmFetch
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
var imageSrc = xmlNode.childNodes[i].firstChild.attributes.src;
image[i] = mySite+searchAndReplace(imageSrc, "//", "/");
}
imgArr = image;
loadImage();
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(mySite+"/cpmfetch/album3.php");
////////////Manipulate the result string, because CpmFetch adds weird slashes//////////////
function searchAndReplace(holder, searchfor, replacement) {
temparray = holder.split(searchfor);
holder = temparray.join(replacement);
return (holder);
}
/////////////load image function///////////
_global.loadImage = function(image:String):Void  {
//create container
var container:MovieClip = _root.createEmptyMovieClip("container", 1);
//create image clip
var img:MovieClip = container.createEmptyMovieClip("img", 2);
//create var to reference the image clip's path
//container.img = holder;
img._alpha = 0;
///load image
img.loadMovie(imgArr[arrIndex]);
//position image
container.onEnterFrame = function() {
if (img.getBytesTotal() == img.getBytesLoaded() && img.getBytesTotal()>=1) {
offSetx = (Stage.width-img._width)/2;
offSety = (Stage.height-img._height)/2;
img._x += offSetx;
img._y = offSety;
img.fadeIn();
img.onEnterFrame = function() {
//dropshadow
var dropShadow:DropShadowFilter = new DropShadowFilter(5, 90, 0x333333, 40, 5, 5, 2, 9);
container.filters = [dropShadow];
function fadeout() {
myTween2 = new mx.transitions.Tween(img, "_alpha", easeType, img._alpha, 0, 25);
myTween2.onMotionFinished = function() {
//if there is a next image
if (arrIndex<imgArr.length-1) {
arrIndex++;
//else we're at the end and loop back
} else {
arrIndex = 0;
}
//once arrIndex has been correctly changed load the next image
trace(arrIndex);
loadImage();
};
}
myTween = new mx.transitions.Tween(img, "_alpha", easeType, 0, 100, 25);
myTween.onMotionFinished = function() {
setTimeout(fadeout, 7000);
};
delete this.onEnterFrame;
};
delete this.onEnterFrame;
}
};
//end fade in           
};

vuud

Quote from: jsmoke on November 27, 2006, 05:34:17 AM
Of course it doesn't work on linux.  Why would it work on linux?  Anyway, it's because the linux flash player only goes to version 7.0.68.0 and a lot of the code is specific to player 8+.  I think it's the filters for the dropshadow and the delay funtion (setTimeout) that break in player 7 and older.  Probably the tween functions for fading are the same, but the essential way that the data is read in should work. 

Why wouldn't it work in Linux is the question you should be asking : )   I think I may have heard that there is a new version of flash out or imminently out for linux.   I did not try it on the Mac.

Quote
My premise was that since flash deals with xml really easily, and cpmfetch generates xhtml, then it should be pretty straightforward to deal with from there. 

Hmmm, what about reading in an RSS feed from cpmfetch?  That is some flavor of xml...  CpmFetch can produce those now and it would be a lot cleaner than parsing the whole html pile.

Quote
It does use cpmfetch.
I think there's a better way to access the data with the api, maybe I'll get into that later in the winter.  I'm positive that there's a cleaner way to do this, but I'm pretty new to this stuff.  I'm as surprised as anyone that it actually works.

Here's the php....



<?php

include "./cpmfetch.php";
$objCpm = "";
$objCpm = new cpm("/gallery");
$source = "album=3" ;
$options = array( 'imagesize' =>'int', 'imagelink' => 'none');

  $objCpm->cpm_viewRandomMediaFrom (1, 15, $source, $options) ;


$objCpm->cpm_close();
?>



You could also use a data result from cpmfetch and roll your own XML using print/echo statements. I think the RSS feed may be the best way to do that part anyway...

The wierd slashes I think go away in the 2.0 release :)

Thanks for sharing the code and stuff!

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jsmoke

Just being facetious about the linux, but there must be some issues related to compiling flash players for it because there really is no reason to be so far behind. Player 9 is out, fer cryin out loud.

Anyway, flash doesn't care whether it's RSS or HTML, so long as it's valid XML then it's good to go.  I'm fairly weak on the PHP, but if I get more into it and anything good comes out of it, I'll drop it on you. 

The best thing about the Flash XML object is a feature called "id map", so if the node has an id attribute, it's pathetically easy to navigate.  Attaching id attributes to the gallery somehow would make running actionscript pretty easy, especially with the AS3 language for FLEX stuff. 

niks_007

hi.....
         some one wrote that it is possible to fetch jpg in swf with swish max. i want to try this can i getch the last updated album images from a selected cetegory into a flash animation so my visitors can click on the animation and visit that album. images should come one after another (i know how to add effects in swish max.)

if it is possible please let me know.

Thanks
Niks

blowfishdl

Owned --


Quote from: PYAP on November 15, 2006, 11:32:23 PM
Hello wuurld

Is my exemple using CpmFetch and SwishMAX (FLASH) run fine on your screen ?
http://www.pays-dignois.com/galerie/Banniere-CPMfetch.html

SwishMAX actionScript after :
onFrame (2) {
    Thumbnail_1.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im1");
}
onFrame (6) {
    Thumbnail_2.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im2");
}
onFrame (10) {
    Thumbnail_3.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im3");
}
onFrame (14) {
    Thumbnail_4.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im4");
}
onFrame (20) {
    Thumbnail_5.loadMovie("http://www.myself.com/photo/fetch/cfimageget.php?cat=0&im5");
}
onFrame (150) {
    gotoSceneAndPlay("Scène_1",1);
}


PYAP

blowfishdl

I'm trying to use your script.. but using the coppermine php you provided it doesnt work. Does anybody know why that might be? I don't think it's creating the array correctly..




Quote from: jsmoke on November 27, 2006, 05:34:17 AM
Of course it doesn't work on linux.  Why would it work on linux?  Anyway, it's because the linux flash player only goes to version 7.0.68.0 and a lot of the code is specific to player 8+.  I think it's the filters for the dropshadow and the delay funtion (setTimeout) that break in player 7 and older.  Probably the tween functions for fading are the same, but the essential way that the data is read in should work. 

My premise was that since flash deals with xml really easily, and cpmfetch generates xhtml, then it should be pretty straightforward to deal with from there. 

It does use cpmfetch.

I think there's a better way to access the data with the api, maybe I'll get into that later in the winter.  I'm positive that there's a cleaner way to do this, but I'm pretty new to this stuff.  I'm as surprised as anyone that it actually works.

Here's the php....



<?php

include "./cpmfetch.php";
$objCpm = "";
$objCpm = new cpm("/gallery");
$source = "album=3" ;
$options = array( 'imagesize' =>'int', 'imagelink' => 'none');

  $objCpm->cpm_viewRandomMediaFrom (1, 15, $source, $options) ;


$objCpm->cpm_close();
?>



...and heres the actionscript....



import flash.filters.DropShadowFilter;
//////////set variables
//Tween types (Back, Bounce, Elastic, None, Regular, Strong). Child Types (easeIn, easeOut)
var easeType = mx.transitions.easing.Regular.easeIn;
_global.arrIndex = 0;
var imgArr:Array = new Array();
mySite = "http://www.yoursite.com";
//create array from XML result from CpmFetch
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
var imageSrc = xmlNode.childNodes[i].firstChild.attributes.src;
image[i] = mySite+searchAndReplace(imageSrc, "//", "/");
}
imgArr = image;
loadImage();
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(mySite+"/cpmfetch/album3.php");
////////////Manipulate the result string, because CpmFetch adds weird slashes//////////////
function searchAndReplace(holder, searchfor, replacement) {
temparray = holder.split(searchfor);
holder = temparray.join(replacement);
return (holder);
}
/////////////load image function///////////
_global.loadImage = function(image:String):Void  {
//create container
var container:MovieClip = _root.createEmptyMovieClip("container", 1);
//create image clip
var img:MovieClip = container.createEmptyMovieClip("img", 2);
//create var to reference the image clip's path
//container.img = holder;
img._alpha = 0;
///load image
img.loadMovie(imgArr[arrIndex]);
//position image
container.onEnterFrame = function() {
if (img.getBytesTotal() == img.getBytesLoaded() && img.getBytesTotal()>=1) {
offSetx = (Stage.width-img._width)/2;
offSety = (Stage.height-img._height)/2;
img._x += offSetx;
img._y = offSety;
img.fadeIn();
img.onEnterFrame = function() {
//dropshadow
var dropShadow:DropShadowFilter = new DropShadowFilter(5, 90, 0x333333, 40, 5, 5, 2, 9);
container.filters = [dropShadow];
function fadeout() {
myTween2 = new mx.transitions.Tween(img, "_alpha", easeType, img._alpha, 0, 25);
myTween2.onMotionFinished = function() {
//if there is a next image
if (arrIndex<imgArr.length-1) {
arrIndex++;
//else we're at the end and loop back
} else {
arrIndex = 0;
}
//once arrIndex has been correctly changed load the next image
trace(arrIndex);
loadImage();
};
}
myTween = new mx.transitions.Tween(img, "_alpha", easeType, 0, 100, 25);
myTween.onMotionFinished = function() {
setTimeout(fadeout, 7000);
};
delete this.onEnterFrame;
};
delete this.onEnterFrame;
}
};
//end fade in           
};