World: r3wp
[Rebol/Flash dialect] content related to Rebol/Flash dialect
older newer | first last |
james_nak 2-Mar-2006 [118] | I see. What I mean is taking an actionscript example and converting it to your dialect. Right now I'm trying to make a simple "slideshow" with fades and I found some actionscript examples. That being said, just you saying that the DoAction[] is somewhat like Actionscript takes some mystery out of the process. |
Oldes 2-Mar-2006 [119] | what do you want to convert? |
james_nak 2-Mar-2006 [120] | I'll have to look for it again...I left my memory stick at home/ |
Oldes 2-Mar-2006 [121] | And I should say, that you definitely must know the ActionScript, if you want to use my dialect. |
james_nak 2-Mar-2006 [122] | Yes, you're right. Up this point I was really looking at the wrong documentation so the Actionscript clue was helpful. Here's an example. I haven't tried to translate it yet. It looks pretty straight forward. Movieclip.prototype.fade = function(speed) { this.speed = speed; this.f_index = this._alpha; if(this.f_index >= 100) this.fade_by = -this.speed; if(this.f_index <= 0) this.fade_by = this.speed; this._alpha += this.fade_by; } Or you can use these to fadeIn() or fadeOut() Movieclip.prototype.fadeOut = function($decrement, $fadeLimit){ var $mcObject = this; //If $decrement is not defined, then define it if($decrement == undefined){ var $decrement = 11; }//End if if($fadeLimit == undefined){ var $fadeLimit = 0; }//End if if(eval($mcObject)._alpha < $fadeLimit){ return(true); } else { eval($mcObject)._alpha -= $decrement; }//End if }//End function |
Oldes 2-Mar-2006 [123x3] | Movieclip.prototype.fade: func[speed][ this.speed: speed this.f_index: this._alpha if this.f_index >= 100 [ this.fade_by: 0 - this.speed] if this.f_index <= 0 [ this.fade_by: this.speed] this._alpha: this._alpha + this.fade_by; ] |
or | |
Movieclip.prototype.fade: func[speed][ this.speed: speed tellTarget this [ f_index: _alpha if f_index >= 100 [ fade_by: 0 - speed] if f_index <= 0 [ fade_by: speed] _alpha: _alpha + fade_by ] ] | |
james_nak 2-Mar-2006 [126] | You're too good. So how then do you use this? |
james_nak 5-Mar-2006 [127] | Oldes, making some progress thanks to your help. There is one example with soem embedded rebol code (the arc example). Is there a way to have rebol do some processing then expose what it does to flash? I want to write a function in rebol to take a string and create a block of characters which I then want to pass to flash. For example, I can hardcode a_block: ["h" "e" "l" "l" "o"] but I would rather send the string "hello" to a function and have it generate that block then pass it to flash. It seems that what I do within a "rebol [ ]" block is hidden from flash. |
Oldes 5-Mar-2006 [128x9] | First of all, I must say, that there are two main parts of the dialect, one which are related to making shapes and sprites in the timelines (processed by rswf/tag-rules) and actions (in doAction and DoInitAction tags and as a part of Actions subtag in placing sprites and in button events) - This is processed by rswf/actions-parser |
you can use Rebol tag to do any Rebol evaluation, but it does not return anything, it's not meant to use something like: spr_mysprite: rebol [some code] | |
but you may use: rebol [ rswf/compile load rejoin [{spr_} spritename {: sprite shp_someshape}]] | |
but in Actions you can use: now: rebol [ rejoin [ a_block " " now]] | |
(will test it if it's working like that, I'm not using it:) | |
yes, it's working:-)) | |
doAction [ info: rebol [now] info: reform [(rebol [rejoin ["h" "e" "l" "l" "o"]]) "now is:" info] ] | |
But it's not working well with blocks, so now if you want to create varaible with block during compilation, you should use: | |
doAction [ rebol [ myRebolBlock: ["h" "e" "l" "l" "o"] ;this is Rebol's variable rswf/compile-actions compose/only [info: (myRebolBlock)] ] ] | |
james_nak 6-Mar-2006 [137x2] | Thanks Oldes, I will try that. The dialect and AS are becoming clearer now with all the info you have given me. I look forward to writing lots of cool things. Thanks for the hint about the two main parts. I wondered how they were connected as most of the AS tutorial have you create something with the GUI then add the AS part. |
Worked great! Is there any way to pass AS vars to a rebol block? You must think I'm crazy but this is an amazing piece of coding and I am determined to use it. I'm curious but when you created your work for the incredible web pages you've done, did you make libraries or are they basically one large script? | |
Oldes 7-Mar-2006 [139] | How you want to pass AS vars to Rebol? Once you compile the RSWF dialect file, you have Flash which has nothing to do with Rebol. But you can connect Flash and Rebol using various ways (, getUrl, loadVariables or XMLsocket connections). When I do some bigger projects, I do not use one file, but rather more files conected together using "include" or "require" tags. |
james_nak 7-Mar-2006 [140] | You know that is true. I hadn't thought of that. |
Oldes 7-Mar-2006 [141] | I also use import-swf tag to get SWF graphics into my projects (when I don't want to load the SWFs using loadMovie) |
james_nak 7-Mar-2006 [142x3] | I'm going to start a new website project and am excited about designing some stuff. If I could only make the cool things you do... |
As for my passing VARS to AS, I see now that I'll have to write something in AS completely if I want to accomplish what I thought would be a neat function. | |
I'm going to study your sites for more great ideas! Thanks for your help. After all ths time RSWF is coming alive for me. I realize though that one has to have artistic talent. You obviously do. Thanks again. | |
Oldes 9-Mar-2006 [145x2] | You may see that I have to close the functions into parenthesis |
(oops:-) | |
Oldes 15-Mar-2006 [147] | And here is new example again: http://box.lebeda.ws/~hmm/rswf/index.php?example=155 using precompiled tweening prototype |
Oldes 16-Mar-2006 [148] | http://box.lebeda.ws/~hmm/rswf/index.php?example=158 |
Terry 16-Mar-2006 [149] | Oldes, do you have an eample that could create and embed a swf on the fly ie: via cgi? |
Oldes 16-Mar-2006 [150x3] | I would not use something like that. Why? You can have everything precompiled. |
And it's easy, you just run rswf and call MAKE-SWF and print the result (probably would have to remove some warnings which are printed when I run make-swf) | |
that's can be done just setting print: prin: none | |
Terry 16-Mar-2006 [153x2] | I'm thinking about generating on the fly |
By the way .. i like the title of "to see stupid chinese wathing atomic bomb explosion" those chinese... crack me up.. | |
Oldes 16-Mar-2006 [155x4] | hm, it's not so funny, they were really watching atomic explosion. And probably were not so stupid, just the leaders who forced them do such a experiments. |
just found that the movies for this example http://box.lebeda.ws/~hmm/rswf/index.php?example=116 were missing - in the movie in the middle are czech soldiers on acid and the rest are the same chinese soldiers preparing to watch atomic explosion. | |
framTo tweening: http://box.lebeda.ws/~hmm/rswf/index.php?example=159 | |
Organic window: http://box.lebeda.ws/~hmm/rswf/index.php?example=160 | |
james_nak 16-Mar-2006 [159] | Thanks Oldes. I will check those out. |
Oldes 16-Mar-2006 [160] | I've added an experiment with the Flash's security model http://box.lebeda.ws/~hmm/rswf/index.php?example=161 (there is added new tag so update your rswf dialect from the page) I'm not sure if it's working, but it should because it produces the same thing as this Macromedia's tool http://www.macromedia.com/support/flashplayer/downloads.html#lcu |
james_nak 16-Mar-2006 [161x2] | Love that elasticboy. That's funny. |
Oldes, all very good examples. Thanks. | |
[unknown: 9] 16-Mar-2006 [163] | I got to see a demo of this product : www.Lazlosystems.com which is a language that spews out both Flash and JavaScript. (and they look the same). |
Oldes 17-Mar-2006 [164x2] | I've just updated the dialect to be able override the default settings for maximum recursion depth and ActionScript time-out: http://box.lebeda.ws/~hmm/rswf/index.php?example=162 |
james: the elasticboy is not my flash file! it's just a test if it's possible to download movie from other domain. | |
james_nak 20-Mar-2006 [166] | Yes, but it's still funny. Keep up th egood work. |
Oldes 21-Mar-2006 [167] | I'm just looking what's new with Flash 8.5 (beta) http://labs.macromedia.com |
older newer | first last |