آموزش SWiSH از ابتدا تا بینهایت

در مورد مطالب این بخش چه نظری دارید؟


  • مجموع رای دهندگان
    45

massoudn

کاربر فعال
Cylindrical Image - External

Scene
onSelfEvent (load) { import flash.display.BitmapData;
import flash.geom.Matrix;

var cupHeight : Number = bottomBase._y - topBase._y; // The visible height of the cup (about 290 px on this sample)
var topBa***Rad : Number = 0.5 * topBase._width; // The "radii" of the top elliptical base
var topBaseYRad : Number = 0.5 * topBase._height;
var bottomBa***Rad : Number = 0.5 * bottomBase._width; // The "radii" of the bottom elliptical base
var bottomBaseYRad : Number = 0.5 * bottomBase._height;
var radRatio : Number = topBaseYRad / topBa***Rad;
var phi : Number = Math.asin(radRatio); // The angle of "inclination" of the cup towards the observer
var picWidth : Number; // The width of the source image
var realPicHeight : Number; // The height of the source image
var cylPicHeight : Number; // The height of the image projected on the surface of the cup
var numSlices : Number = 16; // The number of slices into which the image will be cut
var sliceWidth : Number; // The width of a slice
var topPicXRadius : Number; // The radius (of the section through the cone) on which the image's top edge will be positioned
var bottomPicXRadius : Number; // The radius on which the image's bottom edge will be positioned
var BasesRadDiff : Number = topBase._width - bottomBase._width; // The difference between the measured radii of the bases of the cup
var topPicY : Number; // Y of the image's top edge
var bottomPicY : Number; // Y of the image's bottom edge
var topPicRadDiff : Number; // The diff... well, it's just an intermediate variable fot calculations
var botPicRadDiff : Number;
var deltaTheta : Number; // The increment of the angle to be used when drawing every new slice on the surface sequentially
var sector : Number; // The angle of the sector engaged by the image over the circumference (in radians)
var theta : Number; // The starting angle where the left edge of the image will be positioned
var curTheta : Number; // The current angle for positioning of every slice along the surface
var leftTheta : Number = Math.PI + 0.1; // The limits of the image's movement - to the left
var rightTheta : Number = Math.PI * 2 - 0.1; // and to the right
var xtopleft : Number; // The coordinates of the slices' vertices used for drawing
var xbottomleft : Number; // by the lineTo(x,y) method
var xtopright : Number;
var xbottomright : Number;
var ytopleft : Number;
var ybottomleft : Number;
var ytopright : Number;
var ybottomright : Number;
var i : Number; // The for() cycle variables
var cylPictureMC : MovieClip = this.createEmptyMovieClip("cylPictureMC", this.getNextHighestDepth());
var containerMC : MovieClip = this.createEmptyMovieClip("containerMC", this.getNextHighestDepth());
var sourceBitmap : BitmapData;
var cylMatrix : Matrix;

var imgLoader: MovieClipLoader = new MovieClipLoader();
var imgLoadListener: Object = new Object();
imgLoader.addListener(imgLoadListener);

imgLoadListener.onLoadInit = function (target_mc : MovieClip) {
target_mc._visible = false;
onSourceSelect(target_mc);
};

/*imgLoadListener.onLoadError = function (target_mc : MovieClip, errorCode : String) {
trace(target_mc + ": " + errorCode);
};*/

imgLoader.loadClip("external_image.jpg", containerMC);

function onSourceSelect(sourceMC : MovieClip) {
picWidth = sourceMC._width;
realPicHeight = sourceMC._height;
cylPicHeight = realPicHeight * Math.cos(phi);
sliceWidth = picWidth / numSlices;
sector = picWidth / topBa***Rad;
theta = 1.5 * Math.PI - 0.5 * sector;
deltaTheta = sector / numSlices;
topPicY = topBase._y + 0.5 * (cupHeight - cylPicHeight);
bottomPicY = topPicY + cylPicHeight;
topPicRadDiff = BasesRadDiff * (bottomBase._y - topPicY) / cupHeight;
botPicRadDiff = BasesRadDiff * (bottomBase._y - bottomPicY) / cupHeight;
topPicXRadius = bottomBa***Rad + topPicRadDiff;
topPicYRadius = topPicXRadius * radRatio;
bottomPicXRadius = bottomBa***Rad + botPicRadDiff;
bottomPicYRadius = bottomPicXRadius * radRatio;
sourceBitmap = new BitmapData(picWidth, realPicHeight, false, 0xFFFFFFFF);
sourceBitmap.draw(sourceMC);
cylPictureMC._x = topBase._x;
cylPictureMC._y = topPicY;

drawCylPicture();
};




function drawCylPicture() {
cylPictureMC.clear();
curTheta = theta;
for (i = 0; i < numSlices; i++) {
if (curTheta < rightTheta) {
xtopleft = topPicXRadius * Math.cos(curTheta);
ytopleft = - topPicYRadius * Math.sin(curTheta);
xbottomleft = bottomPicXRadius * Math.cos(curTheta);
ybottomleft = cylPicHeight - bottomPicYRadius * Math.sin(curTheta);
xtopright = topPicXRadius * Math.cos(curTheta + deltaTheta);
ytopright = - topPicYRadius * Math.sin(curTheta + deltaTheta);
xbottomright = bottomPicXRadius * Math.cos(curTheta + deltaTheta);
ybottomright = cylPicHeight - bottomPicYRadius * Math.sin(curTheta + deltaTheta);

cylMatrix = new Matrix(
(xtopright - xtopleft) / sliceWidth, // x scale
(ytopright - ytopleft) / sliceWidth, // y skew
(xbottomleft - xtopleft) / cylPicHeight, // x skew
(ybottomleft - ytopleft) / realPicHeight, // y scale
xtopleft - i * (xtopright - xtopleft), // tx
ytopleft - i * (ytopright - ytopleft) // ty
);
cylPictureMC.beginBitmapFill(sourceBitmap, cylMatrix, false, false);
cylPictureMC.moveTo(xtopleft, ytopleft);
cylPictureMC.lineTo(xtopright, ytopright);
cylPictureMC.lineTo(xbottomright, ybottomright);
cylPictureMC.lineTo(xbottomleft, ybottomleft);
cylPictureMC.endFill();
curTheta += deltaTheta;
}
}
updateAfterEvent();
};


cylPictureMC.onPress = function() {
var prevX : Number = _root._xmouse;
var newX : Number = _root._ymouse;
onMouseMove = function() {
newX = _root._xmouse;
_root.theta += (newX - prevX)/100;
prevX = newX;
if (_root.theta < _root.leftTheta) {
_root.theta = _root.leftTheta;
}
_root.drawCylPicture();
};
};

cylPictureMC.onRelease = cylPictureMC.onReleaseOutside = function() {
delete onMouseMove;
};

}
 

پیوست ها

  • Cylindrical Image - External.zip
    53.6 کیلوبایت · بازدیدها: 80

massoudn

کاربر فعال
3d Spin With Break

Effect
.
True
perspecitve
(shape distorts for
3D perspective)
.
Approximate
perspecitve
(goes a bit wild)
 

پیوست ها

  • 3d_spin_with_break (2).zip
    25.4 کیلوبایت · بازدیدها: 61

massoudn

کاربر فعال
Image Box - XML GALLERY

Preloader
onSelfEvent (load) { easing = .6;
}
onFrame (1, afterPlacedObjectEvents) {
setLabel("start");
}
onFrame (5) {
stop();
}
onFrame (10, afterPlacedObjectEvents) {
setLabel("preloader");
}
onFrame (11, afterPlacedObjectEvents) {
p = _parent.container.percentLoaded();
percent = p+"";
loaded_percent = _parent.container.getPercentLoaded();
if (_parent._container.getBytesLoaded() >= 100) {
loaderbar._xscale = Math.approach(loaderbar._xscale, loaded_percent, easing);
}
if (loaded_percent >= 100 && _parent.container.getBytesLoaded() >= 100) {
gotoAndPlay("start");
_parent.cover.gotoAndPlay("coverout");
}
}
onFrame (12, afterPlacedObjectEvents) {
prevFrameAndPlay();
}
onFrame (19) {
stop();
}
Scroll Sprit
onSelfEvent (load) { message="Loading...";
this.setMask(mask);
check = content._height;
status="none";
H=0;
runrate=0;
ml = new Object();
//activates the mouse listener.
ml.onMouseWheel = function(delta) {
y = delta;
}
Mouse.addListener(ml);
mh=mask._height;
//---------------------------------------------------------
//CUSTOMISABLE SETTINGS
ease = 0.5;
//Set the desired EASE rate here.
S = 90;
//set the desired SCROLL speed here.
ss = 10;
//set the scroll speed on button presses.
qs = 10;
//Set the desired quick scroll speed on track press.
//-----------------------------------------------------------
}
onFrame (1) {
trackheight=_parent.drag.track._height-1;
//This calculates the drag track range
// according to the height you set it to.
//This calculates the scroll parameters
t = content._height;
H = t - mh;
runrate=(trackheight-1) - _parent.drag.drag._height;
//This code hides the scroll bars and arrows if the text file is to small so their not needed.
if (H<1) {
_parent.drag._visible=false;
_parent.up._visible=false;
_parent.down._visible=false;
text1._y=0;
}
else {
_parent.drag._visible=true;
_parent.up._visible=true;
_parent.down._visible=true;
}
}
onFrame (2) {
//This checks that the info is loaded
//and the calculations complete before proceeding
if (t<check plus 10) {
gotoAndPlay(1);
}
}
onFrame (3) {
//The following code is looking to see if the mousewheel has moved
//and in which direction. Then moves the text as applicable.
if (y > 0) {
(content._y = content._y + S);
}
if (y < 0) {
(content._y = content._y - S);
}
//The following lines move the content depending on the status
if (status=="quickdown" && _parent.drag.mousecursor > _parent.drag.drag._y plus _parent.drag.hit) {
content._y -= qs;
}
if (status=="down") {
content._y -= ss;
}
if (content._y < -(H plus 1)) {
content._y = -H;
}
if (status=="quickup" && _parent.drag.mousecursor < _parent.drag.drag._y) {
content._y += qs;
}
if (status=="up") {
content._y += ss;
}
if (content._y > 0) {
content._y = 0;
}
if (status=="dragging") {
a = -_parent.drag.drag._y;
content._y-=(b*a), content._y*=ease, content._y+=(b*a);
}
//This code moves the drag bar unless its being dragged
if (status!="dragging") {
b = H/runrate;
c=content._y/b;
_parent.drag.drag._y= -c;
y=0;
}
}
onFrame (4) {
gotoAndPlay(3);
}
Content
onSelfEvent (load) { eval("clientsprite"+i)._x = xx;
eval("clientsprite"+i)._y=i*72+0;
if (i<500) {
eval("clientsprite"+i).tot.text = ""+(i+1);
}
else {
eval("clientsprite"+i).trackid.text = i+1;
}
eval("clientsprite"+i).numero = i;
hor=100;
ver=70;
content._visible=false;
portofolio = new XML();
portofolio.ignoreWhite = true;
portofolio.load("XMLimagebox.xml");
portofolio.onLoad = function(success) {
if (success) {
_root.total = this.firstChild.childNodes.length;
for (i=0; i<_root.total; i++) {
gallery.duplicateMovieClip("clientsprite"+i,i);
eval("clientsprite"+i)._x=(hor)*(i % 4);
eval("clientsprite"+i)._y=(ver)*Math.floor(i / 4);
eval("clientsprite"+i).name.txt = this.firstChild.childNodes.attributes.name;
eval("clientsprite"+i).img.loader.load.loadMovie(this.firstChild.childNodes.attributes.thumb);
eval("clientsprite"+i).somevar = (this.firstChild.childNodes.attributes.image);
total = _root.total;
}
}
}
clientsprite._visible = false;
}
onSelfEvent (enterFrame) {
//if the scroller is needed, display it
if (total > 12) {
_parent._parent.drag._visible = true;
}
else {
_parent._parent.drag._visible = false;
}
}
onFrame (10) {
_parent._parent._parent.container.loadMovie(clientsprite0.somevar);
_parent._parent._parent.cover.gotoAndPlay("coverout");
stop();
}

.
XML
HTML:
<?xml version="1.0" encoding="iso-8859-1"?><portofolio>	<entry		name="THUMB1"                thumb="images/th-image1.jpg"		image="images/image1.jpg"	/>	<entry		name="THUMB2"                thumb="images/th-image2.jpg"		image="images/image2.jpg"	/>	<entry		name="THUMB3"                thumb="images/th-image3.jpg"		image="images/image3.jpg"	/>	<entry		name="THUMB4"                thumb="images/th-image4.jpg"		image="images/image4.jpg"	/>	<entry		name="THUMB5"                thumb="images/th-image5.jpg"		image="images/image5.jpg"	/>	<entry		name="THUMB6"                thumb="images/th-image6.jpg"		image="images/image6.jpg"	/>	<entry		name="THUMB7"                thumb="images/th-image7.jpg"		image="images/image7.jpg"	/>	<entry		name="THUMB8"                thumb="images/th-image8.jpg"		image="images/image8.jpg"	/>	<entry		name="THUMB9"                thumb="images/th-image9.jpg"		image="images/image9.jpg"	/>	<entry		name="THUMB10"                thumb="images/th-image10.jpg"		image="images/image10.jpg"	/>	<entry		name="THUMB11"                thumb="images/th-image11.jpg"		image="images/image11.jpg"	/>	<entry		name="THUMB12"                thumb="images/th-image12.jpg"		image="images/image12.jpg"	/>	<entry		name="THUMB13"                thumb="images/th-image1.jpg"		image="images/image1.jpg"	/>	<entry		name="THUMB14"                thumb="images/th-image2.jpg"		image="images/image2.jpg"	/>	<entry		name="THUMB15"                thumb="images/th-image3.jpg"		image="images/image3.jpg"	/>	<entry		name="THUMB16"                thumb="images/th-image4.jpg"		image="images/image4.jpg"	/>	<entry		name="THUMB17"                thumb="images/th-image5.jpg"		image="images/image5.jpg"	/>	<entry		name="THUMB18"                thumb="images/th-image6.jpg"		image="images/image6.jpg"	/>	<entry		name="THUMB19"                thumb="images/th-image7.jpg"		image="images/image7.jpg"	/>	<entry		name="THUMB20"                thumb="images/th-image8.jpg"		image="images/image8.jpg"	/>	<entry		name="THUMB21"                thumb="images/th-image9.jpg"		image="images/image9.jpg"	/>	<entry		name="THUMB22"                thumb="images/th-image10.jpg"		image="images/image10.jpg"	/>	<entry		name="THUMB23"                thumb="images/th-image11.jpg"		image="images/image11.jpg"	/>	<entry		name="THUMB24"                thumb="images/th-image12.jpg"		image="images/image12.jpg"	/>	<entry		name="THUMB25"                thumb="images/th-image1.jpg"		image="images/image1.jpg"	/>	<entry		name="THUMB26"                thumb="images/th-image2.jpg"		image="images/image2.jpg"	/>	<entry		name="THUMB27"                thumb="images/th-image3.jpg"		image="images/image3.jpg"	/>	<entry		name="THUMB28"                thumb="images/th-image4.jpg"		image="images/image4.jpg"	/>	<entry		name="THUMB29"                thumb="images/th-image5.jpg"		image="images/image5.jpg"	/>	<entry		name="THUMB30"                thumb="images/th-image6.jpg"		image="images/image6.jpg"	/>	<entry		name="THUMB31"                thumb="images/th-image7.jpg"		image="images/image7.jpg"	/>	<entry		name="THUMB32"                thumb="images/th-image8.jpg"		image="images/image8.jpg"	/>	<entry		name="THUMB33"                thumb="images/th-image9.jpg"		image="images/image9.jpg"	/>	<entry		name="THUMB34"                thumb="images/th-image10.jpg"		image="images/image10.jpg"	/>	<entry		name="THUMB35"                thumb="images/th-image11.jpg"		image="images/image11.jpg"	/>	<entry		name="THUMB36"                thumb="images/th-image12.jpg"		image="images/image12.jpg"	/>

	
</portofolio>
 

پیوست ها

  • imagebox2011.zip
    360.9 کیلوبایت · بازدیدها: 118

massoudn

کاربر فعال
Filter Transtion Examples

Cautionradiation
Glow Filter
.
Image Transition Example
Color Matrix + Convolution
.
Image Transitons
Color Matrix
.
Text Transition Example
Glow
 

پیوست ها

  • filtertranstionexamples.zip
    218.3 کیلوبایت · بازدیدها: 89

massoudn

کاربر فعال
Export To Image

بعداز upload فایل های پیوست در سرور،
و بعداز فشردن دکمه زرد رنگ، صفحه جدیدی ملاحظه خواهد گردید که تصویری از صفحه نمایش داده شده بصورت Snapshot گرفته و قابلیت ذخیره با فرمت jpg داشته که توسط فای php همراه، می توان آن را بصورت mail نیز ارسال نمود.
.
Scene
function read(obj){ for (var y = 0; y<=obj.height; y++) {
var tmp = obj.getPixel(obj.xx,y).toString(16);
pixels.push(tmp);
}
tr.text=pixels.length;
percentage=obj.xx*100/obj.width;
progress._xscale=cur.text=Math.floor(percentage);
if(obj.xx>=obj.width){
clearTimeout(timeot);
var output:LoadVars = new LoadVars();
output.height = obj.height;
output.width = obj.width;
output.img = pixels.toString();
output.bestemmeling = destinee;
output.send("send.php","_blank");
return false;
}else { obj.xx++;timeot=setTimeout(read,5,snap)}
}
onSelfEvent (load) {
destinee="Send to";
clip.whatever="Add your comment here..."
}


function output() {
row=0;
snap = new flash.display.BitmapData(clip._width, clip._height);
snap.draw(clip);
this.pixels = new Array();
snap.xx=0
isbusy=false;
read(snap)
}
onFrame (2) {
stop();
}
Des - input email address
onSelfEvent (load) { this._text.onSetFocus=function(){
if (this.text=="Send to"){
this.text=""; }
else{
this.text=this.text; }};



this._text.onKillFocus=function(){
if (this.text==""){
this.text="Send to"; }
else{
this.text=this.text; }

};
}
Input Text Comment
onSelfEvent (load) { this._text.onSetFocus=function(){
if (this.text=="Add your comment here..."){
this.text=""; }
else{
this.text=this.text; }};



this._text.onKillFocus=function(){
if (this.text==""){
this.text="Add your comment here..."; }
else{
this.text=this.text; }

};
}
send.php
[PHPS]
<?php $data = explode(",", $_POST['img']);
$width = $_POST['width'];
$height = $_POST['height'];
$email = "[email protected]";
$bestemmeling = $_POST['bestemmeling'];
$image=imagecreatetruecolor( $width ,$height );
$background = imagecolorallocate( $image ,0 , 0 , 0 );
//Copy pixels
$i = 0;
for($x=0; $x<=$width; $x++){
for($y=0; $y<=$height; $y++){
$int = hexdec($data[$i++]);
$color = ImageColorAllocate ($image, 0xFF & ($int >> 0x10), 0xFF & ($int >> 0x8), 0xFF & $int);
imagesetpixel ( $image , $x , $y , $color );
}
}

//Output image and clean

$ran = rand () ;
$ran2 = $ran.".";
$target = $ran2."jpg";
ImageJPEG( $image,$target );//save as
imagedestroy( $image );
chmod($target,0777);


$onderwerp ="Your creation";
$headers = "From: <".$email.">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$bericht = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\r\n";
$bericht .= "<HTML><HEAD><TITLE>E-mail verzenden als HTML</TITLE>\r\n";
$bericht .= "<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n";
$bericht .= "<STYLE>BODY {MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 25px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica}</STYLE>\r\n";
$bericht .= "<BODY bgcolor=\"#ffffff\">\r\n";
$bericht .= "<DIV>&nbsp;</DIV>\r\n";
/////// ATTENTION ////////


$bericht .= "<DIV><img alt=\" \" border=\"0\" src=\"http://www.vics.be/Exporttoimage/".$target."\"</DIV>\r\n";///////change here the location of the image to be embedded >>> http://www.vics.be/Exporttoimage/
////// ********************//////
$bericht .= "<DIV>This file has been saved on the server as <a href='http://www.vics.be/Exporttoimage/".$target."' title='Link to saved image'>".$target."</a></DIV>\r\n";
$bericht .= "</BODY></HTML>\r\n";


mail($bestemmeling,$onderwerp, $bericht,$headers);



print "<html>
<head>
<title>Rendered Movieclip Converted To JPEG</title>
</head>
<body bgColor='cccccc'>
<center>
SWF Movieclip Converted To JPEG Using PHP and GD,<br>
has been send to ".$bestemmeling.".
<p><img src='".$target."'></p>
</center>
</body>
</html>
";


print "<br>This file has been saved on the server as <a href='http://www.vics.be/Exporttoimage/".$target."' title='Link to saved image'>".$target."</a><br>";
//print "<br>This file has been saved on the server as ".$target."<br>";

?>[/PHPS]
 

پیوست ها

  • Export To Image.zip
    116.4 کیلوبایت · بازدیدها: 73

massoudn

کاربر فعال
on Date

بعداز مشخص نمودن فاصله زمانی بین دو تاریخ مشخص،
دو پیغام مجزا داده میشود،
1. اینکه در بازه زمانی هستید،
2. خارج از بازه زمانی قرار دارید.
.
on Date - Movie Clip
onSelfEvent (load) { myDate = new Date();
thisDate = myDate.getDate();
thisMonth = myDate.getMonth() plus 1;
thisYear = myDate.getFullYear();


if (thisDate < 10) {
thisDate = ("0"+thisDate);
}
if (thisMonth < 10) {
thisMonth = ("0"+thisMonth);
}
today = thisYear add thisMonth add thisDate;

EndDate = "";
loadVariables("text.txt");
}


onFrame (3) {
//check if loaded
if (EndDate == "") {
}
}


onFrame (5) {
if(today >= StartDate && today <= EndDate){
info = "you're in the daterange";
}else{
info = "you're outside the daterange";
}
stop();
}
 

پیوست ها

  • onDate.zip
    14.7 کیلوبایت · بازدیدها: 38

massoudn

کاربر فعال
Seasons

تعیین 4 فصل سال،
بارگزاری 4 فایل swf بعنوان 4 پیغام با نام فصل جاری.
.
Scene
onSelfEvent (load) { theDate = new Date();
month = theDate.getMonth()+1;
day = theDate.getDate();
if (month<4) {
if (month<3) {
loadMovieNum("winter.swf",2);
}
else if (month==3&&day<21) {
loadMovieNum("winter.swf",2)
}
else if (month==3&&day>20) {
loadMovieNum("spring.swf",2);
}
}
else if (month<7) {
if (month<6) {
loadMovieNum("spring.swf",2);
}
else if (month==6&&day<21) {
loadMovieNum("spring.swf",2)
}
else if (month==6&&day>20) {
loadMovieNum("summer.swf",2);
}
}
else if (month<10) {
if (month<9) {
loadMovieNum("summer.swf",2);
}
else if (month==9 &&day<21) {
loadMovieNum("summer.swf",2);
}
else if (month==9&&day>20) {
loadMovieNum("autumn.swf",2);
}
}
else if (month < 13) {
if (month<12) {
loadMovieNum("autumn.swf",2);
}
else if (month==12&&day<21) {
loadMovieNum("autumn.swf",2);
}
else if (month==12&&day>20) {
loadMovieNum("winter.swf",2);
}
}
}
 

پیوست ها

  • seasons.zip
    5.1 کیلوبایت · بازدیدها: 39

massoudn

کاربر فعال
img save as right click

در حالت آنلاین (مرتبط با سرور) یا در حالت تست کار در نرم افزار (Paly Movie) پس از کلیک راست بر روی هر یک از تصاویر موجود در Scene می توان آنها را بصورت تصویر با فرمت jpg بر روی فضایی مشخص (مثلا هارد دیسک) ذخیره نمود.
.
Scene
onSelfEvent (load){
import flash.net.FileReference;
var fileRef : FileReference = new FileReference();
//settings start
var url_1 : String = "http://www.google.com/logos/2011/africaday11-hp.jpg"; //url to open when right click image 1
var url_2 : String = "http://www.google.com/logos/2011/paraguay11-hp.jpg"; //url to open when right click image 2
//var url_3.. etc..
var name_file_1 : String = "Africa_day_logo_Google.jpg"; //name to be displayed when save image 1
var name_file_2 : String = "Paraguay_logo_Google.jpg"; //name to be displayed when save image 2
//var name_file_3.. etc..
var message_stage : String = "Stage menu" ////text displayed when right click ton stage
var message_mc : String = "Save as"; //text displayed when right click the image's in the movieclip
//settings done


//code stage menu
var my_cmi : ContextMenu = new ContextMenu();
my_cmi.hideBuiltInItems();
this.menu = my_cmi;
var start_cmi = new ContextMenuItem(message_stage, stage_url); //display the stage message and call the stage_url function
my_cmi.customItems.push(start_cmi);
}
function stage_url ()
{
getURL("http://www.swishzone.com", "_blank"); //url to open when right click on stage
}
function save_as_box (the_url,name_file)
{
if(!fileRef.download(the_url, name_file))
{
trace("dialog box failed to open.");
}
}
Africa
onSelfEvent (load){
//code movieclip menu
var my_cmi : ContextMenu = new ContextMenu();
my_cmi.hideBuiltInItems();
var start_cmi : ContextMenuItem = new ContextMenuItem(_root.message_mc);
start_cmi.onSelect = function()
{
_root.save_as_box(_root.url_1,_root.name_file_1) //url1 and name_file_1
};
my_cmi.customItems.push(start_cmi);
this.menu = my_cmi;
}
Paraguay
onSelfEvent (load){
//code movieclip menu
var my_cmi : ContextMenu = new ContextMenu();
my_cmi.hideBuiltInItems();
var start_cmi : ContextMenuItem = new ContextMenuItem(_root.message_mc);
start_cmi.onSelect = function()
{
_root.save_as_box(_root.url_1,_root.name_file_1) //url1 and name_file_1
};
my_cmi.customItems.push(start_cmi);
this.menu = my_cmi;
}
 

پیوست ها

  • img save as right click.zip
    55.9 کیلوبایت · بازدیدها: 47

massoudn

کاربر فعال
به مناسبت گذشت 777 روز از ایجاد این پست، (معرفی یکی از نمونه کارهای Multimedia خودم).

به علت حجم فایل، امکان upload کامل Multimedia Cd وجود نداشت،
asset.php

بقیه تصاویر در فایل ضمیمه.
 

پیوست ها

  • Multimedia Cd.zip
    1.4 مگایابت · بازدیدها: 209
  • 1.jpg
    1.jpg
    182.8 کیلوبایت · بازدیدها: 25
آخرین ویرایش:

massoudn

کاربر فعال
فیلم های آموزش Swish Max از سایت swishblade.com - بخش اول

بعلت محدودیت در ارسال ضمائم و تصاویر در یک پست،
آموزش در چند بخش ارائه میگردد.
.
SwishMax - The Designers Edge Series
.
3D Text
3D Text.jpg
Watch Now
Download Video and Source File
Size: 15.32 MB
.
Plasma
Plasma.jpg
Watch Now
Download Video and Source File
Size: 09.79 MB
.
Spinning Arrow
Spinning Arrow.jpg
Watch Now
Download Video and Source File
Size: 03.94 MB
.
Seperating Image elements
Seperating Image elements.jpg
Watch Now
Download Video File
Size: 05.25 MB
.
Glass Buttons
Glass Buttons.jpg
Watch Now
Download Source File
Size: 05.14 KB
 

massoudn

کاربر فعال

massoudn

کاربر فعال
Stair Calorie Calculator - حسابگر میزان کالری مصرفی

Stair Calorie Calculator.jpg
نمونه سایت اندازه گیری کاری مواد

.
Scene
function Events(n,v) { const KG2LB=2.2; // conversion of kg to lbs
const KCAL2KJ=4.184; // conversion of kcal to kJ (conversion is for Thermochemical calorie)
const G=9.8; // acceleration due to gravity
const HPF=4; // height per flight in meters


// trace("Events " add n add "," add v);
if (n == "Button_" || n == "mode") {
if (1 == weightunits) {
kg = Number(weight.text);
} else {
kg = Number(weight.text) / KG2LB; // convert lbs to kg
}
if (1 == mode) {
// calculate based on physics (mass*g*height)
// mass in kg * gravity * height (flights *4) / 1000 to convert to kJ
kJ = kg*G*Number(height.text)*HPF/1000;
} else {
// calculate based on New Hampsire Department of Health and Human Services
// formula is based on 5 kcal per flight for 150lb person.
// calculate in kcal and convert to kJ
// convert weight back to lbs then make proportional to 150lb referece weight.
kcal = 5*Number(height.text)*kg*KG2LB/150;
kJ=kcal*KCAL2KJ;
}
kJtext = MathUtil.format(kJ, "f12.2");
kcaltext = MathUtil.format(kJ/KCAL2KJ, "f12.2");
result.text = kJtext add " kJ " add newline add kcaltext add " kcal";
} else if (n == "weightunits") {
// update weight field to show revised units
if (v == 2) {
// now units in lbs
weight.text = Number(weight.text)*KG2LB;
} else {
// now units in kg
weight.text = Number(weight.text)/KG2LB;
}
}

}

MathUtil
function format(n,fmt){
// interface function
// display number n according to format in fmt
// format is subset of C format notation
// [0][-][+][$][']<f|g|e>[DD][.ddd]
// [0] pad with leading 0's
// [-] align to left edge of field (DD spaces) takes precedence over [0]
// [+] force display of + sign with positive numbers.
// [$] show leading $ sign
// ['] insert commas into integer section of number.
// f show number as floating point number. DD is total field width .ddd is fraction size.
// g same as f but converts to e notation if number does not fit.
// e show number in scientific notations. eg 6.023e+23

// trace("calling this.format_utils.format(n,fmt)");
return this.format_utils.format(n,fmt);
}


function setprecision(n)
{
// interface function sets rounding limit.
return this.format_utils.setprecision(n);
}


function calculate(str)
{
// interface function
/*
Evaluates an expression or expresions.
eg. x=0.3;y=sin(x)/x


expressions are separated by a ;
The value of the last expression is returned.


variables remain for the scope of the movie.

uses the following precedence


numeric constant, variable or function (processed by item())
- (unary as in negation), ()
^ (power)
* / (multiply, divide)
+ - (add, subtract)


supported functions:
sin, cos, tan, sindeg, cosdeg, tandeg (deg version take degree arguments)
asin, acos, atan, asindeg, acosdeg, atandeg (deg versions return degrees)
ln, exp (natural log and e to the power of x)
log, exp10 (base 10 log and power)
sqrt (square root)
rand(x) returns random number 0 <= n < x
int, frac returns integer and fractional parts of a number.


constants:
pi
ln10 (natural log of 10)
*/
return this.expression.calculate(str);
}
RadioButton_lbs
onSelfEvent (load) { if (_parent[parameters.GroupName] == undefined) {
_parent[parameters.GroupName] = parameters.Value;
}
}
onSelfEvent (release) {
_parent[parameters.GroupName] = parameters.Value;
// ============================================================
// Calls the named "OnClick" function and sends two arguments:
// 1. The "GroupName"
// 2. The "Value"
// ============================================================
_parent[parameters.OnClick].call(_parent,parameters.GroupName,parameters.Value);
}
onSelfEvent (enterFrame) {
Check.Tick._visible = _parent[parameters.GroupName] == parameters.Value;
}
RadioButton_kg
onSelfEvent (load) {
if (_parent[parameters.GroupName] == undefined) {
_parent[parameters.GroupName] = parameters.Value;
}
}
onSelfEvent (release) {
_parent[parameters.GroupName] = parameters.Value;
// ============================================================
// Calls the named "OnClick" function and sends two arguments:
// 1. The "GroupName"
// 2. The "Value"
// ============================================================
_parent[parameters.OnClick].call(_parent,parameters.GroupName,parameters.Value);
}
onSelfEvent (enterFrame) {
Check.Tick._visible = _parent[parameters.GroupName] == parameters.Value;
}
RadioButton_deptofhealth
onSelfEvent (load) {
if (_parent[parameters.GroupName] == undefined) {
_parent[parameters.GroupName] = parameters.Value;
}
}
onSelfEvent (release) {
_parent[parameters.GroupName] = parameters.Value;
// ============================================================
// Calls the named "OnClick" function and sends two arguments:
// 1. The "GroupName"
// 2. The "Value"
// ============================================================
_parent[parameters.OnClick].call(_parent,parameters.GroupName,parameters.Value);
}
onSelfEvent (enterFrame) {
Check.Tick._visible = _parent[parameters.GroupName] == parameters.Value;
}
RadioButton_physics
onSelfEvent (load) {
if (_parent[parameters.GroupName] == undefined) {
_parent[parameters.GroupName] = parameters.Value;
}
}
onSelfEvent (release) {
_parent[parameters.GroupName] = parameters.Value;
// ============================================================
// Calls the named "OnClick" function and sends two arguments:
// 1. The "GroupName"
// 2. The "Value"
// ============================================================
_parent[parameters.OnClick].call(_parent,parameters.GroupName,parameters.Value);
}
onSelfEvent (enterFrame) {
Check.Tick._visible = _parent[parameters.GroupName] == parameters.Value;
}
 

پیوست ها

  • staircalculator.zip
    69.9 کیلوبایت · بازدیدها: 29

michealwiper

Active Member
تعیین اندازه و مکان یک شیء در صفحه نمایش بصورت هوشمند
.
گاهی اوقات لازم است شیء یا اشیائی که در scene انتخاب می نماییم،
در حالت ثابت یا متغیر قرار گیرند،
در فایل پیوست نمونه ای از تعیین پیش فرض محل قرار گیری اشیاء در صفحه نمایش، نشان داده شده است،
که بنا به نیاز می توان متغیر های ذکر شده را تغییر داد،
تا در هر monitor یا سیستم عاملی طبق برنامه ریزی قبلی مستقر شوند.


درمورد این مطلب میخاستم بدونم که چرا نمیشه اون عکس بک گراند رو تغییر داد

من هرچند بار که امتحان کردم و به اسکریپتاش سرزدم شاید بتونم ازونجا کاری انجام بدم ولی نشد. نمیدونم مشکل چیه
حتی عکس جدید رو با همون ابعاد و مشخصات اسمشو که عوض میکنم بازهم نمیشناسش ؟ با اینکه عکسی رو که گزاشتی پاکش میکنم ولی درست کار نمیکنه

فقط نمیدونم که چرا در قسمت تراسفورم عکسی رو که گزاشتی X_ و Y_ اش جفتشون 0 هستن ولی عکسی رو که من میبرم اونجا اون گوشه و با Align حتی مرتبش میکنم بازم 0 نمیشه

نمیدونم مشکل از چیه دیگه
 

massoudn

کاربر فعال
درمورد این مطلب میخاستم بدونم که چرا نمیشه اون عکس بک گراند رو تغییر داد

من هرچند بار که امتحان کردم و به اسکریپتاش سرزدم شاید بتونم ازونجا کاری انجام بدم ولی نشد. نمیدونم مشکل چیه
حتی عکس جدید رو با همون ابعاد و مشخصات اسمشو که عوض میکنم بازهم نمیشناسش ؟ با اینکه عکسی رو که گزاشتی پاکش میکنم ولی درست کار نمیکنه

فقط نمیدونم که چرا در قسمت تراسفورم عکسی رو که گزاشتی X_ و Y_ اش جفتشون 0 هستن ولی عکسی رو که من میبرم اونجا اون گوشه و با Align حتی مرتبش میکنم بازم 0 نمیشه

نمیدونم مشکل از چیه دیگه[/B]
سلام،
دوست عزیز،
پیرو یادداشتها و مثالهای قبلی،
بنظر میرسد در بخش Transform (تصویر پیوست)، بطور صحیح محل قرارگیری و transformation point's position را تعیین ننموده اید،
Untitled.jpg
مطابق تصویر x position و y position را مشخص نمائید،
موفق باشید.
 

michealwiper

Active Member
سلام،
دوست عزیز،
پیرو یادداشتها و مثالهای قبلی،
بنظر میرسد در بخش Transform (تصویر پیوست)، بطور صحیح محل قرارگیری و transformation point's position را تعیین ننموده اید،
مشاهده پیوست 95407
مطابق تصویر x position و y position را مشخص نمائید،
موفق باشید.

اینکارو من دقیق انجام دادم ولی نمیدونم چرا نمیشه

این عکساروهم میزارم ببین مشما آیا دستوری رو اشتب وارد کردم یا اینکه شکل درست نیست یا هر چیز دیگه که من نمیدونم

attachment.php



اینم عکس دومیش

attachment.php










2.JPG
 

پیوست ها

  • 1.JPG
    1.JPG
    42.9 کیلوبایت · بازدیدها: 142

جدیدترین ارسال ها

بالا