Advanced search  

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]

Pages: [1] 2   Go Down

Author Topic: cpmfetch in flash swf  (Read 20018 times)

0 Members and 1 Guest are viewing this topic.

vincentams

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
cpmfetch in flash swf
« on: November 15, 2006, 10:02:01 pm »

Is it possible too fetch the images inside a swf?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: cpmfetch in flash swf
« Reply #1 on: November 15, 2006, 10:38:13 pm »

no
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in flash swf
« Reply #2 on: November 15, 2006, 10:57:20 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.
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: cpmfetch in flash swf
« Reply #3 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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in flash swf
« Reply #4 on: November 15, 2006, 11:19:39 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 :)


Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: cpmfetch in flash swf
« Reply #5 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 :
Code: [Select]
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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: cpmfetch in flash swf
« Reply #6 on: November 16, 2006, 06:32:29 am »

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?
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: cpmfetch in flash swf
« Reply #7 on: November 16, 2006, 09:22:32 am »

GauGau,

Quote
Maybe 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in flash swf
« Reply #8 on: November 16, 2006, 04:39:18 pm »

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 :)



Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: cpmfetch in flash swf
« Reply #9 on: November 16, 2006, 04:43:53 pm »

Vuud,

 ;D
Quote
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

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

PYAP
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in flash swf
« Reply #10 on: November 17, 2006, 03:00:28 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

Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: cpmfetch in flash swf
« Reply #11 on: November 23, 2006, 11:50:22 am »

You were looking for something like this perhaps?
Logged

jsmoke

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: cpmfetch in flash swf
« Reply #12 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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in flash swf
« Reply #13 on: November 27, 2006, 12:19:35 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?
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: cpmfetch in flash swf
« Reply #14 on: November 27, 2006, 05:34:17 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....

Code: [Select]

<?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....

Code: [Select]

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           
};
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in flash swf
« Reply #15 on: November 28, 2006, 04:57:35 pm »

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....

Code: [Select]

<?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!

Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: cpmfetch in flash swf
« Reply #16 on: November 28, 2006, 07:00:10 pm »

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. 
Logged

niks_007

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Re: cpmfetch in flash swf
« Reply #17 on: December 19, 2006, 09:46:43 pm »

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
Logged

blowfishdl

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 57
Re: cpmfetch in flash swf
« Reply #18 on: January 31, 2008, 02:40:10 am »

Owned --


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 :
Code: [Select]
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
Logged

blowfishdl

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 57
Re: cpmfetch in flash swf
« Reply #19 on: January 31, 2008, 04:47:08 pm »

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..




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....

Code: [Select]

<?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....

Code: [Select]

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           
};
Logged
Pages: [1] 2   Go Up
 

Page created in 0.034 seconds with 19 queries.