Neuigkeiten
Archiv durchsuchen | Externe Bild-Übergänge - Teil 3 |
| Sunday, 18. March 2007 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Ok, ok... das sollte eigentlich niemals soweit gehen, aber lasst es uns tun! Wir veröffentlichten unseren ersten Artikel um das Problem mit der Tiles-Komponente und dem Laden von externen Bildern zu lösen. In der Zwischenzeit haben wir viele Fragen erhalten für mögliche Erweiterungen mit unserem Beispiel. Ich wollte nur eine Lösung aufzeigen anstelle ein neues "Projekt" anzubieten. Die Bilder sind von dem DeviantArt.com Mitglied lonelywolf2. Danke für das Bereitstellen solch fantastischer Bilder.
QuelltextDownload
Trackback(0)
Kommentare (33)
![]()
Marlon
said:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WOW, really nice one. Nice works man. Congratz ![]() |
| cool stuff. kompliment hast du wirklich schön gemacht! best, Marc |
| but when image size < flash size image is not full screen flash change this line can solve problem before bmpTarget.draw(bmpSource, mtxScale, new ColorTransform(), "normal", bmpSource.rectangle, true); after imgrectangle=new rectangle(0,0,Stage.width,Stage.height) bmpTarget.draw(bmpSource, mtxScale, new ColorTransform(), "normal", imgrectangle, true); thanks i am sorry for poor english |
| Please inform how to make different album categories. Eg 1 Cars 2 Bikes 3 Beach |
| Cool, existe any way to show a random imgs? |
| @CHums Crumb: The file "ImageList.xml" inside the package contains all meta information for the slideshow. The root node "album" has the attribute "title" which defines it. Currently the example just uses a single album which is used for demonstration. If you would like to use more you have just to extend the source files. @Marlon: For sure! Just edit the URL variable of the "ExternalTransition3.fla" which points to the "ImageList.xml". You can also call a PHP, ASP, CGI or other script which produces a XML content with the common structure or a custom one which has to be parsed from Flash in another way. |
| @Erik , what the right way for this variable? thx |
| I dont know, but seems it is : // Index of currently shown image var intSourceIndex:Number = -1; // Index of next shown image var intTargetIndex:Number = -1; |
@Erik i am lost I dont know where start hehe. Can u show me a exemple maybe? thanks ![]() |
| Hi Marlon, what kind of random do you like to have? A random played slideshow or a random source of pictures? Both is possible but the one is solved by editing the ActionScript code the other by altering AS code and building a dynamic source. |
| wirklich gute arbeit. so einen script hab ich noch nie gesehen und irgendwie krieg ich nicht raus, wo die effekte erzeugt werden. ich wollte die "zerbrösel" effekte raus nehmen und ne einfache überblendung erzeugen jedoch blick ich einfach nicht durch. könnt ihr mir helfen? ich möchte nur keine übergangseffekte. der rest soll bleiben. das mit den thumbs ist genial und dann auch noch alles mit xml. alles was zur vollkommenheit fehlen würde, wäre dass man author und url auch für jedes bild definieren kann... aber das werde ich glaub ich selber hinkriegen. erbitte antwort mfg daft |
| well, a random source of pictures. But a don't know how do it. Can u maybe help me on it? Thanks |
| I don't know about your skills in server-side programming like PHP but here's a link to a sample http://de3.php.net/manual/en/function.readdir.php how you can dynamically create a list of files in a specific directory. You just have to rewrite that so it'll build a valid xml output similar to the "ImageList.xml". Then modify the URL inside your ActionScript code where it generally points to the "ImageList.xml" and set it to the URL of the PHP script. |
| ohh, isn't possible by action scritp? Erik I was looking in "Flash 8 Component: Tile Transitions" post by satori and Colin Campbell Replied a random metod: ----------------------------------------------------- Random Image work around : ----------------------------------------------------- ----------------------------------------------------- var array_1:Array = new Array("img01","img02", "img03", img04); var array_2:Array = new Array("start_image"); var img_count = 1; clip.setImageArray(array_2); function randomImage() { if (img_count == 2) img_count = 0; array_2 if (img_count == 0) clip.getNextImage(); else clip.getPreviousImage(); img_count ; } clip.randomImage(); setInterval(randomImage, 6000); ----------------------------------------------------- The problem is i dont know how to implement it in yr script. Maybe u can look into it. Thanks anyway. |
| No, this is just for random image selection not a random source of images. This is much easier... movSmartTile: replace both lines with the one below this.attachBitmap(_root.getImage(),0); _root: replace the alter the function with the lines below function getImage():BitmapData{ var intIndex:Number = random(aryBitmaps.length); ... } I've not tested it yet but it should work as expected with a random image of the list. |
ohh nice!!! i will test it cool thanks Erik! ![]() |
| Erik, the randomic works fine, it looks like i requested but when it call a new img a wrong transition backgroud appear. So the transition effect call different img. Code: root: // Random function getImage():BitmapData{ var intIndex:Number = random(aryBitmaps.length); var bmpSource:BitmapData = aryBitmaps[intIndex]; var bmpTarget:BitmapData = new BitmapData(Stage.width, Stage.height); var mtxScale:Matrix = new Matrix(); mtxScale.scale(Stage.width/bmpSource.width, Stage.height/bmpSource.height); bmpTarget.draw(bmpSource, mtxScale, new ColorTransform(), "normal", bmpSource.rectangle, true); return bmpTarget; } movSmartTile: if(_name.substr(0,1) == "_"){ // this.attachBitmap(_root.getImage(_root.intSourceIndex),0); this.attachBitmap(_root.getImage(),0); }else{ // this.attachBitmap(_root.getImage(_root.intTargetIndex),0);, this.attachBitmap(_root.getImage(),0); } |
| Marlon please try the following instructions with the original code: function TransRoot():Void{ // proof whether component is in use if(!transComp.isInTransit){ // Block inputs btnPrevious.enabled = false; btnNext.enabled = false; // Calculatur next image index intTargetIndex = random(aryBitmaps.length); // init effect transComp.getNextImage(); // Display title and details lblImage.text = (intTargetIndex 1) "/" aryImages.length " Title: " aryImages[intTargetIndex]["title"]; } } ... and also replace the calls of TransRoot so that no parameter is passed. I just forgot the two "integer" values which I used to define the indices. And if I read my code more exact I would have seen the comment with Calculatur next image index Sorry! |
| How we can change the width of transition effects? I loaded images of size 670 and changed the stage size to 670, but the transition component still shows the transition in rectangle of size 500 width. How to change that? |
| Hi Eric, This flash file s great! I was wondering if it's possible to add a link to each image passing by. So when you click a certain image it goes to the corresponding URL. Thx |
| I missed the answer to the previous post. How do you change the transition size to match a change to the stage size. For instance if I wanted to do 640 x 480 as my stage. cheers |
| Hello and sorry for the delay! @ICE and MARCO: Open the "movSmartTile" in the library and change the size of the transparent rectangle inside the layer to your favorite size or replace this by your own code snippet which has to draw a rectangle which is necessary as a placeholder. @SALVATORE: Not in the current version. For sure. I don't know how familiar you're with ActionScript but at least you havt to add a "link" attribute to each entry in the XML file. After this you have to parse and process it inside Flash. |
| I am having problems getting a preloader to work with this component. I noticed other people are having the same problems. I don't mean a preloader for each image, I just mean a preloader which comes before the component actually starts. I have tried all the simple preloaders I can find including the progressbar and they never appear or work properly. Anybody have an idea or have an example of a preloader working for this component? Thanks, Simon |
| Hello, I would like to see how all this works but I can't get to the source files.. when I try to download I see only some flash encoder or smth to download.. Is it possible I can get the fla and the xml from somewhere ? thanks |
| Hi Flame, sorry... the system linked the automatic generated URL to the "unicode panel". Should be fixed now! Thanks for the feedback! |
| Erik, Your revision is phenomenal, kudos to your dedication and skills. I do have question, however: I am looking to make my own transitions between images, but I cannot for the life of me discern how to create the tiles of a dynamically loaded image using Bitmap Data. Do you make as many copies of the bitmap image as you have tiles and offset a square mask to achieve the effect? I've studied both the original component and this version and I still have immense difficulty determining how it is done. Any assistance would be a godsend, Thank you |
| Hi EADOIN, first of all you'll have to know that since Flash 8 you should use BitmapData instead of copying MovieClips and do the old-school tricks with offsets and masks (Note: don't forget to dispose!) The BitmapData object is able to copy a specified rectangle of the source (bitmap, movie, etc...). This rectangle is used to do the offset because you can set attributes like: top, left, width and height. That's all and how this solution is done. Hope this helps! |
| Hi, Congratulations for the wonderful component. I'd like to know if is possible to use movie clips as a buttons, instead of flash component buttons that you are using. Thanks in advance, Helio |
| Hi Helio, yes... you can use whatever you want to no matter if the UI elements are components, movieclips or buttons. |
| I've tried, but I've couldn't accomplish it, maybe I'm doing something wrong... I've tried placing 2 movie clips instead buttons components that you're using, with the same name instances, but it doesn't work! Don't you have any working example using movie clips instead components buttons? Thanks in advance Best wishes, Helio |
| to change the size of the transparent rectangle, override the "createTiles" function in your root actions layer this is the function with variables mw & mh being my only changes to make the transparent rectangle the same size as the stage. // create tiles - overrides default myTransitionsComponentNameHere.clip.createTiles = function(s:String, w:Number, h:Number):Void { this._x = w/2 this._tileBuffer; this._y = h/2 this._tileBuffer; var m:MovieClip = this.attachMovie(s, "temp", this.getNextHighestDepth()); var mw:Number = Stage.width; // original value: m._width var mh:Number = Stage.height; // original value: m._height m.removeMovieClip(); var y = Math.ceil(mh/h); while (y--) { var x = Math.ceil(mw/w); while (x--) { m = this.attachMovie("FallingTile", "tile" this.getNextHighestDepth(), this.getNextHighestDepth()); m.addListener(this); m.setMaskSize(w this._tileBuffer*2, h this._tileBuffer*2); m.setImage(s); m._x = w * x; m._y = h * y; m.setOffset(m._x, m._y); m.setGravity(this._fadeRate); m.cacheAsBitmap = true; this._tileArray.push(m); } } }; |
| Hey Eric, Thanks for this nice component! I am having a black backround in my project and was wondering if I can change the initial background color before the first photo loads and while it animates in. It seems to be set to white and I would like to have it black. Thanks in advance! |
| Hi Chris, maybe the line 263 causes the mentioned color: -------------------------------------------------------- bmpThumb = new BitmapData(intThumbWidth, intThumbHeight, true, 0xFF990000); -------------------------------------------------------- The color is setup with the alpha channel that's the reason why it contains the leading "FF". Try to set it to 0x00000000. |
| < zurück | weiter > |
|---|
| unic8 Bugs |
| unic8 Labs |
| IT Consulting Lembke |
| etiCAT |
| FLOE |
| G-Nero |
| Scaena |
| U8 web widgets |
| Impressum |
| Datenschutzerklärung |