indexSH
10-28-2011, 01:27 PM
Hello,
i am new to this forum and i need desperately a little help with fscommand.
I am building a small swf in Flash CS5(AS2) which consists of a dock menu
(template script from the web) and what it actually does is when you click on
an image, it opens a webpage(via getURL method :P)
What i wanto to mod is instead of getURL, to fscommand("exec", "folder.exe");
so when you click on an image from the Dock, to execute the "folder.exe" which opens a directory.
I am pasting the code. There is also code for the visuals etc, so scroll a bit down.The area where i think i should put the fscommand is
MovieClip.prototype.onClick = function(i) {
this.onPress = function() {
getURL(urls[i], tg[i]); //here i put the fscommand
loadXML = function (success) {
if (success) {
var photos:Array = this.firstChild.childNodes;
total = photos.length-1;
createEmptyMovieClip("thumbs", 4);
for (var i=0;i<=total;i++) {
images.push((_root.folderPath?_root.folderPath:"") + photos[i].attributes.image);
urls.push(photos[i].attributes.url);
info.push(photos[i].attributes.info);
tg.push(photos[i].attributes.target);
thumb = thumbs.createEmptyMovieClip("th"+i, i);
pr = thumb.attachMovie("preload","pr", 1);
pr._x = 3/2*minThumbW; pr._y = 3/2*minThumbH;
holder = thumb.createEmptyMovieClip("holder", 2);
loadBitmapSmoothed(images[i],holder);
r = thumb.attachMovie("item","r", 3);
r._visible = false;
if (useMirror==2) {
if(loadSmoothed) loadBitmapSmoothed(images[i],r.ref.inner);
else r.ref.inner.loadMovie(images[i]);
r._y = 2*thumb._height-1+mirrorDistance;
r._yscale=-100;
}
thumb.onClick(i);
var trans:Transform = new Transform(thumb);
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset= outColor;
trans.colorTransform = colorTrans;
Dock.push(thumb);
thumbs._y = DockYpos;
thumbs._x = DockXpos;
thumb._width = minThumbW;
if (useMirror == 2) thumb._height = 3/2*minThumbH;
else thumb._height = minThumbH;
thumb.holder.onEnterFrame = function () {
if (this.isLoaded) {
if (useMirror == 2) this._parent.r._visible = true;
this._parent.pr._visible = false;
delete this.onEnterFrame;
}
}
}
if (verticalMenu)
onEnterFrame = function () {
mouseOverDock = ((_ymouse >10) && (_ymouse<dockHeight-10) && (_xmouse>10) && (_xmouse<dockWidth-10));
if (thumbs._height > dockHeight) {
if (mouseOverDock) xpos = (dockHeight - thumbs._height-maxThumbH-spacing)*_ymouse/dockHeight;
if ((thumbs._y > xpos) && (Math.abs(thumbs._y - xpos)>(scrollSpeed+5))) thumbs._y -=scrollSpeed;
else if ((thumbs._y < xpos) && (Math.abs(thumbs._y - xpos)>(scrollSpeed+5))) thumbs._y += scrollSpeed;
else thumbs._y = xpos;
dist = maxThumbH/2;
}
else { dist = dockHeight/2 - thumbs._height/2+spacing/2; thumbs._y = 0;}
for (i=0;i<Dock.length;i++) {
H = Dock[i]._height;
W = Dock[i]._width;
if (thumbs._height > dockHeight)
rap = (influence-Math.abs(((thumbs._height+maxThumbH+spacing)/dockHeight)*_ymouse-Dock[i]._y-Dock[i]._height/2))/influence;
else rap = (influence-Math.abs(_ymouse-(Dock[i]._y+Dock[i]._height/2)))/influence;
Dock[i]._width = Math.max(W-((W-minThumbW)/fade), W-((W-(rap*mouseOverDock*maxThumbW))/snap));
Dock[i]._height = Math.max(H-((H-useMirror*minThumbH)/fade), H-((H-(useMirror*rap*mouseOverDock*maxThumbH))/snap));
Dock[i]._x = (maxThumbH-Dock[i]._height)/bigThumbDirection;
Dock[i]._y = dist;
dist += Dock[i]._height+spacing;
}
}
else
onEnterFrame = function () {
mouseOverDock = ((_ymouse >10) && (_ymouse<dockHeight-10) && (_xmouse>10) && (_xmouse<dockWidth-10));
if (thumbs._width > dockWidth) {
if (mouseOverDock) xpos = (dockWidth - thumbs._width-maxThumbW-spacing)*_xmouse/dockWidth;
if ((thumbs._x > xpos) && (Math.abs(thumbs._x - xpos)>(scrollSpeed+5))) thumbs._x -=scrollSpeed;
else if ((thumbs._x < xpos) && (Math.abs(thumbs._x - xpos)>(scrollSpeed+5))) thumbs._x += scrollSpeed;
else thumbs._x = xpos;
dist = maxThumbW/2;
}
else { dist = dockWidth/2 - thumbs._width/2+spacing/2; thumbs._x = 0;xpos=0;}
for (i=0;i<Dock.length;i++) {
H = Dock[i]._height;
W = Dock[i]._width;
if (thumbs._width > dockWidth)
rap = (influence-Math.abs(((thumbs._width+maxThumbW+spacing)/dockWidth)*_xmouse-Dock[i]._x-Dock[i]._width/2))/influence;
else rap = (influence-Math.abs(_xmouse-(Dock[i]._x+Dock[i]._width/2)))/influence;
Dock[i]._width = Math.max(W-((W-minThumbW)/fade), W-((W-(rap*mouseOverDock*maxThumbW))/snap));
Dock[i]._height = Math.max(H-((H-useMirror*minThumbH)/fade), H-((H-(useMirror*rap*mouseOverDock*maxThumbH))/snap));
Dock[i]._y = (maxThumbH-Dock[i]._height)/bigThumbDirection;
Dock[i]._x = dist;
dist += Dock[i]._width+spacing;
}
}
}
}
xml.onLoad = loadXML;
xml.load((_root.folderPath?_root.folderPath:"") + "images.xml" );
MovieClip.prototype.onClick = function(i) {
this.onPress = function() {
getURL(urls[i], tg[i]);
}
this.onRollOver = function() {
if (showDescription) {
if(verticalMenu) {
descript = attachMovie("description", "descript", 8888);
descript._y = Dock[i]._y + xpos+minThumbH/2;
descript.onEnterFrame = function() {
descript._y = Dock[i]._y + xpos+maxThumbH/2;
}
descript._y = descriptionY;
descript._x = descriptionX;
descript.desc_inner.desc.text = info[i];
}
else {
descript = attachMovie("description", "descript", 8888);
descript._x = Dock[i]._x + xpos+minThumbW/2;
descript.onEnterFrame = function() {
descript._x = Dock[i]._x + xpos+maxThumbW/2;
}
descript._y = descriptionY;
descript._x = descriptionX;
descript.desc_inner.desc.text = info[i];
}
}
var trans:Transform = new Transform(this.holder);
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset=0;
this.onEnterFrame = function () {
if (colorTrans.blueOffset < iC) {
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset+=color ingSpeed;
trans.colorTransform = colorTrans;
}
}
this.onRollOut = function() {
if (showDescription) {
removeMovieClip("descript");
}
var trans:Transform = new Transform(this.holder);
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset= iC;
this.onEnterFrame = function () {
if (colorTrans.blueOffset > 0) {
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset -= coloringSpeed;
trans.colorTransform = colorTrans;
}
}
}
}
}
function loadBitmapSmoothed(url:String, target:MovieClip) {
var bmc:MovieClip = target.createEmptyMovieClip("bmc", target.getNextHighestDepth());
var listener:Object = new Object();
listener.tmc = target;
target.isLoaded = false;
listener.onLoadInit = function(mc:MovieClip) {
target.isLoaded = true;
if(loadSmoothed) {
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(), "auto", true);
bitmap.draw(mc);
}
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}
PLeasem anyone that has time to read it would help me a lot! Thank you for your time!!!
i am new to this forum and i need desperately a little help with fscommand.
I am building a small swf in Flash CS5(AS2) which consists of a dock menu
(template script from the web) and what it actually does is when you click on
an image, it opens a webpage(via getURL method :P)
What i wanto to mod is instead of getURL, to fscommand("exec", "folder.exe");
so when you click on an image from the Dock, to execute the "folder.exe" which opens a directory.
I am pasting the code. There is also code for the visuals etc, so scroll a bit down.The area where i think i should put the fscommand is
MovieClip.prototype.onClick = function(i) {
this.onPress = function() {
getURL(urls[i], tg[i]); //here i put the fscommand
loadXML = function (success) {
if (success) {
var photos:Array = this.firstChild.childNodes;
total = photos.length-1;
createEmptyMovieClip("thumbs", 4);
for (var i=0;i<=total;i++) {
images.push((_root.folderPath?_root.folderPath:"") + photos[i].attributes.image);
urls.push(photos[i].attributes.url);
info.push(photos[i].attributes.info);
tg.push(photos[i].attributes.target);
thumb = thumbs.createEmptyMovieClip("th"+i, i);
pr = thumb.attachMovie("preload","pr", 1);
pr._x = 3/2*minThumbW; pr._y = 3/2*minThumbH;
holder = thumb.createEmptyMovieClip("holder", 2);
loadBitmapSmoothed(images[i],holder);
r = thumb.attachMovie("item","r", 3);
r._visible = false;
if (useMirror==2) {
if(loadSmoothed) loadBitmapSmoothed(images[i],r.ref.inner);
else r.ref.inner.loadMovie(images[i]);
r._y = 2*thumb._height-1+mirrorDistance;
r._yscale=-100;
}
thumb.onClick(i);
var trans:Transform = new Transform(thumb);
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset= outColor;
trans.colorTransform = colorTrans;
Dock.push(thumb);
thumbs._y = DockYpos;
thumbs._x = DockXpos;
thumb._width = minThumbW;
if (useMirror == 2) thumb._height = 3/2*minThumbH;
else thumb._height = minThumbH;
thumb.holder.onEnterFrame = function () {
if (this.isLoaded) {
if (useMirror == 2) this._parent.r._visible = true;
this._parent.pr._visible = false;
delete this.onEnterFrame;
}
}
}
if (verticalMenu)
onEnterFrame = function () {
mouseOverDock = ((_ymouse >10) && (_ymouse<dockHeight-10) && (_xmouse>10) && (_xmouse<dockWidth-10));
if (thumbs._height > dockHeight) {
if (mouseOverDock) xpos = (dockHeight - thumbs._height-maxThumbH-spacing)*_ymouse/dockHeight;
if ((thumbs._y > xpos) && (Math.abs(thumbs._y - xpos)>(scrollSpeed+5))) thumbs._y -=scrollSpeed;
else if ((thumbs._y < xpos) && (Math.abs(thumbs._y - xpos)>(scrollSpeed+5))) thumbs._y += scrollSpeed;
else thumbs._y = xpos;
dist = maxThumbH/2;
}
else { dist = dockHeight/2 - thumbs._height/2+spacing/2; thumbs._y = 0;}
for (i=0;i<Dock.length;i++) {
H = Dock[i]._height;
W = Dock[i]._width;
if (thumbs._height > dockHeight)
rap = (influence-Math.abs(((thumbs._height+maxThumbH+spacing)/dockHeight)*_ymouse-Dock[i]._y-Dock[i]._height/2))/influence;
else rap = (influence-Math.abs(_ymouse-(Dock[i]._y+Dock[i]._height/2)))/influence;
Dock[i]._width = Math.max(W-((W-minThumbW)/fade), W-((W-(rap*mouseOverDock*maxThumbW))/snap));
Dock[i]._height = Math.max(H-((H-useMirror*minThumbH)/fade), H-((H-(useMirror*rap*mouseOverDock*maxThumbH))/snap));
Dock[i]._x = (maxThumbH-Dock[i]._height)/bigThumbDirection;
Dock[i]._y = dist;
dist += Dock[i]._height+spacing;
}
}
else
onEnterFrame = function () {
mouseOverDock = ((_ymouse >10) && (_ymouse<dockHeight-10) && (_xmouse>10) && (_xmouse<dockWidth-10));
if (thumbs._width > dockWidth) {
if (mouseOverDock) xpos = (dockWidth - thumbs._width-maxThumbW-spacing)*_xmouse/dockWidth;
if ((thumbs._x > xpos) && (Math.abs(thumbs._x - xpos)>(scrollSpeed+5))) thumbs._x -=scrollSpeed;
else if ((thumbs._x < xpos) && (Math.abs(thumbs._x - xpos)>(scrollSpeed+5))) thumbs._x += scrollSpeed;
else thumbs._x = xpos;
dist = maxThumbW/2;
}
else { dist = dockWidth/2 - thumbs._width/2+spacing/2; thumbs._x = 0;xpos=0;}
for (i=0;i<Dock.length;i++) {
H = Dock[i]._height;
W = Dock[i]._width;
if (thumbs._width > dockWidth)
rap = (influence-Math.abs(((thumbs._width+maxThumbW+spacing)/dockWidth)*_xmouse-Dock[i]._x-Dock[i]._width/2))/influence;
else rap = (influence-Math.abs(_xmouse-(Dock[i]._x+Dock[i]._width/2)))/influence;
Dock[i]._width = Math.max(W-((W-minThumbW)/fade), W-((W-(rap*mouseOverDock*maxThumbW))/snap));
Dock[i]._height = Math.max(H-((H-useMirror*minThumbH)/fade), H-((H-(useMirror*rap*mouseOverDock*maxThumbH))/snap));
Dock[i]._y = (maxThumbH-Dock[i]._height)/bigThumbDirection;
Dock[i]._x = dist;
dist += Dock[i]._width+spacing;
}
}
}
}
xml.onLoad = loadXML;
xml.load((_root.folderPath?_root.folderPath:"") + "images.xml" );
MovieClip.prototype.onClick = function(i) {
this.onPress = function() {
getURL(urls[i], tg[i]);
}
this.onRollOver = function() {
if (showDescription) {
if(verticalMenu) {
descript = attachMovie("description", "descript", 8888);
descript._y = Dock[i]._y + xpos+minThumbH/2;
descript.onEnterFrame = function() {
descript._y = Dock[i]._y + xpos+maxThumbH/2;
}
descript._y = descriptionY;
descript._x = descriptionX;
descript.desc_inner.desc.text = info[i];
}
else {
descript = attachMovie("description", "descript", 8888);
descript._x = Dock[i]._x + xpos+minThumbW/2;
descript.onEnterFrame = function() {
descript._x = Dock[i]._x + xpos+maxThumbW/2;
}
descript._y = descriptionY;
descript._x = descriptionX;
descript.desc_inner.desc.text = info[i];
}
}
var trans:Transform = new Transform(this.holder);
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset=0;
this.onEnterFrame = function () {
if (colorTrans.blueOffset < iC) {
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset+=color ingSpeed;
trans.colorTransform = colorTrans;
}
}
this.onRollOut = function() {
if (showDescription) {
removeMovieClip("descript");
}
var trans:Transform = new Transform(this.holder);
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset= iC;
this.onEnterFrame = function () {
if (colorTrans.blueOffset > 0) {
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset -= coloringSpeed;
trans.colorTransform = colorTrans;
}
}
}
}
}
function loadBitmapSmoothed(url:String, target:MovieClip) {
var bmc:MovieClip = target.createEmptyMovieClip("bmc", target.getNextHighestDepth());
var listener:Object = new Object();
listener.tmc = target;
target.isLoaded = false;
listener.onLoadInit = function(mc:MovieClip) {
target.isLoaded = true;
if(loadSmoothed) {
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(), "auto", true);
bitmap.draw(mc);
}
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}
PLeasem anyone that has time to read it would help me a lot! Thank you for your time!!!